1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 10:24:33 +01:00

[sproutvideo] Download multiple video in a single webpage

This commit is contained in:
thezero 2019-08-06 20:32:00 +02:00
parent 36071a8d06
commit c956f4a736
2 changed files with 9 additions and 13 deletions

View File

@ -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')

View File

@ -25,16 +25,11 @@ class SproutVideoIE(InfoExtractor):
} }
@staticmethod @staticmethod
def _extract_url(webpage): def _extract_urls(webpage):
sproutvideo = re.search( # Fix the video URL if the iframe doesn't have a defined schema
r'(?:<iframe\s+class=[\'\"]sproutvideo-player.*src|href)=[\'\"](?P<url>(?:https?:|)%s[^\'\"]+)[\'\"]' % SproutVideoIE._NOSCHEMA_URL, webpage) return [sprout.group('url') for sprout in re.finditer(
if sproutvideo: r'(?:<iframe\s+class=[\'\"]sproutvideo-player.*src|href)=[\'\"](?P<url>(?:https?:|)%s[^\'\"]+)[\'\"]' % SproutVideoIE._NOSCHEMA_URL,
video_url = sproutvideo.group('url') 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
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)