From 5525aacae315dfdcb9a7f5a40bb87d5b75513e72 Mon Sep 17 00:00:00 2001 From: yoshiko2 Date: Wed, 1 Dec 2021 23:03:21 +0800 Subject: [PATCH] Add javdb sites in config --- WebCrawler/javdb.py | 6 ++++-- config.ini | 3 +++ config.py | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/WebCrawler/javdb.py b/WebCrawler/javdb.py index cf9b868..4ef0770 100755 --- a/WebCrawler/javdb.py +++ b/WebCrawler/javdb.py @@ -175,8 +175,10 @@ def getSeries(html): def main(number): # javdb更新后同一时间只能登录一个数字站,最新登录站会踢出旧的登录,因此按找到的第一个javdb*.json文件选择站点, # 如果无.json文件或者超过有效期,则随机选择一个站点。 - javdb_sites = ["javdb31", "javdb32"] - debug = config.getInstance().debug() + javdb_sites = config.getInstance().javdb_sites().split(',') + debug = config.getInstance().debug() + for i in javdb_sites: + javdb_sites[javdb_sites.index(i)] = "javdb" + i try: # if re.search(r'[a-zA-Z]+\.\d{2}\.\d{2}\.\d{2}', number).group(): # pass diff --git a/config.ini b/config.ini index 7725113..0cb6a1c 100755 --- a/config.ini +++ b/config.ini @@ -109,3 +109,6 @@ show_result=0 [cc_convert] mode=1 vars=outline,series,studio,tag,title + +[javdb] +sites=33,34 \ No newline at end of file diff --git a/config.py b/config.py index 1047961..b787e3a 100644 --- a/config.py +++ b/config.py @@ -297,6 +297,12 @@ class Config: except: return "actor,director,label,outline,series,studio,tag,title" + def javdb_sites(self) -> str: + try: + return self.conf.get("javdb", "sites") + except: + return "33,34" + @staticmethod def _exit(sec: str) -> None: print("[-] Read config error! Please check the {} section in config.ini", sec)