diff --git a/README.rst b/README.rst index 2148c421..0213ea96 100644 --- a/README.rst +++ b/README.rst @@ -205,7 +205,7 @@ Some extractors require you to provide valid login credentials in the form of a username & password pair. This is necessary for ``pixiv``, ``nijie``, and ``seiga`` and optional for -``danbooru``, ``e621``, ``exhentai``, ``idolcomplex``, ``inkbunny``, +``aryion``, ``danbooru``, ``e621``, ``exhentai``, ``idolcomplex``, ``inkbunny``, ``instagram``, ``luscious``, ``sankaku``, ``subscribestar``, ``tsumino``, and ``twitter``. diff --git a/docs/configuration.rst b/docs/configuration.rst index 308b4c4d..e6cbbb7b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -224,6 +224,7 @@ Description The username and password to use when attempting to log in to and optional for + * ``aryion`` * ``danbooru`` * ``e621`` * ``exhentai`` diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 2db802de..56147e91 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -18,6 +18,11 @@ { "external": false }, + "aryion": + { + "username": null, + "password": null + }, "blogger": { "videos": true diff --git a/docs/supportedsites.rst b/docs/supportedsites.rst index dd011f23..b76450cd 100644 --- a/docs/supportedsites.rst +++ b/docs/supportedsites.rst @@ -28,7 +28,7 @@ Doki Reader https://kobato.hologfx.com/reader/ Chapters, Manga Dynasty Reader https://dynasty-scans.com/ Chapters, individual Images, Search Results E-Hentai https://e-hentai.org/ Favorites, Galleries, Search Results Optional e621 https://e621.net/ Pools, Popular Images, Posts, Tag Searches Optional -Eka's Portal https://aryion.com/ Galleries, Posts Optional (`Cookies `__) +Eka's Portal https://aryion.com/ Galleries, Posts Optional ExHentai https://exhentai.org/ Favorites, Galleries, Search Results Optional Fallen Angels Scans https://www.fascans.com/ Chapters, Manga Fashion Nova https://www.fashionnova.com/ Collections, Products diff --git a/gallery_dl/extractor/aryion.py b/gallery_dl/extractor/aryion.py index dc082fd2..2e4c4d4b 100644 --- a/gallery_dl/extractor/aryion.py +++ b/gallery_dl/extractor/aryion.py @@ -9,7 +9,8 @@ """Extractors for https://aryion.com/""" from .common import Extractor, Message -from .. import text, util +from .. import text, util, exception +from ..cache import cache BASE_PATTERN = r"(?:https?://)?(?:www\.)?aryion\.com/g4" @@ -21,6 +22,8 @@ class AryionExtractor(Extractor): directory_fmt = ("{category}", "{user!l}", "{path:J - }") filename_fmt = "{id} {title}.{extension}" archive_fmt = "{id}" + cookiedomain = ".aryion.com" + cookienames = ("phpbb3_rl7a3_sid",) root = "https://aryion.com" def __init__(self, match): @@ -28,7 +31,30 @@ class AryionExtractor(Extractor): self.user = match.group(1) self.recursive = True + def login(self): + username, password = self._get_auth_info() + if username: + self._update_cookies(self._login_impl(username, password)) + + @cache(maxage=14*24*3600, keyarg=1) + def _login_impl(self, username, password): + self.log.info("Logging in as %s", username) + + url = self.root + "/forum/ucp.php?mode=login" + data = { + "username": username, + "password": password, + "login": "Login", + } + + response = self.request(url, method="POST", data=data) + if b"You have been successfully logged in." not in response.content: + raise exception.AuthenticationError() + return {c: response.cookies[c] for c in self.cookienames} + def items(self): + self.login() + for post_id in self.posts(): post = self._parse_post(post_id) if post: diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py index eff55ce8..23e61247 100755 --- a/scripts/supportedsites.py +++ b/scripts/supportedsites.py @@ -149,7 +149,7 @@ _COOKIES = " (`Cookies `__)" _APIKEY_WH = " (`API Key `__)" AUTH_MAP = { - "aryion" : "Optional" + _COOKIES, + "aryion" : "Optional", "baraag" : "Optional" + _OAUTH, "danbooru" : "Optional", "deviantart" : "Optional" + _OAUTH,