This commit is contained in:
parent
96aef68223
commit
136039cabe
7
commands/pygg.py
Normal file → Executable file
7
commands/pygg.py
Normal file → Executable file
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
@ -99,8 +100,10 @@ session = FlareRequests()
|
||||
|
||||
def check_files(id):
|
||||
req = session.get(f"{YGGTORRENT_BASE_URL}/engine/get_files", params={"torrent": id})
|
||||
files = req.json()
|
||||
html = bs4.BeautifulSoup(files["html"], "html.parser")
|
||||
res = bs4.BeautifulSoup(req.text, "html.parser")
|
||||
pre = res.select_one("pre")
|
||||
jhtml = json.loads(pre.get_text())
|
||||
html = bs4.BeautifulSoup(jhtml["html"], "html.parser")
|
||||
trs = html.select("tr")
|
||||
return len(trs) == 1 and "mkv" in trs[0].get_text().lower()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user