add missing tests
This commit is contained in:
@@ -15,6 +15,11 @@ class FourchanThreadExtractor(ChanExtractor):
|
||||
category = "4chan"
|
||||
subcategory = "thread"
|
||||
pattern = [r"(?:https?://)?boards\.4chan\.org/([^/]+)/thread/(\d+)"]
|
||||
test = [("https://boards.4chan.org/tg/thread/15396072/", {
|
||||
"url": "39082ad166161966d7ba8e37f2173a824eb540f0",
|
||||
"keyword": "9b610fd3674653728516c34ec65925a024cc0074",
|
||||
"content": "3081ed85a5afaeb3f430f42540e7bb5eec1908cc",
|
||||
})]
|
||||
api_url = "https://a.4cdn.org/{board}/thread/{thread}.json"
|
||||
file_url = "https://i.4cdn.org/{board}/{tim}{ext}"
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@ class InfinitychanThreadExtractor(ChanExtractor):
|
||||
category = "8chan"
|
||||
subcategory = "thread"
|
||||
pattern = [r"(?:https?://)?(?:www\.)?8ch\.net/([^/]+)/res/(\d+)"]
|
||||
test = [("https://8ch.net/tg/res/175887.html", {
|
||||
"url": "cb03fdc650ad8e796fdab553fbd5489f468d3f45",
|
||||
"keyword": "d9388d231db6a0ea3e710a6cf46dc53dbdbb2115",
|
||||
"content": "9f51cdfee6942a18011996ca049baeb0a22f931b",
|
||||
})]
|
||||
api_url = "https://8ch.net/{board}/res/{thread}.json"
|
||||
file_url = "https://8ch.net/{board}/src/{tim}{ext}"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class BatotoChapterExtractor(AsynchronousExtractor):
|
||||
pattern = [r"(?:https?://)?(?:www\.)?bato\.to/reader#([0-9a-f]+)"]
|
||||
test = [("http://bato.to/reader#459878c8fda07502", {
|
||||
"url": "432d7958506ad913b0a9e42664a89e46a63e9296",
|
||||
"keyword": "00727dd9e353581ec762b0b628dfcec1db5cba68",
|
||||
"keyword": "e34a9184a51266e4f1ab3c2a652a4359bb7e3d30",
|
||||
})]
|
||||
url = "https://bato.to/areader"
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@ class ExhentaiGalleryExtractor(Extractor):
|
||||
directory_fmt = ["{category}", "{gallery-id}"]
|
||||
filename_fmt = "{gallery-id}_{num:>04}_{imgkey}_{name}.{extension}"
|
||||
pattern = [r"(?:https?://)?(g\.e-|ex)hentai\.org/g/(\d+)/([\da-f]{10})"]
|
||||
test = [("https://exhentai.org/g/960460/4f0e369d82/", {
|
||||
"keyword": "aaac45cad1897a9815384bc3a743ce7502c692f6",
|
||||
"content": "493d759de534355c9f55f8e365565b62411de146",
|
||||
})]
|
||||
api_url = "https://exhentai.org/api.php"
|
||||
|
||||
def __init__(self, match):
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
"""Extract soundtracks from https://khinsider.com/"""
|
||||
"""Extract soundtracks from http://khinsider.com/"""
|
||||
|
||||
from .common import AsynchronousExtractor, Message
|
||||
from .. import text
|
||||
from .. import text, exception
|
||||
|
||||
class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
|
||||
"""Extractor for soundtracks from khinsider.com"""
|
||||
@@ -18,6 +18,10 @@ class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
|
||||
directory_fmt = ["{category}", "{album}"]
|
||||
filename_fmt = "{filename}"
|
||||
pattern = [r"(?:https?://)?downloads\.khinsider\.com/game-soundtracks/album/(.+)"]
|
||||
test = [("http://downloads.khinsider.com/game-soundtracks/album/horizon-riders-wii-", {
|
||||
"url": "35ff4c8310884664408dc5560fda3b06157f7606",
|
||||
"keyword": "dde50e1f5dbed5ee3f13df4e1bffc58bb9563f22",
|
||||
})]
|
||||
|
||||
def __init__(self, match):
|
||||
AsynchronousExtractor.__init__(self)
|
||||
@@ -34,6 +38,7 @@ class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
|
||||
yield Message.Url, url, track
|
||||
|
||||
def get_job_metadata(self, page):
|
||||
"""Collect metadata for extractor-job"""
|
||||
return text.extract_all(page, (
|
||||
("album", "Album name: <b>", "</b>"),
|
||||
("count", "Number of Files: <b>", "</b>"),
|
||||
@@ -43,7 +48,10 @@ class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
|
||||
), values={"category": self.category})[0]
|
||||
|
||||
def get_album_tracks(self, page):
|
||||
pos = page.index("Download all songs at once:")
|
||||
"""Collect url and metadata for all tracks of a soundtrack"""
|
||||
pos = page.find("Download all songs at once:")
|
||||
if pos == -1:
|
||||
raise exception.NotFoundError("soundtrack")
|
||||
num = 0
|
||||
for url in text.extract_iter(page, '<tr>\r\n\t\t<td><a href="', '"', pos):
|
||||
page = self.request(url, encoding="utf-8").text
|
||||
|
||||
@@ -50,8 +50,8 @@ class MangaparkChapterExtractor(Extractor):
|
||||
r"([^/]+/s(\d+)(?:/v(\d+))?/c(\d+)(?:(\.\d+)|/e(\d+))?)")]
|
||||
test = [
|
||||
("http://mangapark.me/manga/ad-astra-per-aspera-hata-kenjirou/s1/c1.2/1", {
|
||||
"url": "f325ce264df390c5ba9607c52a7e7b0829672404",
|
||||
"keyword": "480a114319e42c561079ffe138afd67e22a74cd3",
|
||||
"url": "25d998a70df1fa559afc189ebd17df300b54dc28",
|
||||
"keyword": "40d60961d7aaf24454d2ab23fbc83f4c55cd4174",
|
||||
}),
|
||||
("http://mangapark.me/manga/gekkan-shoujo-nozaki-kun/s2/c70/e2/1", {
|
||||
"url": "8534c8286a18c4db47606f84a4df9f1a42bab291",
|
||||
|
||||
@@ -18,6 +18,10 @@ class SankakuTagExtractor(AsynchronousExtractor):
|
||||
directory_fmt = ["{category}", "{tags}"]
|
||||
filename_fmt = "{category}_{id}_{md5}.{extension}"
|
||||
pattern = [r"(?:https?://)?chan\.sankakucomplex\.com/\?tags=([^&]+)"]
|
||||
test = [("https://chan.sankakucomplex.com/?tags=bonocho", {
|
||||
"url": "2561ca0d8482ead48f22a7abcd23919cd78344a1",
|
||||
"keyword": "6282e9a2d5223d635d9be7515f59d87d4b9be732",
|
||||
})]
|
||||
url = "https://chan.sankakucomplex.com/"
|
||||
|
||||
def __init__(self, match):
|
||||
|
||||
Reference in New Issue
Block a user