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')
return js
except:
except Exception as e:
if config.Config().debug():
print(e)
data = {
"title": "",
}

View File

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

View File

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

View File

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

View File

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

View File

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