merge #4714: [4archive] add 'thread' and 'board' extractors

(#1262, #2418, #4400, #4710)
This commit is contained in:
Mike Fährmann
2023-10-25 20:12:07 +02:00
4 changed files with 178 additions and 0 deletions

60
test/results/4archive.py Normal file
View File

@@ -0,0 +1,60 @@
# -*- 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.4archive")
_4archive = getattr(gallery_dl.extractor, "4archive")
import datetime
__tests__ = (
{
"#url" : "https://4archive.org/board/u/thread/2397221",
"#category": ("", "4archive", "thread"),
"#class" : _4archive._4archiveThreadExtractor,
"#pattern" : r"https://i\.imgur\.com/\w{7}\.\w+$",
"#count" : 16,
"board" : "u",
"com" : str,
"date" : datetime.datetime,
"name" : "Anonymous",
"no" : range(2397221, 2418158),
"thread": 2397221,
"time" : int,
"title" : "best anime",
"url" : str,
"width" : int,
"height": int,
"size" : int,
},
{
"#url" : "https://4archive.org/board/jp/thread/17611798",
"#category": ("", "4archive", "thread"),
"#class" : _4archive._4archiveThreadExtractor,
"#pattern" : r"https://i\.imgur\.com/\w{7}\.\w+$",
"#count" : 85,
},
{
"#url" : "https://4archive.org/board/u",
"#category": ("", "4archive", "board"),
"#class" : _4archive._4archiveBoardExtractor,
"#pattern" : _4archive._4archiveThreadExtractor.pattern,
"#range" : "1-20",
"#count" : 20,
},
{
"#url" : "https://4archive.org/board/jp/10",
"#category": ("", "4archive", "board"),
"#class" : _4archive._4archiveBoardExtractor,
"#pattern" : _4archive._4archiveThreadExtractor.pattern,
"#range" : "1-50",
"#count" : 50,
}
)