[2chen] update domain to sturdychan.help
This commit is contained in:
@@ -15,7 +15,7 @@ Consider all sites to be NSFW unless otherwise known.
|
|||||||
<tbody valign="top">
|
<tbody valign="top">
|
||||||
<tr>
|
<tr>
|
||||||
<td>2chen</td>
|
<td>2chen</td>
|
||||||
<td>https://2chen.moe/</td>
|
<td>https://sturdychan.help/</td>
|
||||||
<td>Boards, Threads</td>
|
<td>Boards, Threads</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -4,35 +4,46 @@
|
|||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
"""Extractors for https://2chen.moe/"""
|
"""Extractors for https://sturdychan.help/"""
|
||||||
|
|
||||||
from .common import Extractor, Message
|
from .common import Extractor, Message
|
||||||
from .. import text
|
from .. import text
|
||||||
|
|
||||||
|
BASE_PATTERN = r"(?:https?://)?(?:sturdychan.help|2chen\.(?:moe|club))"
|
||||||
|
|
||||||
|
|
||||||
class _2chenThreadExtractor(Extractor):
|
class _2chenThreadExtractor(Extractor):
|
||||||
"""Extractor for 2chen threads"""
|
"""Extractor for 2chen threads"""
|
||||||
category = "2chen"
|
category = "2chen"
|
||||||
subcategory = "thread"
|
subcategory = "thread"
|
||||||
|
root = "https://sturdychan.help"
|
||||||
directory_fmt = ("{category}", "{board}", "{thread} {title}")
|
directory_fmt = ("{category}", "{board}", "{thread} {title}")
|
||||||
filename_fmt = "{time} {filename}.{extension}"
|
filename_fmt = "{time} {filename}.{extension}"
|
||||||
archive_fmt = "{board}_{thread}_{hash}_{time}"
|
archive_fmt = "{board}_{thread}_{hash}_{time}"
|
||||||
pattern = r"(?:https?://)?2chen\.(?:moe|club)/([^/?#]+)/(\d+)"
|
pattern = BASE_PATTERN + r"/([^/?#]+)/(\d+)"
|
||||||
test = (
|
test = (
|
||||||
("https://2chen.moe/tv/496715", {
|
("https://sturdychan.help/tv/268929", {
|
||||||
"pattern": r"https://2chen\.su/assets/images/src/\w{40}\.\w+$",
|
"pattern": r"https://sturdychan\.help/assets/images"
|
||||||
|
r"/src/\w{40}\.\w+$",
|
||||||
"count": ">= 179",
|
"count": ">= 179",
|
||||||
|
"keyword": {
|
||||||
|
"board": "tv",
|
||||||
|
"date": "type:datetime",
|
||||||
|
"hash": r"re:[0-9a-f]{40}",
|
||||||
|
"name": "Anonymous",
|
||||||
|
"no": r"re:\d+",
|
||||||
|
"thread": "268929",
|
||||||
|
"time": int,
|
||||||
|
"title": "「/ttg/ #118: 🇧🇷 edition」",
|
||||||
|
"url": str,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
("https://2chen.club/tv/1", {
|
("https://2chen.club/tv/1"),
|
||||||
"count": 5,
|
|
||||||
}),
|
|
||||||
# 404
|
|
||||||
("https://2chen.moe/jp/303786"),
|
("https://2chen.moe/jp/303786"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
Extractor.__init__(self, match)
|
Extractor.__init__(self, match)
|
||||||
self.root = text.root_from_url(match.group(0))
|
|
||||||
self.board, self.thread = match.groups()
|
self.board, self.thread = match.groups()
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
@@ -88,9 +99,10 @@ class _2chenBoardExtractor(Extractor):
|
|||||||
"""Extractor for 2chen boards"""
|
"""Extractor for 2chen boards"""
|
||||||
category = "2chen"
|
category = "2chen"
|
||||||
subcategory = "board"
|
subcategory = "board"
|
||||||
pattern = r"(?:https?://)?2chen\.(?:moe|club)/([^/?#]+)(?:/catalog|/?$)"
|
root = "https://sturdychan.help"
|
||||||
|
pattern = BASE_PATTERN + r"/([^/?#]+)(?:/catalog|/?$)"
|
||||||
test = (
|
test = (
|
||||||
("https://2chen.moe/co/", {
|
("https://sturdychan.help/co/", {
|
||||||
"pattern": _2chenThreadExtractor.pattern
|
"pattern": _2chenThreadExtractor.pattern
|
||||||
}),
|
}),
|
||||||
("https://2chen.moe/co"),
|
("https://2chen.moe/co"),
|
||||||
@@ -100,7 +112,6 @@ class _2chenBoardExtractor(Extractor):
|
|||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
Extractor.__init__(self, match)
|
Extractor.__init__(self, match)
|
||||||
self.root = text.root_from_url(match.group(0))
|
|
||||||
self.board = match.group(1)
|
self.board = match.group(1)
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user