Fix source output 'list out of range'

This commit is contained in:
yoshiko2
2021-05-29 00:50:47 +08:00
parent 2a7c2b5095
commit a3eb94ddcb
9 changed files with 25 additions and 9 deletions

View File

@@ -212,7 +212,9 @@ def main(number):
} }
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4,separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4,separators=(',', ':'), ) # .encode('UTF-8')
return js return js
except: except Exception as e:
if config.Config().debug():
print(e)
data = { data = {
"title": "", "title": "",
} }

View File

@@ -120,7 +120,9 @@ def main(number):
'source': 'avsox.py', 'source': 'avsox.py',
'series': getSeries(info), 'series': getSeries(info),
} }
except: except Exception as e:
if config.Config().debug():
print(e)
dic = {"title": ""} dic = {"title": ""}
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
return js return js

View File

@@ -18,7 +18,9 @@ def main(number: str) -> json:
if not soup.select_one("#moviepages > div > div:nth-child(1) > div.movie-info.section"): if not soup.select_one("#moviepages > div > div:nth-child(1) > div.movie-info.section"):
raise ValueError("page info not found") raise ValueError("page info not found")
except: except Exception as e:
if config.Config().debug():
print(e)
dic = {"title": ""} dic = {"title": ""}
return json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':')) return json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))
dic = { dic = {

View File

@@ -152,7 +152,9 @@ def main(number):
} }
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
return js return js
except: except Exception as e:
if config.Config().debug():
print(e)
data = { data = {
"title": "", "title": "",
} }

View File

@@ -112,7 +112,8 @@ def main(number):
'series': '', 'series': '',
} }
except Exception as e: except Exception as e:
print(e) if ADC_function.config.Config().debug():
print(e)
dic = {"title": ""} dic = {"title": ""}
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
return js return js

View File

@@ -178,7 +178,9 @@ def main(number):
return js return js
except: except:
return main_uncensored(number) return main_uncensored(number)
except: except Exception as e:
if config.Config().debug():
print(e)
data = { data = {
"title": "", "title": "",
} }

View File

@@ -293,7 +293,9 @@ def main(number):
'series': getSeries(detail_page), 'series': getSeries(detail_page),
} }
except Exception: except Exception as e:
if config.Config().debug():
print(e)
dic = {"title": ""} dic = {"title": ""}
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
return js return js

View File

@@ -136,7 +136,9 @@ def main(number2):
'source': 'mgstage.py', 'source': 'mgstage.py',
'series': getSeries(a), 'series': getSeries(a),
} }
except: except Exception as e:
if config.Config().debug():
print(e)
dic = {"title": ""} dic = {"title": ""}
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')

View File

@@ -199,7 +199,8 @@ def main(number):
'series': getSeries(detail_page), 'series': getSeries(detail_page),
} }
except Exception as e: except Exception as e:
# print(e) if config.Config().debug():
print(e)
dic = {"title": ""} dic = {"title": ""}
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')