return to kostil

pull/15/head
DiMartinoXBMC 2017-01-10 20:34:13 +03:00
parent 01f94d009d
commit 73add38efc
1 changed files with 13 additions and 7 deletions

20
Core.py
View File

@ -1547,7 +1547,7 @@ class Core:
xbmc.executebuiltin('xbmc.Playlist.Clear')
url = unquote(get("url"), None)
url2 = unquote(get("url2"), None)
fileIndex = unquote(get("index"), None)
index = unquote(get("index"), None)
if url:
self.__settings__.setSetting("lastTorrentUrl", url)
classMatch = re.search('(\w+)::(.+)', url)
@ -1557,12 +1557,18 @@ class Core:
torrent = Downloader.Torrent(self.userStorageDirectory, torrentFilesDirectory=self.torrentFilesDirectory)
filename = torrent.saveTorrent(url)
self.__settings__.setSetting("lastTorrent", filename)
if fileIndex == None: fileIndex = chooseFile(torrent.getContentList())
if fileIndex:
params = {'url': fileIndex, 'filename': filename}
if url2: params['url2'] = url2
self.playTorrent(params)
#xbmc.executebuiltin('xbmc.RunPlugin("plugin://plugin.video.torrenter/?action=playTorrent&url=%s' % (fileIndex))
if index == None: index = chooseFile(torrent.getContentList())
if index:
#params = {'url': index, 'filename': filename}
#if url2: params['url2'] = url2
#self.playTorrent(params)
url = 'plugin://plugin.video.torrenter/?action=playTorrent'
url += '&url=%s' % (str(index))
if url2: url += '&url2=%s' % (url2)
if filename: url += '&filename=%s' % (urllib.quote_plus(ensure_str(filename)))
xbmc.executebuiltin('xbmc.RunPlugin("%s")' % (url))
def openTorrent(self, params={}):
get = params.get