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:
Evan Bruhn
2014-01-27 14:05:09 +11:00
parent 03d577eb72
commit afe9a0259e

View File

@@ -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())