1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[warosu] fix file URLs

This commit is contained in:
Mike Fährmann 2023-11-24 02:44:55 +01:00
parent 645b4627ef
commit f9dac43be9
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 19 additions and 16 deletions

View File

@ -90,4 +90,7 @@ class WarosuThreadExtractor(Extractor):
data["filename"] = text.unquote(extr( data["filename"] = text.unquote(extr(
"", "<").rstrip().rpartition(".")[0]) "", "<").rstrip().rpartition(".")[0])
extr("<br>", "") extr("<br>", "")
data["image"] = self.root + extr("<a href=", ">")
data["image"] = url = extr("<a href=", ">")
if url[0] == "/":
data["image"] = self.root + url

View File

@ -13,17 +13,17 @@ __tests__ = (
"#category": ("", "warosu", "thread"), "#category": ("", "warosu", "thread"),
"#class" : warosu.WarosuThreadExtractor, "#class" : warosu.WarosuThreadExtractor,
"#urls" : ( "#urls" : (
"https://warosu.org/data/jp/img/0166/56/1488487280004.png", "https://i.warosu.org/data/jp/img/0166/56/1488487280004.png",
"https://warosu.org/data/jp/img/0166/56/1488493239417.png", "https://i.warosu.org/data/jp/img/0166/56/1488493239417.png",
"https://warosu.org/data/jp/img/0166/56/1488493636725.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488493636725.jpg",
"https://warosu.org/data/jp/img/0166/56/1488493700040.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488493700040.jpg",
"https://warosu.org/data/jp/img/0166/56/1488499585168.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488499585168.jpg",
"https://warosu.org/data/jp/img/0166/56/1488530851199.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488530851199.jpg",
"https://warosu.org/data/jp/img/0166/56/1488536072155.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488536072155.jpg",
"https://warosu.org/data/jp/img/0166/56/1488603426484.png", "https://i.warosu.org/data/jp/img/0166/56/1488603426484.png",
"https://warosu.org/data/jp/img/0166/56/1488647021253.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488647021253.jpg",
"https://warosu.org/data/jp/img/0166/56/1488866825031.jpg", "https://i.warosu.org/data/jp/img/0166/56/1488866825031.jpg",
"https://warosu.org/data/jp/img/0166/56/1489094956868.jpg", "https://i.warosu.org/data/jp/img/0166/56/1489094956868.jpg",
), ),
}, },
@ -32,7 +32,7 @@ __tests__ = (
"#category": ("", "warosu", "thread"), "#category": ("", "warosu", "thread"),
"#class" : warosu.WarosuThreadExtractor, "#class" : warosu.WarosuThreadExtractor,
"#sha1_content" : "d48df0a701e6599312bfff8674f4aa5d4fb8db1c", "#sha1_content" : "d48df0a701e6599312bfff8674f4aa5d4fb8db1c",
"#urls" : "https://warosu.org/data/jp/img/0166/58/1488521824388.jpg", "#urls" : "https://i.warosu.org/data/jp/img/0166/58/1488521824388.jpg",
"#count" : 1, "#count" : 1,
"board" : "jp", "board" : "jp",
@ -43,7 +43,7 @@ __tests__ = (
"filename" : "sadako-vs-kayako-movie-review", "filename" : "sadako-vs-kayako-movie-review",
"fsize" : "55 KB", "fsize" : "55 KB",
"h" : 675, "h" : 675,
"image" : "https://warosu.org/data/jp/img/0166/58/1488521824388.jpg", "image" : "https://i.warosu.org/data/jp/img/0166/58/1488521824388.jpg",
"name" : "Anonymous", "name" : "Anonymous",
"no" : 16658073, "no" : 16658073,
"now" : "Fri Mar 3 01:17:04 2017", "now" : "Fri Mar 3 01:17:04 2017",
@ -58,7 +58,7 @@ __tests__ = (
"#url" : "https://warosu.org/ic/thread/4604652", "#url" : "https://warosu.org/ic/thread/4604652",
"#category": ("", "warosu", "thread"), "#category": ("", "warosu", "thread"),
"#class" : warosu.WarosuThreadExtractor, "#class" : warosu.WarosuThreadExtractor,
"#pattern" : r"https://warosu\.org/data/ic/img/0046/04/1590\d{9}\.jpg", "#pattern" : r"https://i.warosu\.org/data/ic/img/0046/04/1590\d{9}\.jpg",
"#count" : 133, "#count" : 133,
"board" : "ic", "board" : "ic",
@ -68,7 +68,7 @@ __tests__ = (
"filename" : str, "filename" : str,
"fsize" : str, "fsize" : str,
"h" : range(200, 3507), "h" : range(200, 3507),
"image" : r"re:https://warosu\.org/data/ic/img/0046/04/1590\d+\.jpg", "image" : r"re:https://i.warosu\.org/data/ic/img/0046/04/1590\d+\.jpg",
"name" : "re:Anonymous|Dhe Specky Spider-Man", "name" : "re:Anonymous|Dhe Specky Spider-Man",
"no" : range(4604652, 4620000), "no" : range(4604652, 4620000),
"now" : r"re:\w\w\w \w\w\w \d\d \d\d:\d\d:\d\d 2020", "now" : r"re:\w\w\w \w\w\w \d\d \d\d:\d\d:\d\d 2020",