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
|
if not 'files' in post: return None
|
||||||
files = []
|
files = []
|
||||||
for f in post['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']
|
fullname = f['fullname']
|
||||||
else:
|
else:
|
||||||
fullname = f['name']
|
fullname = f['name']
|
||||||
|
@ -38,7 +38,7 @@ class FourChanParser(Parser):
|
|||||||
dlfname = f"{post['tim']}{post['ext']}"
|
dlfname = f"{post['tim']}{post['ext']}"
|
||||||
|
|
||||||
if "filename" in post:
|
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
|
filename = dlfname
|
||||||
else:
|
else:
|
||||||
filename = f"{post['filename']}{post['ext']}"
|
filename = f"{post['filename']}{post['ext']}"
|
||||||
|
@ -41,7 +41,7 @@ class LainchanParser(Parser):
|
|||||||
dlfname = f"{post['tim']}{post['ext']}"
|
dlfname = f"{post['tim']}{post['ext']}"
|
||||||
|
|
||||||
if "filename" in post:
|
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
|
filename = dlfname
|
||||||
else:
|
else:
|
||||||
filename = f"{post['filename']}{post['ext']}"
|
filename = f"{post['filename']}{post['ext']}"
|
||||||
|
Loading…
Reference in New Issue
Block a user