pull/15/head
DiMartinoXBMC 2017-01-15 20:53:10 +03:00
parent ff7ef919a4
commit ad88903843
1 changed files with 8 additions and 4 deletions

12
Core.py
View File

@ -1876,10 +1876,14 @@ class Core:
f = open(url, 'rb') f = open(url, 'rb')
torrent = f.read() torrent = f.read()
f.close() f.close()
from python_libtorrent import get_libtorrent try:
libtorrent = get_libtorrent() from python_libtorrent import get_libtorrent
info = libtorrent.torrent_info(libtorrent.bdecode(torrent)) libtorrent = get_libtorrent()
name = info.name() info = libtorrent.torrent_info(libtorrent.bdecode(torrent))
name = info.name()
except:
log('get_libtorrent import error, name = None')
name = None
success = Download().add(torrent, dirname) success = Download().add(torrent, dirname)
if success: if success:
showMessage(self.localize('Torrent-client Browser'), self.localize('Added!'), forced=True) showMessage(self.localize('Torrent-client Browser'), self.localize('Added!'), forced=True)