From ac002cc4b356cc5970b7bfa7c771b9da3f0e4752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 3 Feb 2015 00:22:39 +0100 Subject: [PATCH] [8chan] fix image urls --- gallery_dl/extractor/8chan.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/8chan.py b/gallery_dl/extractor/8chan.py index 2a318cc5..79d485c1 100644 --- a/gallery_dl/extractor/8chan.py +++ b/gallery_dl/extractor/8chan.py @@ -4,7 +4,8 @@ import re class Extractor(BasicExtractor): - thread_url_fmt = "https://www.8ch.net/{0}/res/{1}.html" + url_base = "https://8ch.net" + thread_url_fmt = url_base + "/{0}/res/{1}.html" regex = r'>File: ([^<]+)\.[^<]+<.*?([^<]+)<' def __init__(self, match, config): @@ -18,4 +19,6 @@ class Extractor(BasicExtractor): text = self.request(url).text for match in re.finditer(self.regex, text): url, prefix, fullname, name = match.group(1, 2, 4, 5) + if url.startswith("/"): + url = self.url_base + url yield (url, prefix + "-" + unquote(fullname or name))