aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/nsfwalbum.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/nsfwalbum.py')
-rw-r--r--gallery_dl/extractor/nsfwalbum.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/gallery_dl/extractor/nsfwalbum.py b/gallery_dl/extractor/nsfwalbum.py
index eb5d31f..0b84f9c 100644
--- a/gallery_dl/extractor/nsfwalbum.py
+++ b/gallery_dl/extractor/nsfwalbum.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2019-2023 Mike Fährmann
+# Copyright 2019-2025 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -25,7 +25,7 @@ class NsfwalbumAlbumExtractor(GalleryExtractor):
example = "https://nsfwalbum.com/album/12345"
def __init__(self, match):
- self.album_id = match.group(2)
+ self.album_id = match[2]
GalleryExtractor.__init__(self, match)
def metadata(self, page):
@@ -53,7 +53,7 @@ class NsfwalbumAlbumExtractor(GalleryExtractor):
self.request(iframe + image_id).text,
'giraffe.annihilate("', '"')[0])
params = {"spirit": spirit, "photo": image_id}
- data = self.request(backend, params=params).json()
+ data = self.request_json(backend, params=params)
break
except Exception:
tries += 1
@@ -66,17 +66,15 @@ class NsfwalbumAlbumExtractor(GalleryExtractor):
"width" : text.parse_int(data[1]),
"height": text.parse_int(data[2]),
"_http_validate": self._validate_response,
- "_fallback": ("{}/imageProxy.php?photoId={}&spirit={}".format(
- self.root, image_id, spirit),),
+ "_fallback": (f"{self.root}/imageProxy.php"
+ f"?photoId={image_id}&spirit={spirit}",),
}
- @staticmethod
- def _validate_response(response):
+ def _validate_response(self, response):
return not response.url.endswith(
("/no_image.jpg", "/placeholder.png", "/error.jpg"))
- @staticmethod
- def _annihilate(value, base=6):
+ def _annihilate(self, value, base=6):
return "".join(
chr(ord(char) ^ base)
for char in value