Regex limited to up to 4 characters after first dot occured.
This commit is contained in:
parent
6df9e573aa
commit
93d2904a4f
@ -36,7 +36,7 @@ class DvachParser(Parser):
|
||||
if not 'files' in post: return None
|
||||
files = []
|
||||
for f in post['files']:
|
||||
if match(f['fullname'], r"^image\.\w+$") is None:
|
||||
if match(f['fullname'], r"^image\.\w{1,4}$") is None:
|
||||
fullname = f['fullname']
|
||||
else:
|
||||
fullname = f['name']
|
||||
|
@ -38,7 +38,7 @@ class FourChanParser(Parser):
|
||||
dlfname = f"{post['tim']}{post['ext']}"
|
||||
|
||||
if "filename" in post:
|
||||
if match(post['filename'], r"^image\.\w+$") is None:
|
||||
if match(post['filename'], r"^image\.\w{1,4}$") is None:
|
||||
filename = dlfname
|
||||
else:
|
||||
filename = f"{post['filename']}{post['ext']}"
|
||||
|
@ -41,7 +41,7 @@ class LainchanParser(Parser):
|
||||
dlfname = f"{post['tim']}{post['ext']}"
|
||||
|
||||
if "filename" in post:
|
||||
if match(post['filename'], r"^image\.\w+$") is None:
|
||||
if match(post['filename'], r"^image\.\w{1,4}$") is None:
|
||||
filename = dlfname
|
||||
else:
|
||||
filename = f"{post['filename']}{post['ext']}"
|
||||
|
Loading…
Reference in New Issue
Block a user