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(
|
return self.playlist_from_matches(
|
||||||
zype_urls, video_id, video_title, ie=ZypeIE.ie_key())
|
zype_urls, video_id, video_title, ie=ZypeIE.ie_key())
|
||||||
|
|
||||||
sproutvideo_url = SproutVideoIE._extract_url(webpage)
|
sproutvideo_urls = SproutVideoIE._extract_urls(webpage)
|
||||||
if sproutvideo_url:
|
if sproutvideo_urls:
|
||||||
return self.url_result(sproutvideo_url)
|
return self.playlist_from_matches(
|
||||||
|
sproutvideo_urls, video_id, video_title, ie=SproutVideoIE.ie_key())
|
||||||
|
|
||||||
# Look for HTML5 media
|
# Look for HTML5 media
|
||||||
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
|
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
|
||||||
|
@ -25,16 +25,11 @@ class SproutVideoIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_url(webpage):
|
def _extract_urls(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')
|
|
||||||
# Fix the video URL if the iframe doesn't have a defined schema
|
# Fix the video URL if the iframe doesn't have a defined schema
|
||||||
if video_url[:2] == '//':
|
return [sprout.group('url') for sprout in re.finditer(
|
||||||
video_url = 'https:' + video_url
|
r'(?:<iframe\s+class=[\'\"]sproutvideo-player.*src|href)=[\'\"](?P<url>(?:https?:|)%s[^\'\"]+)[\'\"]' % SproutVideoIE._NOSCHEMA_URL,
|
||||||
return video_url
|
webpage)]
|
||||||
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user