diff options
| author | 2025-12-20 05:49:11 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:11 -0500 | |
| commit | c586ea4b3c871f5696626f9820e8c88a4e78f4a6 (patch) | |
| tree | e6d7bae96282c3d147159f091d451e53bdaa2efe /gallery_dl/extractor/2ch.py | |
| parent | 01a2bf622c31072d1322884584404b9bd59b28cc (diff) | |
| parent | a24ec1647aeac35a63b744ea856011ad6e06be3b (diff) | |
Update upstream source from tag 'upstream/1.31.1'
Update to upstream version '1.31.1'
with Debian dir b5d91c25143175f933b1c69c7e82249cd7e145ab
Diffstat (limited to 'gallery_dl/extractor/2ch.py')
| -rw-r--r-- | gallery_dl/extractor/2ch.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gallery_dl/extractor/2ch.py b/gallery_dl/extractor/2ch.py index 912a251..1f17c99 100644 --- a/gallery_dl/extractor/2ch.py +++ b/gallery_dl/extractor/2ch.py @@ -4,28 +4,28 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -"""Extractors for https://2ch.su/""" +"""Extractors for https://2ch.org/""" from .common import Extractor, Message from .. import text, util -BASE_PATTERN = r"(?:https?://)?2ch\.(su|life|hk)" +BASE_PATTERN = r"(?:https?://)?2ch\.(org|su|life|hk)" class _2chThreadExtractor(Extractor): """Extractor for 2ch threads""" category = "2ch" subcategory = "thread" - root = "https://2ch.su" + root = "https://2ch.org" directory_fmt = ("{category}", "{board}", "{thread} {title}") filename_fmt = "{tim}{filename:? //}.{extension}" archive_fmt = "{board}_{thread}_{tim}" pattern = rf"{BASE_PATTERN}/([^/?#]+)/res/(\d+)" - example = "https://2ch.su/a/res/12345.html" + example = "https://2ch.org/a/res/12345.html" def __init__(self, match): tld = match[1] - self.root = f"https://2ch.{'su' if tld == 'hk' else tld}" + self.root = f"https://2ch.{'org' if tld == 'hk' else tld}" Extractor.__init__(self, match) def items(self): @@ -42,11 +42,11 @@ class _2chThreadExtractor(Extractor): "title" : text.unescape(title)[:50], } - yield Message.Directory, thread + yield Message.Directory, "", thread for post in posts: if files := post.get("files"): post["post_name"] = post["name"] - post["date"] = text.parse_timestamp(post["timestamp"]) + post["date"] = self.parse_timestamp(post["timestamp"]) del post["files"] del post["name"] @@ -65,9 +65,9 @@ class _2chBoardExtractor(Extractor): """Extractor for 2ch boards""" category = "2ch" subcategory = "board" - root = "https://2ch.su" + root = "https://2ch.org" pattern = rf"{BASE_PATTERN}/([^/?#]+)/?$" - example = "https://2ch.su/a/" + example = "https://2ch.org/a/" def __init__(self, match): tld = match[1] |
