Merge pull request #52 from Palatosino/master

Fix magnetToTorrent
pull/14/head
DiMartinoXBMC 2016-05-12 19:52:06 +03:00
commit 2910bf499e
1 changed files with 1 additions and 2 deletions

View File

@ -188,10 +188,9 @@ class SkorbaLoader:
if torrentInfo: if torrentInfo:
try: try:
torrentFile = self.lt.create_torrent(torrentInfo) torrentFile = self.lt.create_torrent(torrentInfo)
baseName = os.path.basename(self.storageDirectory + os.sep + torrentInfo.files()[0].path)
if not xbmcvfs.exists(self.torrentFilesPath): if not xbmcvfs.exists(self.torrentFilesPath):
xbmcvfs.mkdirs(self.torrentFilesPath) xbmcvfs.mkdirs(self.torrentFilesPath)
self.torrentFile = self.torrentFilesPath + self.md5(baseName) + '.torrent' self.torrentFile = self.torrentFilesPath + self.md5(magnet) + '.torrent'
torentFileHandler = xbmcvfs.File(self.torrentFile, "w+b") torentFileHandler = xbmcvfs.File(self.torrentFile, "w+b")
torentFileHandler.write(self.lt.bencode(torrentFile.generate())) torentFileHandler.write(self.lt.bencode(torrentFile.generate()))
torentFileHandler.close() torentFileHandler.close()