mirror of
https://github.com/mikf/gallery-dl.git
synced 2025-01-31 19:51:34 +01:00
[directlink] extend recognized file extensions (#5924)
bmp, svg, avif, heic, psd, pdf, m4v, mov, wav, mp3, zip, rar, 7z, swf
This commit is contained in:
parent
d9ff862fbd
commit
a5be680596
@ -18,7 +18,8 @@ class DirectlinkExtractor(Extractor):
|
||||
filename_fmt = "{domain}/{path}/{filename}.{extension}"
|
||||
archive_fmt = filename_fmt
|
||||
pattern = (r"(?i)https?://(?P<domain>[^/?#]+)/(?P<path>[^?#]+\."
|
||||
r"(?:jpe?g|jpe|png|gif|web[mp]|mp4|mkv|og[gmv]|opus))"
|
||||
r"(?:jpe?g|jpe|png|gif|bmp|svg|web[mp]|avif|heic|psd"
|
||||
r"|mp4|m4v|mov|mkv|og[gmv]|wav|mp3|opus|zip|rar|7z|pdf|swf))"
|
||||
r"(?:\?(?P<query>[^#]*))?(?:#(?P<fragment>.*))?$")
|
||||
example = "https://en.wikipedia.org/static/images/project-logos/enwiki.png"
|
||||
|
||||
|
@ -14,6 +14,7 @@ __tests__ = (
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
"#sha1_url" : "18c5d00077332e98e53be9fed2ee4be66154b88d",
|
||||
"#sha1_metadata": "105770a3f4393618ab7b811b731b22663b5d3794",
|
||||
"#sha1_content" : "e6f58aaec8f31eb222f9e10fa9e9f64b79ae888c",
|
||||
},
|
||||
|
||||
{
|
||||
@ -59,4 +60,115 @@ __tests__ = (
|
||||
"#sha1_metadata": "fd5037fe86eebd4764e176cbaf318caec0f700be",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://example.org/file.gif",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.bmp",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.svg",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.webp",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.avif",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.heic",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.psd",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.mp4",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.m4v",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.mov",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.mkv",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.ogg",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.ogm",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.ogv",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.wav",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.mp3",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.opus",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.zip",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.rar",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.7z",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.pdf",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
{
|
||||
"#url" : "https://example.org/file.swf",
|
||||
"#category": ("", "directlink", ""),
|
||||
"#class" : directlink.DirectlinkExtractor,
|
||||
},
|
||||
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user