mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-26 01:26:45 +00:00
[vimeo] Improve playlists extraction
This commit is contained in:
parent
e8110b8125
commit
2c94198eb6
1 changed files with 9 additions and 10 deletions
|
@ -486,8 +486,7 @@ class VimeoChannelIE(VimeoBaseInfoExtractor):
|
||||||
password_request, list_id,
|
password_request, list_id,
|
||||||
'Verifying the password', 'Wrong password')
|
'Verifying the password', 'Wrong password')
|
||||||
|
|
||||||
def _extract_videos(self, list_id, base_url):
|
def _title_and_entries(self, list_id, base_url):
|
||||||
video_ids = []
|
|
||||||
for pagenum in itertools.count(1):
|
for pagenum in itertools.count(1):
|
||||||
page_url = self._page_url(base_url, pagenum)
|
page_url = self._page_url(base_url, pagenum)
|
||||||
webpage = self._download_webpage(
|
webpage = self._download_webpage(
|
||||||
|
@ -496,18 +495,18 @@ class VimeoChannelIE(VimeoBaseInfoExtractor):
|
||||||
|
|
||||||
if pagenum == 1:
|
if pagenum == 1:
|
||||||
webpage = self._login_list_password(page_url, list_id, webpage)
|
webpage = self._login_list_password(page_url, list_id, webpage)
|
||||||
|
yield self._extract_list_title(webpage)
|
||||||
|
|
||||||
|
for video_id in re.findall(r'id="clip_(\d+?)"', webpage):
|
||||||
|
yield self.url_result('https://vimeo.com/%s' % video_id, 'Vimeo')
|
||||||
|
|
||||||
video_ids.extend(re.findall(r'id="clip_(\d+?)"', webpage))
|
|
||||||
if re.search(self._MORE_PAGES_INDICATOR, webpage, re.DOTALL) is None:
|
if re.search(self._MORE_PAGES_INDICATOR, webpage, re.DOTALL) is None:
|
||||||
break
|
break
|
||||||
|
|
||||||
entries = [self.url_result('https://vimeo.com/%s' % video_id, 'Vimeo')
|
def _extract_videos(self, list_id, base_url):
|
||||||
for video_id in video_ids]
|
title_and_entries = self._title_and_entries(list_id, base_url)
|
||||||
return {'_type': 'playlist',
|
list_title = next(title_and_entries)
|
||||||
'id': list_id,
|
return self.playlist_result(title_and_entries, list_id, list_title)
|
||||||
'title': self._extract_list_title(webpage),
|
|
||||||
'entries': entries,
|
|
||||||
}
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
|
Loading…
Reference in a new issue