diff --git a/src/trackers/HDT.py b/src/trackers/HDT.py index a1117b67..01f034a0 100644 --- a/src/trackers/HDT.py +++ b/src/trackers/HDT.py @@ -168,7 +168,7 @@ async def upload(self, meta, disctype): data['anonymous'] = 'true' # Send - url = "https://hd-torrents.org/upload.php" + url = "https://hd-torrents.net/upload.php" if meta['debug']: console.print(url) console.print(data) @@ -184,7 +184,7 @@ async def upload(self, meta, disctype): search = re.search(r"download\.php\?id\=([a-z0-9]+)", up.text).group(1) if search: # modding existing torrent for adding to client instead of downloading torrent from site. - await common.add_tracker_torrent(meta, self.tracker, self.source_flag, self.config['TRACKERS']['HDT'].get('my_announce_url'), "https://hd-torrents.org/details.php?id=" + search) + await common.add_tracker_torrent(meta, self.tracker, self.source_flag, self.config['TRACKERS']['HDT'].get('my_announce_url'), "") else: console.print(data) console.print("\n\n") @@ -199,7 +199,7 @@ async def search_existing(self, meta, disctype): cookiefile = os.path.abspath(f"{meta['base_dir']}/data/cookies/HDT.txt") session.cookies.update(await common.parseCookieFile(cookiefile)) - search_url = "https://hd-torrents.org/torrents.php" + search_url = "https://hd-torrents.net/torrents.php" csrfToken = await self.get_csrfToken(session, search_url) if int(meta['imdb_id'].replace('tt', '')) != 0: params = { @@ -237,7 +237,7 @@ async def validate_credentials(self, meta): async def validate_cookies(self, meta, cookiefile): common = COMMON(config=self.config) - url = "https://hd-torrents.org/index.php" + url = "https://hd-torrents.net/index.php" cookiefile = f"{meta['base_dir']}/data/cookies/HDT.txt" if os.path.exists(cookiefile): with requests.Session() as session: @@ -254,35 +254,6 @@ async def validate_cookies(self, meta, cookiefile): else: return False - """ - Old login method, disabled because of site's DDOS protection. Better to use exported cookies. - - - async def login(self, cookiefile): - with requests.Session() as session: - url = "https://hd-torrents.org/login.php" - csrfToken = await self.get_csrfToken(session, url) - data = { - 'csrfToken' : csrfToken, - 'uid' : self.username, - 'pwd' : self.password, - 'submit' : 'Confirm' - } - response = session.post('https://hd-torrents.org/login.php', data=data) - await asyncio.sleep(0.5) - index = 'https://hd-torrents.org/index.php' - response = session.get(index) - if response.text.find("Logout") != -1: - console.print('[green]Successfully logged into HDT') - with open(cookiefile, 'wb') as cf: - pickle.dump(session.cookies, cf) - else: - console.print('[bold red]Something went wrong while trying to log into HDT. Make sure your username and password are correct') - await asyncio.sleep(1) - console.print(response.url) - return - """ - async def get_csrfToken(self, session, url): r = session.get(url) await asyncio.sleep(0.5)