Merge branch 'refs/heads/develop'
This commit is contained in:
@@ -39,19 +39,19 @@ class uTorrent(Downloader):
|
|||||||
if not filedata and data.get('type') == 'torrent':
|
if not filedata and data.get('type') == 'torrent':
|
||||||
log.error('Failed sending torrent, no data')
|
log.error('Failed sending torrent, no data')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if data.get('type') == 'torrent_magnet':
|
if data.get('type') == 'torrent_magnet':
|
||||||
torrent_hash = re.findall('urn:btih:([\w]{32,40})', data.get('url'))[0].upper()
|
torrent_hash = re.findall('urn:btih:([\w]{32,40})', data.get('url'))[0].upper()
|
||||||
torrent_params['trackers'] = '%0D%0A%0D%0A'.join(self.torrent_trackers)
|
torrent_params['trackers'] = '%0D%0A%0D%0A'.join(self.torrent_trackers)
|
||||||
else:
|
else:
|
||||||
# Convert base 32 to hex
|
info = bdecode(filedata)["info"]
|
||||||
if len(torrent_hash) == 32:
|
torrent_hash = sha1(bencode(info)).hexdigest().upper()
|
||||||
torrent_hash = b16encode(b32decode(torrent_hash))
|
|
||||||
else:
|
|
||||||
info = bdecode(filedata)["info"]
|
|
||||||
torrent_hash = sha1(bencode(info)).hexdigest().upper()
|
|
||||||
|
|
||||||
torrent_filename = self.createFileName(data, filedata, movie)
|
torrent_filename = self.createFileName(data, filedata, movie)
|
||||||
|
|
||||||
|
# Convert base 32 to hex
|
||||||
|
if len(torrent_hash) == 32:
|
||||||
|
torrent_hash = b16encode(b32decode(torrent_hash))
|
||||||
|
|
||||||
# Send request to uTorrent
|
# Send request to uTorrent
|
||||||
try:
|
try:
|
||||||
if not self.utorrent_api:
|
if not self.utorrent_api:
|
||||||
|
|||||||
Reference in New Issue
Block a user