Add yggtorrent base url
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
da030848f8
commit
ab41d6796c
@ -9,6 +9,7 @@ from requests import Session, adapters
|
|||||||
from urllib3.util.connection import HAS_IPV6
|
from urllib3.util.connection import HAS_IPV6
|
||||||
|
|
||||||
BLACKLIST_WORDS = ["dvd", "iso"]
|
BLACKLIST_WORDS = ["dvd", "iso"]
|
||||||
|
YGGTORRENT_BASE_URL = "https://www5.yggtorrent.fi"
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -74,9 +75,7 @@ session.mount("https://", DNSAdapter(["1.1.1.1"]))
|
|||||||
|
|
||||||
|
|
||||||
def get_files(id):
|
def get_files(id):
|
||||||
req = session.get(
|
req = session.get(f"{YGGTORRENT_BASE_URL}/engine/get_files", params={"torrent": id})
|
||||||
"https://www5.yggtorrent.fi/engine/get_files", params={"torrent": id}
|
|
||||||
)
|
|
||||||
files = req.json()
|
files = req.json()
|
||||||
html = BeautifulSoup(files["html"], "html.parser")
|
html = BeautifulSoup(files["html"], "html.parser")
|
||||||
trs = html.select("tr")
|
trs = html.select("tr")
|
||||||
@ -99,7 +98,7 @@ def search_ygg(query, multi):
|
|||||||
if multi:
|
if multi:
|
||||||
ygg_params["option_langue"] = ["4"]
|
ygg_params["option_langue"] = ["4"]
|
||||||
|
|
||||||
req = session.get("https://www5.yggtorrent.fi/engine/search", params=ygg_params)
|
req = session.get(f"{YGGTORRENT_BASE_URL}/engine/search", params=ygg_params)
|
||||||
html = BeautifulSoup(req.text, "html.parser")
|
html = BeautifulSoup(req.text, "html.parser")
|
||||||
trs = html.select("table.table tr")
|
trs = html.select("table.table tr")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user