From 647a78797486d414e3cbcdb76920eeb7b5b1f3b9 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 18 Nov 2020 23:44:36 +0400 Subject: [PATCH] FIxed arguments for a match function. --- scrapthechan/parsers/eightkun.py | 4 ++-- scrapthechan/parsers/fourchan.py | 2 +- scrapthechan/parsers/lainchan.py | 4 ++-- scrapthechan/parsers/lolifox.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scrapthechan/parsers/eightkun.py b/scrapthechan/parsers/eightkun.py index afc506b..5348c6e 100644 --- a/scrapthechan/parsers/eightkun.py +++ b/scrapthechan/parsers/eightkun.py @@ -38,7 +38,7 @@ class EightKunParser(Parser): dlfname = f"{post['tim']}{post['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w{1,4}$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}" @@ -52,7 +52,7 @@ class EightKunParser(Parser): for f in post["extra_files"]: dlfname = f"{f['tim']}{f['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w+$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}" diff --git a/scrapthechan/parsers/fourchan.py b/scrapthechan/parsers/fourchan.py index 15c3fdb..fb60515 100644 --- a/scrapthechan/parsers/fourchan.py +++ b/scrapthechan/parsers/fourchan.py @@ -38,7 +38,7 @@ class FourChanParser(Parser): dlfname = f"{post['tim']}{post['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w{1,4}$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}" diff --git a/scrapthechan/parsers/lainchan.py b/scrapthechan/parsers/lainchan.py index 243bd46..5a45292 100644 --- a/scrapthechan/parsers/lainchan.py +++ b/scrapthechan/parsers/lainchan.py @@ -41,7 +41,7 @@ class LainchanParser(Parser): dlfname = f"{post['tim']}{post['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w{1,4}$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}" @@ -55,7 +55,7 @@ class LainchanParser(Parser): for f in post["extra_files"]: dlfname = f"{f['tim']}{f['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w+$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}" diff --git a/scrapthechan/parsers/lolifox.py b/scrapthechan/parsers/lolifox.py index b0d6f24..e1257ea 100644 --- a/scrapthechan/parsers/lolifox.py +++ b/scrapthechan/parsers/lolifox.py @@ -24,7 +24,7 @@ class LolifoxParser(Parser): @property def imageboard(self) -> str: return "lolifox.cc" - + @property def op(self) -> Optional[str]: op = "" @@ -40,7 +40,7 @@ class LolifoxParser(Parser): dlfname = f"{post['tim']}{post['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w{1,4}$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}" @@ -54,7 +54,7 @@ class LolifoxParser(Parser): for f in post["extra_files"]: dlfname = f"{f['tim']}{f['ext']}" if "filename" in post: - if match(post['filename'], r"^image\.\w+$") is None: + if match(r"^image\.\w+$", post['filename']) is None: filename = dlfname else: filename = f"{post['filename']}{post['ext']}"