astroport-iptubes/selenium.py

26 lines
813 B
Python
Executable File

#!/usr/bin/python3
import sys
from yggcrawl import YggTorrentScraperSelenium
from selenium import webdriver
if __name__ == "__main__":
options = webdriver.ChromeOptions()
options.add_argument("--log-level=3")
options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = webdriver.Chrome("D:\chromedriver.exe", options=options)
scraper = YggTorrentScraperSelenium(driver=driver)
# or
# scraper = YggTorrentScraperSelenium(driver_path="D:\chromedriver.exe")
if scraper.login("myidentifiant", "mypassword"):
print("Login success")
torrents_url = scraper.search({"name": "walking dead"})
print(torrents_url)
else:
print("Login failed")