Skip to content

Instantly share code, notes, and snippets.

@nickfox-taterli
Created September 17, 2022 06:25
Show Gist options
  • Save nickfox-taterli/15d45f48ac1f13a74938ca0306e05a53 to your computer and use it in GitHub Desktop.
Save nickfox-taterli/15d45f48ac1f13a74938ca0306e05a53 to your computer and use it in GitHub Desktop.
自动免费HDAREA
import time
import random
import qbittorrentapi
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
ids = list()
servers = ['89.47.160.92', '89.40.10.157', '37.187.1.230', '37.59.36.21', '198.100.145.102', '198.27.64.97',
'5.196.69.47', '5.196.88.219', '37.187.112.38', '5.135.152.13']
cookies = [{'domain': 'www.hdarea.co', 'expiry': 1697525102, 'httpOnly': False, 'name': 'c_secure_login', 'path': '/',
'secure': False, 'value': 'bm9wZQ%3D%3D'},
{'domain': 'www.hdarea.co', 'expiry': 1697525102, 'httpOnly': False, 'name': 'c_secure_tracker_ssl',
'path': '/', 'secure': False, 'value': 'eWVhaA%3D%3D'},
{'domain': 'www.hdarea.co', 'expiry': 1697525102, 'httpOnly': False, 'name': 'c_secure_ssl', 'path': '/',
'secure': False, 'value': 'eWVhaA%3D%3D'},
{'domain': '.hdarea.co', 'expiry': 1662966909, 'httpOnly': True, 'name': '__cf_bm', 'path': '/',
'sameSite': 'None', 'secure': True,
'value': 'sPdeqcHuIwA2TM4BoBZJEdBpwBroHAqpfiH10EOMT4o-1662965108-0-AWOtiuXmULJYxTpnL1BiS+gJrpgugBpH8FyG/WHMx6TB1Sq3L8JprXNNl/QW8zQuiPppc1eFDbWMS1Pxcuq7NWjnHZDJArOHqqyUb7RmUnkrZZAEb3MaqbzlKDzxBETlB2K2YDAPVBUHrE8Rgpb7P3r/cSHr2/yk9/IYRC/iSMRm'},
{'domain': 'www.hdarea.co', 'expiry': 1697525102, 'httpOnly': False, 'name': 'c_secure_pass', 'path': '/',
'secure': False, 'value': '4c47f4aad48ba8f423750c8462d95645'},
{'domain': 'www.hdarea.co', 'expiry': 1697525102, 'httpOnly': False, 'name': 'c_secure_uid', 'path': '/',
'secure': False, 'value': 'ODU4NDY%3D'}]
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/usr/bin/chromedriver',options=chrome_options)
driver.get("https://www.hdarea.co/torrents.php")
for cookie in cookies:
driver.add_cookie(cookie)
while True:
driver.get("https://www.hdarea.co/torrents.php")
elems = driver.find_elements(By.CLASS_NAME, 'nonstick_outer_bg')
for elem in elems:
if 'pro_free' in elem.get_attribute('innerHTML') and 'progress' not in elem.get_attribute('innerHTML'):
id = elem.find_element(by=By.CLASS_NAME, value="embedded").find_element(by=By.XPATH, value="./a").get_attribute(
'href')
id = id.split('id=')[1].split('&')[0]
if id in ids:
break
ids.append(id)
download_link = 'https://www.hdarea.co/download.php?id=' + id + '&passkey=718b5b05650339e66d42a18bea93a908'
print(download_link)
client = qbittorrentapi.Client(
host=random.choice(servers),
port=8080,
username='admin',
password='TaterLi1024',
)
client.torrents_add(urls=download_link, category='www.hdarea.co')
time.sleep(5)
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment