mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-03 10:14:42 +01:00
[NBC/ThePlatform/Generic] Add a generic detector for NBCSportsVPlayer and enhance error detection in ThePlatformIE
This commit is contained in:
parent
1d31e7a2fc
commit
a2edf2e7ff
@ -29,6 +29,7 @@
|
||||
xpath_text,
|
||||
)
|
||||
from .brightcove import BrightcoveIE
|
||||
from .nbc import NBCSportsVPlayerIE
|
||||
from .ooyala import OoyalaIE
|
||||
from .rutv import RUTVIE
|
||||
from .smotri import SmotriIE
|
||||
@ -639,6 +640,15 @@ class GenericIE(InfoExtractor):
|
||||
'upload_date': '20150228',
|
||||
'title': 'pdv_maddow_netcast_m4v-02-27-2015-201624',
|
||||
}
|
||||
},
|
||||
# NBC Sports vplayer embeds
|
||||
{
|
||||
'url': 'http://bbs.clutchfans.net/showthread.php?t=244180',
|
||||
'info_dict': {
|
||||
'id': '_hqLjQ95yx8Z',
|
||||
'ext': 'flv'
|
||||
},
|
||||
'skip': 'This content expired on 9/17/14 12:23 PM',
|
||||
}
|
||||
]
|
||||
|
||||
@ -1252,6 +1262,11 @@ def _playlist_from_matches(matches, getter=None, ie=None):
|
||||
if mobj is not None:
|
||||
return self.url_result('5min:%s' % mobj.group('id'), 'FiveMin')
|
||||
|
||||
# Look for NBC Sports VPlayer embeds
|
||||
nbc_sports_url = NBCSportsVPlayerIE._extract_url(webpage)
|
||||
if nbc_sports_url:
|
||||
return self.url_result(nbc_sports_url, 'NBCSportsVPlayer')
|
||||
|
||||
def check_video(vurl):
|
||||
if YoutubeIE.suitable(vurl):
|
||||
return True
|
||||
|
@ -51,7 +51,7 @@ def _real_extract(self, url):
|
||||
|
||||
|
||||
class NBCSportsVPlayerIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://vplayer\.nbcsports\.com/(?:[^/]+/)+(?P<id>[0-9a-zA-Z]+)'
|
||||
_VALID_URL = r'https?://vplayer\.nbcsports\.com/(?:[^/]+/)+(?P<id>[0-9a-zA-Z_]+)'
|
||||
|
||||
_TEST = {
|
||||
'url': 'https://vplayer.nbcsports.com/p/BxmELC/nbcsports_share/select/9CsDKds0kvHI',
|
||||
|
@ -92,7 +92,7 @@ def _real_extract(self, url):
|
||||
error_msg = next(
|
||||
n.attrib['abstract']
|
||||
for n in meta.findall(_x('.//smil:ref'))
|
||||
if n.attrib.get('title') == 'Geographic Restriction')
|
||||
if n.attrib.get('title') == 'Geographic Restriction' or n.attrib.get('title') == 'Expired')
|
||||
except StopIteration:
|
||||
pass
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user