From 78b34bbdd783ab333d73223d1d44b2b37b375804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 25 Apr 2025 20:15:00 +0200 Subject: [PATCH] [subscribestar] fix username & password login --- gallery_dl/extractor/subscribestar.py | 55 +++++++++++++++++++-------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/gallery_dl/extractor/subscribestar.py b/gallery_dl/extractor/subscribestar.py index e9aef9e3..1054a630 100644 --- a/gallery_dl/extractor/subscribestar.py +++ b/gallery_dl/extractor/subscribestar.py @@ -79,7 +79,8 @@ class SubscribestarExtractor(Extractor): username, password = self._get_auth_info() if username: - self.cookies_update(self._login_impl(username, password)) + self.cookies_update(self._login_impl( + (username, self.cookies_domain), password)) if self._warning: if not username or not self.cookies_check(self.cookies_names): @@ -88,30 +89,54 @@ class SubscribestarExtractor(Extractor): @cache(maxage=28*86400, keyarg=1) def _login_impl(self, username, password): + username = username[0] self.log.info("Logging in as %s", username) - url = "https://www.subscribestar.com/session.json" + if self.root.endswith(".adult"): + self.cookies.set("18_plus_agreement_generic", "true", + domain=self.cookies_domain) + + # load login page + url = self.root + "/login" + page = self.request(url).text + headers = { - "Origin" : "https://www.subscribestar.com", - "Referer" : "https://www.subscribestar.com/login", + "Accept": "*/*;q=0.5, text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript", + "Referer": self.root + "/login", + "X-CSRF-Token": text.unescape(text.extr( + page, '