From 899796fc9df07ecb63908c39b648ce840cba5c26 Mon Sep 17 00:00:00 2001 From: vivodi <103735539+vivodi@users.noreply.github.com> Date: Fri, 20 May 2022 23:13:22 +0800 Subject: [PATCH] reformat code (#83) --- CHANGELOG.md | 5 +- ptsites/schema/nexusphp_question.json | 715 +++++++++++++++++++++++++- ptsites/sites/beyond-hd.py | 2 +- ptsites/sites/discfan.py | 3 +- ptsites/sites/dragonhd.py | 2 +- ptsites/sites/eastgame.py | 2 +- ptsites/sites/hdarea.py | 1 - ptsites/sites/hdatmos.py | 2 +- ptsites/sites/hdzone.py | 1 - ptsites/sites/htpt.py | 1 - ptsites/sites/iptorrents.py | 2 +- ptsites/sites/joyhd.py | 1 + ptsites/sites/keepfrds.py | 1 + ptsites/sites/myanonamouse.py | 2 - ptsites/sites/nanyangpt.py | 1 + ptsites/sites/oshen.py | 2 +- ptsites/sites/pterclub.py | 2 +- ptsites/sites/ptsbao.py | 1 + ptsites/sites/soulvoice.py | 3 +- ptsites/sites/speedapp.py | 3 +- ptsites/sites/springsunday.py | 1 + ptsites/sites/torrentleech.py | 1 - ptsites/utils/baidu_ocr.py | 4 - 23 files changed, 732 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc6cd707..ba3e6d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,5 @@ [Full Changelog](https://github.com/IvonWei/flexget_qbittorrent_mod/compare/bedd3510323fb440b367a95d00094b9b29e9c4e3...v0.1.1) - - -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* +\* *This Changelog was automatically generated +by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/ptsites/schema/nexusphp_question.json b/ptsites/schema/nexusphp_question.json index 4990c665..b7b52c6e 100644 --- a/ptsites/schema/nexusphp_question.json +++ b/ptsites/schema/nexusphp_question.json @@ -1 +1,714 @@ -{"https://52pt.site/": {"11": ["1"], "16": ["2", "1", "4"], "23": ["1", "2"], "24": ["1"], "22": ["1", "4", "2", "8"], "10": ["1", "8"], "8": ["4", "1", "2"], "19": ["8", "4"], "26": ["1"], "20": ["1", "8"], "2": ["1"], "5": ["8", "4", "2"], "1": ["2", "1", "8"], "14": ["1", "2", "4"], "3": ["1"], "25": ["1"], "15": ["1"], "27": ["4", "2", "1"], "12": ["1"], "13": ["1", "2", "4"], "28": ["1", "8", "2", "4"], "30": ["1"], "21": ["2", "1"], "7": ["1", "8", "4"]}, "https://chdbits.co/": {"237": ["4"], "460": ["2", "8"], "288": ["8"], "591": ["4"], "473": ["2"], "301": ["1"], "286": ["8"], "555": ["4", "1", "2", "8"], "390": ["8", "1", "4", "2"], "436": ["1"], "576": ["1"], "516": ["1"], "494": ["4"], "159": ["1"], "441": ["4"], "363": ["1"], "448": ["2"], "324": ["1"], "544": ["4"], "439": ["8"], "577": ["4"], "569": ["4"], "378": ["4", "1", "8"], "515": ["4"], "501": ["4"], "553": ["4"], "580": ["4"], "534": ["2"], "402": ["4"], "397": ["1"], "291": ["8"], "444": ["4"], "505": ["1"], "249": ["4"], "589": ["8"], "267": ["4"], "158": ["4"], "511": ["8"], "261": ["4", "2", "8"], "477": ["2"], "596": ["2"], "567": ["8"], "312": ["8"], "426": ["8", "1", "4", "2"], "298": ["8"], "581": ["2"], "322": ["8"], "565": ["4"], "564": ["1"], "139": ["2"], "492": ["4"], "126": ["8"], "514": ["4"], "562": ["4", "1"], "422": ["1", "2", "8"], "502": ["4"], "563": ["8"], "292": ["1"], "265": ["1", "4", "8"], "578": ["4"], "583": ["8"], "109": ["8"], "290": ["4"], "579": ["4"], "540": ["2"], "309": ["4"], "513": ["8"], "504": ["4"], "453": ["8"], "585": ["2"], "594": ["2"], "541": ["8"], "476": ["4"], "561": ["8"], "556": ["4"], "480": ["4"], "432": ["4"], "168": ["2"], "401": ["8"], "349": ["4"], "323": ["8"], "52": ["4"], "538": ["8"], "597": ["2"], "284": ["4"], "320": ["1"], "554": ["2"], "179": ["2"], "201": ["4"], "542": ["8"], "485": ["2"], "478": ["2"], "454": ["2", "1", "4", "8"], "419": ["1"], "549": ["1", "4"], "592": ["2"], "545": ["1"], "155": ["1"], "369": ["8"], "587": ["8"], "510": ["8"], "310": ["1"], "572": ["4", "1", "2"], "571": ["1", "8", "2", "4"], "299": ["4"], "500": ["1"], "550": ["8"], "285": ["4"], "414": ["8"], "574": ["2"], "347": ["4"], "457": ["4", "8", "2"], "493": ["2"], "570": ["8"], "552": ["4"], "404": ["1", "2", "4"], "216": ["1"], "258": ["1"], "141": ["4", "1", "8", "2"], "474": ["4", "2"], "239": ["8"], "461": ["1", "8"], "344": ["1"], "263": ["1"], "297": ["8"], "153": ["8"], "187": ["4"], "302": ["8"], "388": ["2"], "196": ["4"], "332": ["2"], "308": ["1"], "396": ["1", "2", "4"], "503": ["4"], "528": ["1"], "438": ["1", "2"], "531": ["2"], "203": ["2"], "406": ["2", "4"], "185": ["2", "8"], "507": ["8"], "598": ["2"], "69": ["2", "4", "1"], "262": ["2", "4"], "529": ["4"], "450": ["4", "8", "2"], "293": ["4"], "535": ["8"], "451": ["4"], "328": ["8"], "270": ["1", "8", "2"], "557": ["8"], "202": ["4", "1"], "466": ["2"], "330": ["2"], "509": ["4"], "498": ["8"], "375": ["8"], "467": ["4"], "568": ["8"], "365": ["1"], "176": ["1", "2", "8"], "178": ["1"], "336": ["4", "8", "1", "2"], "481": ["1"], "376": ["8"], "445": ["1"], "442": ["4"], "479": ["2"], "523": ["2"], "234": ["4"], "252": ["4"], "512": ["8"], "595": ["2"], "566": ["4"], "287": ["8"], "387": ["2"], "346": ["1"], "593": ["1"], "484": ["4"], "548": ["1"], "305": ["2"], "575": ["4"], "276": ["2", "1", "4"]}} \ No newline at end of file +{ + "https://52pt.site/": { + "11": [ + "1" + ], + "16": [ + "2", + "1", + "4" + ], + "23": [ + "1", + "2" + ], + "24": [ + "1" + ], + "22": [ + "1", + "4", + "2", + "8" + ], + "10": [ + "1", + "8" + ], + "8": [ + "4", + "1", + "2" + ], + "19": [ + "8", + "4" + ], + "26": [ + "1" + ], + "20": [ + "1", + "8" + ], + "2": [ + "1" + ], + "5": [ + "8", + "4", + "2" + ], + "1": [ + "2", + "1", + "8" + ], + "14": [ + "1", + "2", + "4" + ], + "3": [ + "1" + ], + "25": [ + "1" + ], + "15": [ + "1" + ], + "27": [ + "4", + "2", + "1" + ], + "12": [ + "1" + ], + "13": [ + "1", + "2", + "4" + ], + "28": [ + "1", + "8", + "2", + "4" + ], + "30": [ + "1" + ], + "21": [ + "2", + "1" + ], + "7": [ + "1", + "8", + "4" + ] + }, + "https://chdbits.co/": { + "237": [ + "4" + ], + "460": [ + "2", + "8" + ], + "288": [ + "8" + ], + "591": [ + "4" + ], + "473": [ + "2" + ], + "301": [ + "1" + ], + "286": [ + "8" + ], + "555": [ + "4", + "1", + "2", + "8" + ], + "390": [ + "8", + "1", + "4", + "2" + ], + "436": [ + "1" + ], + "576": [ + "1" + ], + "516": [ + "1" + ], + "494": [ + "4" + ], + "159": [ + "1" + ], + "441": [ + "4" + ], + "363": [ + "1" + ], + "448": [ + "2" + ], + "324": [ + "1" + ], + "544": [ + "4" + ], + "439": [ + "8" + ], + "577": [ + "4" + ], + "569": [ + "4" + ], + "378": [ + "4", + "1", + "8" + ], + "515": [ + "4" + ], + "501": [ + "4" + ], + "553": [ + "4" + ], + "580": [ + "4" + ], + "534": [ + "2" + ], + "402": [ + "4" + ], + "397": [ + "1" + ], + "291": [ + "8" + ], + "444": [ + "4" + ], + "505": [ + "1" + ], + "249": [ + "4" + ], + "589": [ + "8" + ], + "267": [ + "4" + ], + "158": [ + "4" + ], + "511": [ + "8" + ], + "261": [ + "4", + "2", + "8" + ], + "477": [ + "2" + ], + "596": [ + "2" + ], + "567": [ + "8" + ], + "312": [ + "8" + ], + "426": [ + "8", + "1", + "4", + "2" + ], + "298": [ + "8" + ], + "581": [ + "2" + ], + "322": [ + "8" + ], + "565": [ + "4" + ], + "564": [ + "1" + ], + "139": [ + "2" + ], + "492": [ + "4" + ], + "126": [ + "8" + ], + "514": [ + "4" + ], + "562": [ + "4", + "1" + ], + "422": [ + "1", + "2", + "8" + ], + "502": [ + "4" + ], + "563": [ + "8" + ], + "292": [ + "1" + ], + "265": [ + "1", + "4", + "8" + ], + "578": [ + "4" + ], + "583": [ + "8" + ], + "109": [ + "8" + ], + "290": [ + "4" + ], + "579": [ + "4" + ], + "540": [ + "2" + ], + "309": [ + "4" + ], + "513": [ + "8" + ], + "504": [ + "4" + ], + "453": [ + "8" + ], + "585": [ + "2" + ], + "594": [ + "2" + ], + "541": [ + "8" + ], + "476": [ + "4" + ], + "561": [ + "8" + ], + "556": [ + "4" + ], + "480": [ + "4" + ], + "432": [ + "4" + ], + "168": [ + "2" + ], + "401": [ + "8" + ], + "349": [ + "4" + ], + "323": [ + "8" + ], + "52": [ + "4" + ], + "538": [ + "8" + ], + "597": [ + "2" + ], + "284": [ + "4" + ], + "320": [ + "1" + ], + "554": [ + "2" + ], + "179": [ + "2" + ], + "201": [ + "4" + ], + "542": [ + "8" + ], + "485": [ + "2" + ], + "478": [ + "2" + ], + "454": [ + "2", + "1", + "4", + "8" + ], + "419": [ + "1" + ], + "549": [ + "1", + "4" + ], + "592": [ + "2" + ], + "545": [ + "1" + ], + "155": [ + "1" + ], + "369": [ + "8" + ], + "587": [ + "8" + ], + "510": [ + "8" + ], + "310": [ + "1" + ], + "572": [ + "4", + "1", + "2" + ], + "571": [ + "1", + "8", + "2", + "4" + ], + "299": [ + "4" + ], + "500": [ + "1" + ], + "550": [ + "8" + ], + "285": [ + "4" + ], + "414": [ + "8" + ], + "574": [ + "2" + ], + "347": [ + "4" + ], + "457": [ + "4", + "8", + "2" + ], + "493": [ + "2" + ], + "570": [ + "8" + ], + "552": [ + "4" + ], + "404": [ + "1", + "2", + "4" + ], + "216": [ + "1" + ], + "258": [ + "1" + ], + "141": [ + "4", + "1", + "8", + "2" + ], + "474": [ + "4", + "2" + ], + "239": [ + "8" + ], + "461": [ + "1", + "8" + ], + "344": [ + "1" + ], + "263": [ + "1" + ], + "297": [ + "8" + ], + "153": [ + "8" + ], + "187": [ + "4" + ], + "302": [ + "8" + ], + "388": [ + "2" + ], + "196": [ + "4" + ], + "332": [ + "2" + ], + "308": [ + "1" + ], + "396": [ + "1", + "2", + "4" + ], + "503": [ + "4" + ], + "528": [ + "1" + ], + "438": [ + "1", + "2" + ], + "531": [ + "2" + ], + "203": [ + "2" + ], + "406": [ + "2", + "4" + ], + "185": [ + "2", + "8" + ], + "507": [ + "8" + ], + "598": [ + "2" + ], + "69": [ + "2", + "4", + "1" + ], + "262": [ + "2", + "4" + ], + "529": [ + "4" + ], + "450": [ + "4", + "8", + "2" + ], + "293": [ + "4" + ], + "535": [ + "8" + ], + "451": [ + "4" + ], + "328": [ + "8" + ], + "270": [ + "1", + "8", + "2" + ], + "557": [ + "8" + ], + "202": [ + "4", + "1" + ], + "466": [ + "2" + ], + "330": [ + "2" + ], + "509": [ + "4" + ], + "498": [ + "8" + ], + "375": [ + "8" + ], + "467": [ + "4" + ], + "568": [ + "8" + ], + "365": [ + "1" + ], + "176": [ + "1", + "2", + "8" + ], + "178": [ + "1" + ], + "336": [ + "4", + "8", + "1", + "2" + ], + "481": [ + "1" + ], + "376": [ + "8" + ], + "445": [ + "1" + ], + "442": [ + "4" + ], + "479": [ + "2" + ], + "523": [ + "2" + ], + "234": [ + "4" + ], + "252": [ + "4" + ], + "512": [ + "8" + ], + "595": [ + "2" + ], + "566": [ + "4" + ], + "287": [ + "8" + ], + "387": [ + "2" + ], + "346": [ + "1" + ], + "593": [ + "1" + ], + "484": [ + "4" + ], + "548": [ + "1" + ], + "305": [ + "2" + ], + "575": [ + "4" + ], + "276": [ + "2", + "1", + "4" + ] + } +} \ No newline at end of file diff --git a/ptsites/sites/beyond-hd.py b/ptsites/sites/beyond-hd.py index dbb415b3..1f23bdd0 100644 --- a/ptsites/sites/beyond-hd.py +++ b/ptsites/sites/beyond-hd.py @@ -1,6 +1,6 @@ -from ..utils.value_hanlder import handle_join_date from ..schema.site_base import SignState, Work from ..schema.unit3d import Unit3D +from ..utils.value_hanlder import handle_join_date # site_config diff --git a/ptsites/sites/discfan.py b/ptsites/sites/discfan.py index 010e896f..b65bac43 100644 --- a/ptsites/sites/discfan.py +++ b/ptsites/sites/discfan.py @@ -1,11 +1,10 @@ from ..schema.nexusphp import AttendanceHR - class MainClass(AttendanceHR): URL = 'https://discfan.net/' USER_CLASSES = { 'downloaded': [805306368000, 3298534883328], 'share_ratio': [3.05, 4.55], 'days': [280, 700] - } \ No newline at end of file + } diff --git a/ptsites/sites/dragonhd.py b/ptsites/sites/dragonhd.py index 1d00a03c..24db0615 100644 --- a/ptsites/sites/dragonhd.py +++ b/ptsites/sites/dragonhd.py @@ -7,4 +7,4 @@ class MainClass(Visit): 'downloaded': [805306368000, 3298534883328], 'share_ratio': [3.05, 4.55], 'days': [280, 700] - } \ No newline at end of file + } diff --git a/ptsites/sites/eastgame.py b/ptsites/sites/eastgame.py index 8e36ce94..8e6af8d9 100644 --- a/ptsites/sites/eastgame.py +++ b/ptsites/sites/eastgame.py @@ -7,4 +7,4 @@ class MainClass(Visit): 'downloaded': [805306368000, 3298534883328], 'share_ratio': [5.05, 8.55], 'days': [280, 385] - } \ No newline at end of file + } diff --git a/ptsites/sites/hdarea.py b/ptsites/sites/hdarea.py index 697aa6ef..3eb64b8d 100644 --- a/ptsites/sites/hdarea.py +++ b/ptsites/sites/hdarea.py @@ -50,4 +50,3 @@ def build_selector(self): } }) return selector - diff --git a/ptsites/sites/hdatmos.py b/ptsites/sites/hdatmos.py index 0e1ed482..5cf9844c 100644 --- a/ptsites/sites/hdatmos.py +++ b/ptsites/sites/hdatmos.py @@ -7,4 +7,4 @@ class MainClass(Attendance): 'downloaded': [805306368000, 3298534883328], 'share_ratio': [3.05, 4.55], 'days': [280, 700] - } \ No newline at end of file + } diff --git a/ptsites/sites/hdzone.py b/ptsites/sites/hdzone.py index b391cdbc..bfe96509 100644 --- a/ptsites/sites/hdzone.py +++ b/ptsites/sites/hdzone.py @@ -1,7 +1,6 @@ from ..schema.nexusphp import AttendanceHR - class MainClass(AttendanceHR): URL = 'http://hdzone.me/' USER_CLASSES = { diff --git a/ptsites/sites/htpt.py b/ptsites/sites/htpt.py index 063fef6e..af3cd483 100644 --- a/ptsites/sites/htpt.py +++ b/ptsites/sites/htpt.py @@ -1,7 +1,6 @@ from ..schema.nexusphp import AttendanceHR - class MainClass(AttendanceHR): URL = 'https://www.htpt.cc/' USER_CLASSES = { diff --git a/ptsites/sites/iptorrents.py b/ptsites/sites/iptorrents.py index 57c9b071..904dbb7e 100644 --- a/ptsites/sites/iptorrents.py +++ b/ptsites/sites/iptorrents.py @@ -1,5 +1,5 @@ from ..schema.site_base import SiteBase, Work, SignState -from ..utils.value_hanlder import handle_join_date,handle_infinite +from ..utils.value_hanlder import handle_join_date, handle_infinite class MainClass(SiteBase): diff --git a/ptsites/sites/joyhd.py b/ptsites/sites/joyhd.py index 58e66109..a2fbb802 100644 --- a/ptsites/sites/joyhd.py +++ b/ptsites/sites/joyhd.py @@ -1,6 +1,7 @@ from ..schema.nexusphp import Visit from ..utils import net_utils + class MainClass(Visit): URL = 'https://www.joyhd.net/' USER_CLASSES = { diff --git a/ptsites/sites/keepfrds.py b/ptsites/sites/keepfrds.py index d3ecd758..c1c9ae56 100644 --- a/ptsites/sites/keepfrds.py +++ b/ptsites/sites/keepfrds.py @@ -1,6 +1,7 @@ from ..schema.nexusphp import Visit from ..utils import net_utils + class MainClass(Visit): URL = 'https://pt.keepfrds.com/' USER_CLASSES = { diff --git a/ptsites/sites/myanonamouse.py b/ptsites/sites/myanonamouse.py index 953a6571..5df55c18 100644 --- a/ptsites/sites/myanonamouse.py +++ b/ptsites/sites/myanonamouse.py @@ -105,5 +105,3 @@ def build_selector(self): def get_myanonamouse_message(self, entry, config, messages_url='/messages.php?action=viewmailbox'): entry['result'] += '(TODO: Message)' - - diff --git a/ptsites/sites/nanyangpt.py b/ptsites/sites/nanyangpt.py index f1de6368..35ebfdf3 100644 --- a/ptsites/sites/nanyangpt.py +++ b/ptsites/sites/nanyangpt.py @@ -1,6 +1,7 @@ from ..schema.nexusphp import Visit from ..utils import net_utils + class MainClass(Visit): URL = 'https://nanyangpt.com/' SUCCEED_REGEX = '魔力豆 \\(.*?\\)' diff --git a/ptsites/sites/oshen.py b/ptsites/sites/oshen.py index 4792daa7..653ad1ba 100644 --- a/ptsites/sites/oshen.py +++ b/ptsites/sites/oshen.py @@ -7,4 +7,4 @@ class MainClass(Visit): 'downloaded': [805306368000, 3298534883328], 'share_ratio': [3.05, 4.55], 'days': [280, 700] - } \ No newline at end of file + } diff --git a/ptsites/sites/pterclub.py b/ptsites/sites/pterclub.py index c41deb5e..61101b7b 100644 --- a/ptsites/sites/pterclub.py +++ b/ptsites/sites/pterclub.py @@ -1,6 +1,6 @@ from ..schema.nexusphp import NexusPHP -from ..utils import net_utils from ..schema.site_base import Work, SignState +from ..utils import net_utils class MainClass(NexusPHP): diff --git a/ptsites/sites/ptsbao.py b/ptsites/sites/ptsbao.py index b8ba9741..a221bb6d 100644 --- a/ptsites/sites/ptsbao.py +++ b/ptsites/sites/ptsbao.py @@ -1,6 +1,7 @@ from ..schema.nexusphp import VisitHR from ..utils import net_utils + class MainClass(VisitHR): URL = 'https://ptsbao.club/' USER_CLASSES = { diff --git a/ptsites/sites/soulvoice.py b/ptsites/sites/soulvoice.py index ac205e6f..24cc0268 100644 --- a/ptsites/sites/soulvoice.py +++ b/ptsites/sites/soulvoice.py @@ -1,11 +1,10 @@ from ..schema.nexusphp import AttendanceHR - class MainClass(AttendanceHR): URL = 'https://pt.soulvoice.club/' USER_CLASSES = { 'downloaded': [805306368000, 3298534883328], 'share_ratio': [3.05, 4.55], 'days': [280, 700] - } \ No newline at end of file + } diff --git a/ptsites/sites/speedapp.py b/ptsites/sites/speedapp.py index d008feaa..6ee5586a 100644 --- a/ptsites/sites/speedapp.py +++ b/ptsites/sites/speedapp.py @@ -126,5 +126,6 @@ def build_selector(self): } } } - def handle_join_date(self,value): + + def handle_join_date(self, value): return value.translate(str.maketrans('年月', '--', '日')) diff --git a/ptsites/sites/springsunday.py b/ptsites/sites/springsunday.py index 4cd61e43..31314e2e 100644 --- a/ptsites/sites/springsunday.py +++ b/ptsites/sites/springsunday.py @@ -1,6 +1,7 @@ from ..schema.nexusphp import Visit from ..utils import net_utils + class MainClass(Visit): URL = 'https://springsunday.net/' USER_CLASSES = { diff --git a/ptsites/sites/torrentleech.py b/ptsites/sites/torrentleech.py index 4086edec..9900709a 100644 --- a/ptsites/sites/torrentleech.py +++ b/ptsites/sites/torrentleech.py @@ -61,4 +61,3 @@ def build_selector(self): 'hr': None } } - diff --git a/ptsites/utils/baidu_ocr.py b/ptsites/utils/baidu_ocr.py index fecd2868..0ed2abf9 100644 --- a/ptsites/utils/baidu_ocr.py +++ b/ptsites/utils/baidu_ocr.py @@ -18,7 +18,6 @@ lock = threading.Semaphore(qps) - def get_client(entry, config): if 'aipocr' not in config: entry.fail_with_prefix('aipocr not set in config') @@ -37,7 +36,6 @@ def get_client(entry, config): return AipOcr(app_id, api_key, secret_key) - def get_jap_ocr(img, entry, config): client = get_client(entry, config) if not client: @@ -64,7 +62,6 @@ def get_jap_ocr(img, entry, config): return re.sub('[^\\w]|[a-zA-Z\\d]', '', text) - def get_ocr_code(img, entry, config): client = get_client(entry, config) if not client: @@ -99,7 +96,6 @@ def get_ocr_code(img, entry, config): return code, img_byte_arr.getvalue() - def _detect_noise(img, i, j, width, height): if i < 25 or i > 122 or j < 15 or j > 24: return True