Browse Source

Fix erroneous multiple downloads of torrent files which causes snatches to fail under certain conditions

Namely this fixes snatching with the IPtorrents provider. This issue is masked in develop as the requests library has been updated and fixes the error that is generated
tags/release_0.9.1^2
Adam 10 years ago
parent
commit
9d08b8ef8f
  1. 5
      CHANGES.md
  2. 2
      sickbeard/clients/generic.py
  3. 12
      sickbeard/search.py

5
CHANGES.md

@ -1,3 +1,8 @@
### 0.9.1 (2015-05-25 03:03:00 UTC)
* Fix erroneous multiple downloads of torrent files which causes snatches to fail under certain conditions
### 0.9.0 (2015-05-18 14:33:00 UTC)
* Update Tornado webserver to 4.2.dev1 (609dbb9)

2
sickbeard/clients/generic.py

@ -151,7 +151,6 @@ class GenericClient(object):
if len(result.hash) == 32:
result.hash = b16encode(b32decode(result.hash)).lower()
else:
result.content = result.provider.getURL(result.url)
info = bdecode(result.content)['info']
result.hash = sha1(bencode(info)).hexdigest()
@ -171,7 +170,6 @@ class GenericClient(object):
# Sets per provider seed ratio
result.ratio = result.provider.seedRatio()
# lazy fix for now, I'm sure we already do this somewhere else too
result = self._get_torrent_hash(result)
if result.url.startswith('magnet'):

12
sickbeard/search.py

@ -133,13 +133,11 @@ def snatchEpisode(result, endStatus=SNATCHED):
dlResult = _downloadResult(result)
else:
# make sure we have the torrent file content
if not result.content:
if not result.url.startswith('magnet'):
result.content = result.provider.getURL(result.url)
if not result.content:
logger.log(
u"Torrent content failed to download from " + result.url, logger.ERROR
)
if not result.content and not result.url.startswith('magnet'):
result.content = result.provider.getURL(result.url)
if not result.content:
logger.log(u'Torrent content failed to download from ' + result.url, logger.ERROR)
return False
# Snatches torrent with client
client = clients.getClientIstance(sickbeard.TORRENT_METHOD)()
dlResult = client.sendTORRENT(result)

Loading…
Cancel
Save