rewrite URL patterns to use only 1 per extractor

This commit is contained in:
Mike Fährmann
2019-02-08 12:03:10 +01:00
parent 0e46db6f45
commit 34bab080ae
10 changed files with 38 additions and 61 deletions

View File

@@ -53,9 +53,8 @@ class ImgurImageExtractor(ImgurExtractor):
subcategory = "image"
filename_fmt = "{category}_{hash}{title:?_//}.{extension}"
archive_fmt = "{hash}"
pattern = [(r"(?:https?://)?(?:www\.|m\.)?imgur\.com"
r"/(?!gallery)(\w{7}|\w{5})"),
(r"(?:https?://)?i\.imgur\.com/(\w{7}|\w{5})[sbtmlh]?\.")]
pattern = [r"(?:https?://)?(?:www\.|[im]\.|)?imgur\.com"
r"/(?!gallery)(\w{7}|\w{5})[sbtmlh]?\.?"]
test = [
("https://imgur.com/21yMxCS", {
"url": "6f2dcfb86815bdd72808c313e5f715610bc7b9b2",