[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:
Mike Fährmann
2024-08-02 12:21:41 +02:00
parent d9ff862fbd
commit a5be680596
2 changed files with 114 additions and 1 deletions

View File

@@ -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"