[cyberdrop] add fallback URLs (#2668)
This commit is contained in:
@@ -48,10 +48,11 @@ class CyberdropAlbumExtractor(lolisafe.LolisafeAlbumExtractor):
|
|||||||
files = []
|
files = []
|
||||||
append = files.append
|
append = files.append
|
||||||
while True:
|
while True:
|
||||||
url = extr('id="file" href="', '"')
|
url = text.unescape(extr('id="file" href="', '"'))
|
||||||
if not url:
|
if not url:
|
||||||
break
|
break
|
||||||
append({"file": text.unescape(url)})
|
append({"file": url,
|
||||||
|
"_fallback": (self.root + url[url.find("/", 8):],)})
|
||||||
|
|
||||||
return files, {
|
return files, {
|
||||||
"album_id" : self.album_id,
|
"album_id" : self.album_id,
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ class LolisafeAlbumExtractor(LolisafeExtractor):
|
|||||||
yield Message.Directory, data
|
yield Message.Directory, data
|
||||||
for data["num"], file in enumerate(files, 1):
|
for data["num"], file in enumerate(files, 1):
|
||||||
url = file["file"]
|
url = file["file"]
|
||||||
|
if "_fallback" in file:
|
||||||
|
data["_fallback"] = file["_fallback"]
|
||||||
text.nameext_from_url(url, data)
|
text.nameext_from_url(url, data)
|
||||||
data["name"], sep, data["id"] = data["filename"].rpartition("-")
|
data["name"], sep, data["id"] = data["filename"].rpartition("-")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user