mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-27 01:12:28 +00:00
Merge remote-tracking branch 'rzhxeo/embedly'
Conflicts: youtube_dl/extractor/generic.py
This commit is contained in:
commit
f55a1f0a88
1 changed files with 21 additions and 1 deletions
|
@ -116,7 +116,19 @@ class GenericIE(InfoExtractor):
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': False,
|
'skip_download': False,
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
# embed.ly video
|
||||||
|
{
|
||||||
|
'url': 'http://www.tested.com/science/weird/460206-tested-grinding-coffee-2000-frames-second/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '9ODmcdjQcHQ',
|
||||||
|
'ext': 'mp4',
|
||||||
|
},
|
||||||
|
# No need to test YoutubeIE here
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def report_download_webpage(self, video_id):
|
def report_download_webpage(self, video_id):
|
||||||
|
@ -407,6 +419,14 @@ def _real_extract(self, url):
|
||||||
if mobj is not None:
|
if mobj is not None:
|
||||||
return self.url_result(mobj.group('url'), 'HuffPost')
|
return self.url_result(mobj.group('url'), 'HuffPost')
|
||||||
|
|
||||||
|
# Look for embed.ly
|
||||||
|
mobj = re.search(r'class=["\']embedly-card["\'][^>]href=["\'](?P<url>[^"\']+)', webpage)
|
||||||
|
if mobj is not None:
|
||||||
|
return self.url_result(mobj.group('url'))
|
||||||
|
mobj = re.search(r'class=["\']embedly-embed["\'][^>]src=["\'][^"\']*url=(?P<url>[^&]+)', webpage)
|
||||||
|
if mobj is not None:
|
||||||
|
return self.url_result(compat_urllib_parse.unquote(mobj.group('url')))
|
||||||
|
|
||||||
# Start with something easy: JW Player in SWFObject
|
# Start with something easy: JW Player in SWFObject
|
||||||
mobj = re.search(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage)
|
mobj = re.search(r'flashvars: [\'"](?:.*&)?file=(http[^\'"&]*)', webpage)
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
|
|
Loading…
Reference in a new issue