aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/common.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-09-16 02:12:56 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-09-16 02:12:56 -0400
commit12b64cf1aff9cbe17b15aeb9464ef76a773fde1d (patch)
treee3b880c987f94a208a6e9f3d2f3f9ad16d41148c /gallery_dl/extractor/common.py
parent65ba54beaeb6e72364c33b0bf060267d86271239 (diff)
parent3b7f8716690b7aa1994a9cb387bbc7215e01a4ed (diff)
Update upstream source from tag 'upstream/1.30.7'
Update to upstream version '1.30.7' with Debian dir a74b37bdeb92ab9f3d327de717e2b5cc6d11a25f
Diffstat (limited to 'gallery_dl/extractor/common.py')
-rw-r--r--gallery_dl/extractor/common.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py
index 568f435..01965f3 100644
--- a/gallery_dl/extractor/common.py
+++ b/gallery_dl/extractor/common.py
@@ -354,12 +354,11 @@ class Extractor():
raise exception.AbortExtraction(
f"User input required ({prompt.strip(' :')})")
- def _get_auth_info(self):
+ def _get_auth_info(self, password=None):
"""Return authentication information as (username, password) tuple"""
username = self.config("username")
- password = None
- if username:
+ if username or password:
password = self.config("password")
if not password:
self._check_input_allowed("password")
@@ -667,12 +666,18 @@ class Extractor():
return False
def _extract_jsonld(self, page):
- return util.json_loads(text.extr(
- page, '<script type="application/ld+json">', "</script>"))
+ return util.json_loads(
+ text.extr(page, '<script type="application/ld+json">',
+ "</script>") or
+ text.extr(page, "<script type='application/ld+json'>",
+ "</script>"))
def _extract_nextdata(self, page):
- return util.json_loads(text.extr(
- page, ' id="__NEXT_DATA__" type="application/json">', "</script>"))
+ return util.json_loads(
+ text.extr(page, ' id="__NEXT_DATA__" type="application/json">',
+ "</script>") or
+ text.extr(page, " id='__NEXT_DATA__' type='application/json'>",
+ "</script>"))
def _cache(self, func, maxage, keyarg=None):
# return cache.DatabaseCacheDecorator(func, maxage, keyarg)