aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhwgh1968 <jhwgh1968@protonmail.com>2021-08-10 13:51:12 +0000
committerGitHub <noreply@github.com>2021-08-10 19:21:12 +0530
commitc196640ff177022ec18150849e4f0de668468569 (patch)
tree9bb11d7fab8b2b5ba97fca82b3bf4f41a5f3def2
parent60c8fc73c6e6fe2189e0417a9847705f4baae05f (diff)
downloadhypervideo-pre-c196640ff177022ec18150849e4f0de668468569.tar.lz
hypervideo-pre-c196640ff177022ec18150849e4f0de668468569.tar.xz
hypervideo-pre-c196640ff177022ec18150849e4f0de668468569.zip
[eroprofile] Add album downloader (#658)
Authored by: jhwgh1968
-rw-r--r--yt_dlp/extractor/eroprofile.py37
-rw-r--r--yt_dlp/extractor/extractors.py5
2 files changed, 41 insertions, 1 deletions
diff --git a/yt_dlp/extractor/eroprofile.py b/yt_dlp/extractor/eroprofile.py
index c460dc7f9..54ed9a49e 100644
--- a/yt_dlp/extractor/eroprofile.py
+++ b/yt_dlp/extractor/eroprofile.py
@@ -90,3 +90,40 @@ class EroProfileIE(InfoExtractor):
'title': title,
'age_limit': 18,
})
+
+
+class EroProfileAlbumIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/album/(?P<id>[^/]+)'
+ IE_NAME = 'EroProfile:album'
+
+ _TESTS = [{
+ 'url': 'https://www.eroprofile.com/m/videos/album/BBW-2-893',
+ 'info_dict': {
+ 'id': 'BBW-2-893',
+ 'title': 'BBW 2'
+ },
+ 'playlist_mincount': 486,
+ },
+ ]
+
+ def _extract_from_page(self, page):
+ for url in re.findall(r'href=".*?(/m/videos/view/[^"]+)"', page):
+ yield self.url_result(f'https://www.eroprofile.com{url}', EroProfileIE.ie_key())
+
+ def _entries(self, playlist_id, first_page):
+ yield from self._extract_from_page(first_page)
+
+ page_urls = re.findall(rf'href=".*?(/m/videos/album/{playlist_id}\?pnum=(\d+))"', first_page)
+
+ 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}'))
+
+ def _real_extract(self, url):
+ playlist_id = self._match_id(url)
+ first_page = self._download_webpage(url, playlist_id, note='Downloading playlist')
+ playlist_title = self._search_regex(
+ r'<title>Album: (.*) - EroProfile</title>', first_page, 'playlist_title')
+
+ return self.playlist_result(self._entries(playlist_id, first_page), playlist_id, playlist_title)
diff --git a/yt_dlp/extractor/extractors.py b/yt_dlp/extractor/extractors.py
index 975fb0328..5b15bb8e7 100644
--- a/yt_dlp/extractor/extractors.py
+++ b/yt_dlp/extractor/extractors.py
@@ -389,7 +389,10 @@ from .elpais import ElPaisIE
from .embedly import EmbedlyIE
from .engadget import EngadgetIE
from .eporner import EpornerIE
-from .eroprofile import EroProfileIE
+from .eroprofile import (
+ EroProfileIE,
+ EroProfileAlbumIE,
+)
from .escapist import EscapistIE
from .espn import (
ESPNIE,