Remove json dependency
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2023-01-06 00:09:11 +01:00
parent ed7448196f
commit 760e669b21

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import json
import os import os
import re import re
import urllib import urllib
@ -37,7 +36,7 @@ def check_files(id):
params={"torrent": id}, params={"torrent": id},
headers={"Host": YGG_DOMAIN}, headers={"Host": YGG_DOMAIN},
) )
res = json.loads(req.text) res = req.json()
html = bs4.BeautifulSoup(res["html"], "html.parser") html = bs4.BeautifulSoup(res["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()