summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/2ch.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/2ch.py')
-rw-r--r--gallery_dl/extractor/2ch.py18
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]