This commit is contained in:
parent
3421790411
commit
a03bd570e4
@ -74,12 +74,12 @@ session.mount("http://", DNSAdapter(["1.1.1.1"]))
|
||||
session.mount("https://", DNSAdapter(["1.1.1.1"]))
|
||||
|
||||
|
||||
def get_files(id):
|
||||
def check_files(id):
|
||||
req = session.get(f"{YGGTORRENT_BASE_URL}/engine/get_files", params={"torrent": id})
|
||||
files = req.json()
|
||||
html = BeautifulSoup(files["html"], "html.parser")
|
||||
trs = html.select("tr")
|
||||
return len(trs)
|
||||
return len(trs) == 1 and "mkv" in trs[0].get_text().lower()
|
||||
|
||||
|
||||
def search_ygg(query, multi, full):
|
||||
@ -135,7 +135,7 @@ def search_ygg(query, multi, full):
|
||||
link = tds[1].a["href"]
|
||||
id = link.split("/")[-1].split("-")[0]
|
||||
|
||||
if get_files(id) > 1:
|
||||
if not check_files(id):
|
||||
continue
|
||||
|
||||
print(f"{name} {link}")
|
||||
|
Loading…
Reference in New Issue
Block a user