From d967c68e4ce83d48f50d97710123bb4ed8f95d1b Mon Sep 17 00:00:00 2001 From: jhwgh1968 Date: Sun, 15 Aug 2021 06:02:11 +0000 Subject: [PATCH] [eroprofile] Fix page skipping in albums (#701) Bug from #658 Authored by: jhwgh1968 --- yt_dlp/extractor/eroprofile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yt_dlp/extractor/eroprofile.py b/yt_dlp/extractor/eroprofile.py index 54ed9a49e2..a8396f1d34 100644 --- a/yt_dlp/extractor/eroprofile.py +++ b/yt_dlp/extractor/eroprofile.py @@ -114,11 +114,13 @@ class EroProfileAlbumIE(InfoExtractor): yield from self._extract_from_page(first_page) page_urls = re.findall(rf'href=".*?(/m/videos/album/{playlist_id}\?pnum=(\d+))"', first_page) + max_page = max(int(n) for _, n in page_urls) - for url, n in page_urls[1:]: - yield from self._extract_from_page(self._download_webpage( - f'https://www.eroprofile.com{url}', - playlist_id, note=f'Downloading playlist page {int(n) - 1}')) + for n in range(2, max_page + 1): + url = f'https://www.eroprofile.com/m/videos/album/{playlist_id}?pnum={n}' + yield from self._extract_from_page( + self._download_webpage(url, playlist_id, + note=f'Downloading playlist page {int(n) - 1}')) def _real_extract(self, url): playlist_id = self._match_id(url)