1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-01-31 19:51:34 +01:00

[fuskator] make metadata extraction non-fatal (#5039)

- prevent KeyErrors
- prevent HTTP redirect
- return file URLs as list
This commit is contained in:
Mike Fährmann 2024-01-08 19:18:12 +01:00
parent 657ed93a22
commit ec958a26bc
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -22,7 +22,7 @@ class FuskatorGalleryExtractor(GalleryExtractor):
def __init__(self, match):
self.gallery_hash = match.group(1)
url = "{}/thumbs/{}/".format(self.root, self.gallery_hash)
url = "{}/thumbs/{}/index.html".format(self.root, self.gallery_hash)
GalleryExtractor.__init__(self, match, url)
def metadata(self, page):
@ -50,15 +50,16 @@ class FuskatorGalleryExtractor(GalleryExtractor):
"gallery_id" : text.parse_int(gallery_id),
"gallery_hash": self.gallery_hash,
"title" : text.unescape(title[:-15]),
"views" : data["hits"],
"score" : data["rating"],
"tags" : data["tags"].split(","),
"count" : len(data["images"]),
"views" : data.get("hits"),
"score" : data.get("rating"),
"tags" : (data.get("tags") or "").split(","),
}
def images(self, page):
for image in self.data["images"]:
yield "https:" + image["imageUrl"], image
return [
("https:" + image["imageUrl"], image)
for image in self.data["images"]
]
class FuskatorSearchExtractor(Extractor):