1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-21 18:22:30 +01:00

[patreon] use legacy mobile UA when no 'session_id' is set

This commit is contained in:
Mike Fährmann 2024-10-31 17:26:33 +01:00
parent e3fbd6825b
commit 24408cd450
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -26,12 +26,15 @@ class PatreonExtractor(Extractor):
_warning = True
def _init(self):
self.session.headers["User-Agent"] = \
"Patreon/72.2.28 (Android; Android 14; Scale/2.10)"
if self._warning:
if not self.cookies_check(("session_id",)):
if self.cookies_check(("session_id",)):
self.session.headers["User-Agent"] = \
"Patreon/72.2.28 (Android; Android 14; Scale/2.10)"
else:
if self._warning:
PatreonExtractor._warning = False
self.log.warning("no 'session_id' cookie set")
PatreonExtractor._warning = False
self.session.headers["User-Agent"] = \
"Patreon/7.6.28 (Android; Android 11; Scale/2.10)"
def items(self):
generators = self._build_file_generators(self.config("files"))