mirror of
https://github.com/moparisthebest/SickRage
synced 2025-03-04 10:29:52 -05:00
Merge pull request #744 from sammy2142/patch-1
Should fix some utorrent, rtorrent and deluge
This commit is contained in:
commit
0cea9877ed
@ -143,14 +143,15 @@ class GenericClient(object):
|
|||||||
def _get_torrent_hash(self, result):
|
def _get_torrent_hash(self, result):
|
||||||
|
|
||||||
if result.url.startswith('magnet'):
|
if result.url.startswith('magnet'):
|
||||||
torrent_hash = re.findall('urn:btih:([\w]{32,40})', result.url)[0]
|
result.hash = re.findall('urn:btih:([\w]{32,40})', result.url)[0]
|
||||||
if len(torrent_hash) == 32:
|
if len(result.hash) == 32:
|
||||||
torrent_hash = b16encode(b32decode(torrent_hash)).lower()
|
result.hash = b16encode(b32decode(torrent_hash)).lower()
|
||||||
else:
|
else:
|
||||||
|
result.content = result.provider.getURL(result.url)
|
||||||
info = bdecode(result.content)["info"]
|
info = bdecode(result.content)["info"]
|
||||||
torrent_hash = sha1(bencode(info)).hexdigest()
|
result.hash = sha1(bencode(info)).hexdigest()
|
||||||
|
|
||||||
return torrent_hash
|
return result
|
||||||
|
|
||||||
def sendTORRENT(self, result):
|
def sendTORRENT(self, result):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user