Fix jav321 Exception handling #2
This commit is contained in:
@@ -10,13 +10,12 @@ import re
|
|||||||
def main(number: str) -> json:
|
def main(number: str) -> json:
|
||||||
try:
|
try:
|
||||||
result = post_html(url="https://www.jav321.com/search", query={"sn": number})
|
result = post_html(url="https://www.jav321.com/search", query={"sn": number})
|
||||||
|
soup = BeautifulSoup(result.text, "html.parser")
|
||||||
|
lx = html.fromstring(str(soup))
|
||||||
except:
|
except:
|
||||||
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=(',', ':'))
|
||||||
|
|
||||||
soup = BeautifulSoup(result.text, "html.parser")
|
|
||||||
lx = html.fromstring(str(soup))
|
|
||||||
|
|
||||||
if "/video/" in result.url:
|
if "/video/" in result.url:
|
||||||
data = parse_info(soup)
|
data = parse_info(soup)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user