From d9c78da99767e6157a029eb74c6d7b3c7fd5581a Mon Sep 17 00:00:00 2001 From: Ade Date: Sat, 5 Sep 2015 11:42:35 +1200 Subject: [PATCH] blackhole convert magnet Seems only torcache working, comment others and add user agent --- headphones/searcher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 6bcaf81d..7dbcf5ba 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -42,8 +42,8 @@ from bencode import bencode, bdecode # Magnet to torrent services, for Black hole. Stolen from CouchPotato. TORRENT_TO_MAGNET_SERVICES = [ - 'https://zoink.it/torrent/%s.torrent', - 'http://torrage.com/torrent/%s.torrent', + #'https://zoink.it/torrent/%s.torrent', + #'http://torrage.com/torrent/%s.torrent', 'https://torcache.net/torrent/%s.torrent', ] @@ -791,10 +791,11 @@ def send_to_downloader(data, bestqual, album): # Randomize list of services services = TORRENT_TO_MAGNET_SERVICES[:] random.shuffle(services) + headers = {'User-Agent': USER_AGENT} for service in services: - data = request.request_content(service % torrent_hash) + data = request.request_content(service % torrent_hash, headers=headers) if data and "torcache" in data: if not torrent_to_file(download_path, data): return