diff --git a/gallery_dl/extractor/directlink.py b/gallery_dl/extractor/directlink.py index 8b90250f..e85eb8db 100644 --- a/gallery_dl/extractor/directlink.py +++ b/gallery_dl/extractor/directlink.py @@ -44,6 +44,11 @@ class DirectlinkExtractor(Extractor): ("https://post-phinf.pstatic.net/MjAxOTA1MjlfMTQ4/MDAxNTU5MTI2NjcyNTkw" ".JUzkGb4V6dj9DXjLclrOoqR64uDxHFUO5KDriRdKpGwg.88mCtd4iT1NHlpVKSCaUpP" "mZPiDgT8hmQdQ5K_gYyu0g.JPEG/2.JPG"), + # internationalized domain name + ("https://räksmörgås.josefsson.org/raksmorgas.jpg", { + "url": "a65667f670b194afbd1e3ea5e7a78938d36747da", + "keyword": "fd5037fe86eebd4764e176cbaf318caec0f700be", + }), ) def __init__(self, match): diff --git a/gallery_dl/extractor/generic.py b/gallery_dl/extractor/generic.py index 9292da3d..99992837 100644 --- a/gallery_dl/extractor/generic.py +++ b/gallery_dl/extractor/generic.py @@ -32,6 +32,28 @@ class GenericExtractor(Extractor): (?:\#(?P.*))? # optional fragment """ + test = ( + ("generic:https://www.nongnu.org/lzip/", { + "count": 1, + "content": "40be5c77773d3e91db6e1c5df720ee30afb62368", + "keyword": { + "description": "Lossless data compressor", + "imageurl": "https://www.nongnu.org/lzip/lzip.png", + "keywords": "lzip, clzip, plzip, lzlib, LZMA, bzip2, " + "gzip, data compression, GNU, free software", + "pageurl": "https://www.nongnu.org/lzip/", + }, + }), + # internationalized domain name + ("generic:https://räksmörgås.josefsson.org/", { + "count": 2, + "pattern": "^https://räksmörgås.josefsson.org/", + }), + ("generic:https://en.wikipedia.org/Main_Page"), + ("generic:https://example.org/path/to/file?que=1?&ry=2/#fragment"), + ("generic:https://example.org/%27%3C%23/%23%3E%27.htm?key=%3C%26%3E"), + ) + def __init__(self, match): """Init.""" Extractor.__init__(self, match) @@ -56,7 +78,7 @@ class GenericExtractor(Extractor): self.root = self.scheme + match.group('domain') def items(self): - """Get page, extract metadata & images, yield them in suitable messages. + """Get page, extract metadata & images, yield them in suitable messages Adapted from common.GalleryExtractor.items()