mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 02:14:32 +01:00
[sproutvideo] Download multiple video in a single webpage
This commit is contained in:
parent
36071a8d06
commit
c956f4a736
@ -3214,9 +3214,10 @@ class GenericIE(InfoExtractor):
|
||||
return self.playlist_from_matches(
|
||||
zype_urls, video_id, video_title, ie=ZypeIE.ie_key())
|
||||
|
||||
sproutvideo_url = SproutVideoIE._extract_url(webpage)
|
||||
if sproutvideo_url:
|
||||
return self.url_result(sproutvideo_url)
|
||||
sproutvideo_urls = SproutVideoIE._extract_urls(webpage)
|
||||
if sproutvideo_urls:
|
||||
return self.playlist_from_matches(
|
||||
sproutvideo_urls, video_id, video_title, ie=SproutVideoIE.ie_key())
|
||||
|
||||
# Look for HTML5 media
|
||||
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
|
||||
|
@ -25,16 +25,11 @@ class SproutVideoIE(InfoExtractor):
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _extract_url(webpage):
|
||||
sproutvideo = re.search(
|
||||
r'(?:<iframe\s+class=[\'\"]sproutvideo-player.*src|href)=[\'\"](?P<url>(?:https?:|)%s[^\'\"]+)[\'\"]' % SproutVideoIE._NOSCHEMA_URL, webpage)
|
||||
if sproutvideo:
|
||||
video_url = sproutvideo.group('url')
|
||||
def _extract_urls(webpage):
|
||||
# Fix the video URL if the iframe doesn't have a defined schema
|
||||
if video_url[:2] == '//':
|
||||
video_url = 'https:' + video_url
|
||||
return video_url
|
||||
|
||||
return [sprout.group('url') for sprout in re.finditer(
|
||||
r'(?:<iframe\s+class=[\'\"]sproutvideo-player.*src|href)=[\'\"](?P<url>(?:https?:|)%s[^\'\"]+)[\'\"]' % SproutVideoIE._NOSCHEMA_URL,
|
||||
webpage)]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
|
Loading…
Reference in New Issue
Block a user