mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-15 16:19:28 +01:00
Fixes what.cd snatches getting stuck at pre-processing with blackhole downloader
Cloudflare requires a user-agent header otherwise will return 403 forbidden.
This commit is contained in:
@@ -1553,6 +1553,9 @@ def preprocesstorrent(resultlist, pre_sorted_list=False):
|
||||
if result[3] == 'Kick Ass Torrent':
|
||||
request.add_header('Referer', 'http://kat.ph/')
|
||||
|
||||
if result[3] == 'What.cd':
|
||||
request.add_header('User-Agent', 'Headphones')
|
||||
|
||||
response = urllib2.urlopen(request)
|
||||
if response.info().get('Content-Encoding') == 'gzip':
|
||||
buf = StringIO(response.read())
|
||||
|
||||
Reference in New Issue
Block a user