add more extractor tests

for mangastream, reddit and imgur
pull/79/head
Mike Fährmann 7 years ago
parent b73b8b4f50
commit 20af86b2ea
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -89,6 +89,9 @@ class ImgurImageExtractor(ImgurExtractor):
"url": "a2220eb265a55b0c95e0d3d721ec7665460e3fd7",
"content": "a3c080e43f58f55243ab830569ba02309d59abfc",
}),
("https://imgur.com/HjoXJAd", { # url ends with '.jpg?1'
"url": "73f361b50753ab25da64160aa50bc5d139480d45",
}),
("https://imgur.com/zzzzzzz", {
"exception": exception.NotFoundError,
}),

@ -18,6 +18,7 @@ class MangastreamChapterExtractor(ChapterExtractor):
category = "mangastream"
pattern = [(r"(?:https?://)?(?:www\.)?(?:readms|mangastream)\.(?:com|net)/"
r"r(?:ead)?/([^/]*/([^/]+)/(\d+))")]
test = [("https://readms.net/r/onepunch_man/087/4874/1", None)]
base_url = "https://readms.net/r/"
def __init__(self, match):

@ -75,6 +75,10 @@ class RedditSubredditExtractor(RedditExtractor):
pattern = [r"(?:https?://)?(?:m\.|www\.)?reddit\.com/r/([^/?&#]+)"
r"(/[a-z]+)?/?"
r"(?:\?.*?(?:\bt=([a-z]+))?)?$"]
test = [
("https://www.reddit.com/r/lavaporn/", None),
("https://www.reddit.com/r/lavaporn/top/?sort=top&t=month", None),
]
def __init__(self, match):
RedditExtractor.__init__(self)
@ -93,6 +97,14 @@ class RedditSubmissionExtractor(RedditExtractor):
r"(?:m\.|www\.)?reddit\.com/r/[^/]+/comments|"
r"redd\.it"
r")/([a-z0-9]+)")]
test = [
("https://www.reddit.com/r/lavaporn/comments/2a00np/", {
"pattern": r"https?://i\.imgur\.com/AaAUCgy\.jpg",
"count": 1,
}),
("https://m.reddit.com/r/lavaporn/comments/2a00np/", None),
("https://redd.it/2a00np/", None),
]
def __init__(self, match):
RedditExtractor.__init__(self)

Loading…
Cancel
Save