mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 12:12:34 +01:00
parent
2133f1d77f
commit
bc868e7bb8
@ -67,7 +67,7 @@ def nameext_from_url(url, data=None):
|
||||
|
||||
filename = unquote(filename_from_url(url))
|
||||
name, _, ext = filename.rpartition(".")
|
||||
if name:
|
||||
if name and len(ext) <= 16:
|
||||
data["filename"], data["extension"] = name, ext.lower()
|
||||
else:
|
||||
data["filename"], data["extension"] = filename, ""
|
||||
|
@ -148,6 +148,10 @@ class TestText(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
f("http://example.org/v2/filename.ext?param=value#frag"), result)
|
||||
|
||||
# long "extension"
|
||||
fn = "httpswww.example.orgpath-path-path-path-path-path-path-path"
|
||||
self.assertEqual(f(fn), {"filename": fn, "extension": ""})
|
||||
|
||||
# invalid arguments
|
||||
for value in INVALID:
|
||||
self.assertEqual(f(value), empty)
|
||||
|
Loading…
Reference in New Issue
Block a user