Modify: useless output in debug mode
This commit is contained in:
@@ -131,7 +131,8 @@ class Scraping:
|
|||||||
pass
|
pass
|
||||||
# if any service return a valid return, break
|
# if any service return a valid return, break
|
||||||
if self.get_data_state(json_data):
|
if self.get_data_state(json_data):
|
||||||
print(f"[+]Find movie [{name}] metadata on website '{source}'")
|
if self.debug:
|
||||||
|
print(f"[+]Find movie [{name}] metadata on website '{source}'")
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
@@ -165,7 +166,8 @@ class Scraping:
|
|||||||
# json_data = self.func_mapping[source](number, self)
|
# json_data = self.func_mapping[source](number, self)
|
||||||
# if any service return a valid return, break
|
# if any service return a valid return, break
|
||||||
if self.get_data_state(json_data):
|
if self.get_data_state(json_data):
|
||||||
print(f"[+]Find movie [{number}] metadata on website '{source}'")
|
if self.debug:
|
||||||
|
print(f"[+]Find movie [{number}] metadata on website '{source}'")
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -4,20 +4,21 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import secrets
|
import secrets
|
||||||
import builtins
|
import builtins
|
||||||
|
import config
|
||||||
|
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
from lxml.html import fromstring
|
from lxml.html import fromstring
|
||||||
from multiprocessing.dummy import Pool as ThreadPool
|
from multiprocessing.dummy import Pool as ThreadPool
|
||||||
|
|
||||||
from .airav import Airav
|
from .airav import Airav
|
||||||
from .xcity import Xcity
|
from .xcity import Xcity
|
||||||
from .httprequest import get_html_by_form, get_html_by_scraper, request_session
|
from .httprequest import get_html_by_form, get_html_by_scraper, request_session
|
||||||
|
|
||||||
# 舍弃 Amazon 源
|
# 舍弃 Amazon 源
|
||||||
G_registered_storyline_site = {"airavwiki", "airav", "avno1", "xcity", "58avgo"}
|
G_registered_storyline_site = {"airavwiki", "airav", "avno1", "xcity", "58avgo"}
|
||||||
@@ -78,7 +79,8 @@ def getStoryline(number, title=None, sites: list=None, uncensored=None, proxies=
|
|||||||
for site, desc in zip(apply_sites, results):
|
for site, desc in zip(apply_sites, results):
|
||||||
sl = len(desc) if isinstance(desc, str) else 0
|
sl = len(desc) if isinstance(desc, str) else 0
|
||||||
s += f',[选中{site}字数:{sl}]' if site == sel_site else f',{site}字数:{sl}' if sl else f',{site}:空'
|
s += f',[选中{site}字数:{sl}]' if site == sel_site else f',{site}字数:{sl}' if sl else f',{site}:空'
|
||||||
print(s)
|
if config.getInstance().debug():
|
||||||
|
print(s)
|
||||||
return sel
|
return sel
|
||||||
|
|
||||||
|
|
||||||
@@ -100,12 +102,13 @@ def getStoryline_mp(args):
|
|||||||
storyline = getStoryline_58avgo(number, debug, proxies, verify)
|
storyline = getStoryline_58avgo(number, debug, proxies, verify)
|
||||||
if not debug:
|
if not debug:
|
||||||
return storyline
|
return storyline
|
||||||
print("[!]MP 线程[{}]运行{:.3f}秒,结束于{}返回结果: {}".format(
|
if config.getInstance().debug():
|
||||||
|
print("[!]MP 线程[{}]运行{:.3f}秒,结束于{}返回结果: {}".format(
|
||||||
site,
|
site,
|
||||||
time.time() - start_time,
|
time.time() - start_time,
|
||||||
time.strftime("%H:%M:%S"),
|
time.strftime("%H:%M:%S"),
|
||||||
storyline if isinstance(storyline, str) and len(storyline) else '[空]')
|
storyline if isinstance(storyline, str) and len(storyline) else '[空]')
|
||||||
)
|
)
|
||||||
return storyline
|
return storyline
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user