Fix check_files
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Michel Roux 2023-01-20 16:05:04 +01:00
parent 05297aece2
commit 55db6736ba

View File

@ -106,9 +106,11 @@ def parse_size(size):
def check_files(id): def check_files(id):
req = requests.get(f"https://{YGG_DOMAIN}/engine/get_files", params={"torrent": id}) req = session.get(f"{YGG_DOMAIN}/engine/get_files", params={"torrent": id})
res = json.loads(req.text) res = bs4.BeautifulSoup(req.text, "html.parser")
html = bs4.BeautifulSoup(res["html"], "html.parser") pre = res.select_one("pre")
jhtml = json.loads(pre.get_text())
html = bs4.BeautifulSoup(jhtml["html"], "html.parser")
trs = html.select("tr") trs = html.select("tr")
return len(trs) == 1 and "mkv" in trs[0].get_text().lower() return len(trs) == 1 and "mkv" in trs[0].get_text().lower()