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

[patreon] use mobile UA (#6241, #6239, #6140)

This commit is contained in:
Mike Fährmann 2024-10-01 07:38:12 +02:00
parent 7d0e5877ce
commit 321161c769
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 7 additions and 6 deletions

View File

@ -627,7 +627,7 @@ Description
and use the User-Agent used by the system's default browser.
Note: This option has no effect on
`pixiv`, `e621`, and `mangadex`
`pixiv`, `e621`, `mangadex`, and `patreon`
extractors, as these need specific values to function correctly.
@ -636,7 +636,7 @@ extractor.*.browser
Type
``string``
Default
* ``"firefox"``: ``artstation``, ``mangasee``, ``patreon``, ``pixiv:series``, ``twitter``
* ``"firefox"``: ``artstation``, ``mangasee``, ``twitter``
* ``null``: otherwise
Example
* ``"chrome:macos"``
@ -712,7 +712,7 @@ extractor.*.tls12
Type
``bool``
Default
* ``false``: ``artstation``, ``patreon``, ``pixiv:series``
* ``false``: ``artstation``
* ``true``: otherwise
Description
Allow selecting TLS 1.2 cipher suites.

View File

@ -23,16 +23,17 @@ class PatreonExtractor(Extractor):
directory_fmt = ("{category}", "{creator[full_name]}")
filename_fmt = "{id}_{title}_{num:>02}.{extension}"
archive_fmt = "{id}_{num}"
browser = "firefox"
tls12 = False
_warning = True
def items(self):
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",)):
self.log.warning("no 'session_id' cookie set")
PatreonExtractor._warning = False
def items(self):
generators = self._build_file_generators(self.config("files"))
for post in self.posts():