[2chen] implement generic 2chen board extractors

support
- https://sturdychan.help/
- https://schan.help/ (#8680)
This commit is contained in:
Mike Fährmann
2025-12-13 18:08:50 +01:00
parent a8ca947154
commit 8f621b32bd
4 changed files with 93 additions and 47 deletions

37
test/results/schan.py Normal file
View File

@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
gallery_dl = __import__("gallery_dl.extractor.2chen")
_2chen = getattr(gallery_dl.extractor, "2chen")
__tests__ = (
{
"#url" : "https://schan.help/tv/757",
"#category": ("2chen", "schan", "thread"),
"#class" : _2chen._2chenThreadExtractor,
"#pattern" : r"https://schan\.help/assets/images/src/\w{40}\.\w+$",
"#count" : ">= 179",
"board" : "tv",
"date" : "type:datetime",
"hash" : "",
"name" : "Anonymous",
"no" : r"re:\d+",
"thread": "757",
"time" : int,
"title" : "「/ttg/ #1: The Future of Schan」",
"url" : str,
},
{
"#url" : "https://schan.help/tv/",
"#category": ("2chen", "schan", "board"),
"#class" : _2chen._2chenBoardExtractor,
"#pattern" : _2chen._2chenThreadExtractor.pattern,
},
)

View File

@@ -11,7 +11,7 @@ _2chen = getattr(gallery_dl.extractor, "2chen")
__tests__ = (
{
"#url" : "https://sturdychan.help/tv/268929",
"#category": ("", "2chen", "thread"),
"#category": ("2chen", "sturdychan", "thread"),
"#class" : _2chen._2chenThreadExtractor,
"#pattern" : r"https://sturdychan\.help/assets/images/src/\w{40}\.\w+$",
"#count" : ">= 179",
@@ -29,38 +29,38 @@ __tests__ = (
{
"#url" : "https://2chen.club/tv/1",
"#category": ("", "2chen", "thread"),
"#category": ("2chen", "sturdychan", "thread"),
"#class" : _2chen._2chenThreadExtractor,
},
{
"#url" : "https://2chen.moe/jp/303786",
"#category": ("", "2chen", "thread"),
"#category": ("2chen", "sturdychan", "thread"),
"#class" : _2chen._2chenThreadExtractor,
},
{
"#url" : "https://sturdychan.help/co/",
"#category": ("", "2chen", "board"),
"#category": ("2chen", "sturdychan", "board"),
"#class" : _2chen._2chenBoardExtractor,
"#pattern" : _2chen._2chenThreadExtractor.pattern,
},
{
"#url" : "https://2chen.moe/co",
"#category": ("", "2chen", "board"),
"#category": ("2chen", "sturdychan", "board"),
"#class" : _2chen._2chenBoardExtractor,
},
{
"#url" : "https://2chen.club/tv",
"#category": ("", "2chen", "board"),
"#category": ("2chen", "sturdychan", "board"),
"#class" : _2chen._2chenBoardExtractor,
},
{
"#url" : "https://2chen.moe/co/catalog",
"#category": ("", "2chen", "board"),
"#category": ("2chen", "sturdychan", "board"),
"#class" : _2chen._2chenBoardExtractor,
},