fixes
parent
3de1a28a97
commit
90ea77513c
1012
.idea/workspace.xml
1012
.idea/workspace.xml
File diff suppressed because it is too large
Load Diff
|
@ -39,8 +39,12 @@ from contextlib import contextmanager, closing, nested
|
||||||
|
|
||||||
from functions import foldername, showMessage, clearStorage, WatchedHistoryDB, get_ids_video, log, debug, ensure_str
|
from functions import foldername, showMessage, clearStorage, WatchedHistoryDB, get_ids_video, log, debug, ensure_str
|
||||||
|
|
||||||
from torrent2http import State, Engine, MediaType
|
if sys.modules["__main__"].__settings__.getSetting("torrent_player") == '2':
|
||||||
#from pyrrent2http import State, Engine, MediaType
|
from torrent2http import State, Engine, MediaType
|
||||||
|
author = 'Anteo'
|
||||||
|
elif sys.modules["__main__"].__settings__.getSetting("torrent_player") == '3':
|
||||||
|
from pyrrent2http import State, Engine, MediaType
|
||||||
|
author = 'Inpos'
|
||||||
|
|
||||||
ROOT = sys.modules["__main__"].__root__
|
ROOT = sys.modules["__main__"].__root__
|
||||||
RESOURCES_PATH = os.path.join(ROOT, 'resources')
|
RESOURCES_PATH = os.path.join(ROOT, 'resources')
|
||||||
|
@ -210,8 +214,8 @@ class AnteoLoader:
|
||||||
localFile.write(content)
|
localFile.write(content)
|
||||||
localFile.close()
|
localFile.close()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print 'Unable to save torrent file from "' + torrentUrl + '" to "' + torrentFile + '" in Torrent::saveTorrent' + '. Exception: ' + str(
|
log('Unable to rename torrent file from %s to %s in AnteoLoader::saveTorrent. Exception: %s' %
|
||||||
e)
|
(torrentUrl, torrentFile, str(e)))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
torrentFile = torrentUrl
|
torrentFile = torrentUrl
|
||||||
|
@ -239,7 +243,7 @@ class AnteoLoader:
|
||||||
self.torrentFile = torrent.torrentFile
|
self.torrentFile = torrent.torrentFile
|
||||||
except:
|
except:
|
||||||
self.torrentFile = magnet
|
self.torrentFile = magnet
|
||||||
log('[AnteoLoader][magnetToTorrent]: self.torrentFile '+str(self.torrentFile))
|
log('['+author+'Loader][magnetToTorrent]: self.torrentFile '+str(self.torrentFile))
|
||||||
|
|
||||||
class AnteoPlayer(xbmc.Player):
|
class AnteoPlayer(xbmc.Player):
|
||||||
__plugin__ = sys.modules["__main__"].__plugin__
|
__plugin__ = sys.modules["__main__"].__plugin__
|
||||||
|
@ -278,15 +282,15 @@ class AnteoPlayer(xbmc.Player):
|
||||||
self.setup_nextep()
|
self.setup_nextep()
|
||||||
while True:
|
while True:
|
||||||
if self.buffer():
|
if self.buffer():
|
||||||
log('[AnteoPlayer]: ************************************* GOING LOOP')
|
log('['+author+'Player]: ************************************* GOING LOOP')
|
||||||
if self.setup_play():
|
if self.setup_play():
|
||||||
self.setup_subs()
|
self.setup_subs()
|
||||||
self.loop()
|
self.loop()
|
||||||
WatchedHistoryDB().add(self.basename, foldername(self.getContentList()[self.contentId]['title']), self.watchedTime, self.totalTime, self.contentId, self.fullSize)
|
WatchedHistoryDB().add(self.basename, foldername(self.getContentList()[self.contentId]['title']), self.watchedTime, self.totalTime, self.contentId, self.fullSize)
|
||||||
else:
|
else:
|
||||||
log('[AnteoPlayer]: ************************************* break')
|
log('['+author+'Player]: ************************************* break')
|
||||||
break
|
break
|
||||||
log('[AnteoPlayer]: ************************************* GO NEXT?')
|
log('['+author+'Player]: ************************************* GO NEXT?')
|
||||||
if self.next_dl and self.next_contentId != False and isinstance(self.next_contentId, int) and self.iterator == 100:
|
if self.next_dl and self.next_contentId != False and isinstance(self.next_contentId, int) and self.iterator == 100:
|
||||||
if not self.next_play:
|
if not self.next_play:
|
||||||
xbmc.sleep(3000)
|
xbmc.sleep(3000)
|
||||||
|
@ -296,7 +300,7 @@ class AnteoPlayer(xbmc.Player):
|
||||||
break
|
break
|
||||||
self.contentId = self.next_contentId
|
self.contentId = self.next_contentId
|
||||||
continue
|
continue
|
||||||
log('[AnteoPlayer]: ************************************* NO! break')
|
log('['+author+'Player]: ************************************* NO! break')
|
||||||
break
|
break
|
||||||
|
|
||||||
xbmc.Player().stop()
|
xbmc.Player().stop()
|
||||||
|
@ -455,7 +459,7 @@ class AnteoPlayer(xbmc.Player):
|
||||||
else:
|
else:
|
||||||
self.next_dl = False
|
self.next_dl = False
|
||||||
self.next_play = self.__settings__.getSetting('next_play') == 'true'
|
self.next_play = self.__settings__.getSetting('next_play') == 'true'
|
||||||
log('[AnteoPlayer]: next_dl - %s, next_play - %s, ids_video - %s' % (str(self.next_dl), str(self.next_play), str(self.ids_video)))
|
log('['+author+'Player]: next_dl - %s, next_play - %s, ids_video - %s' % (str(self.next_dl), str(self.next_play), str(self.ids_video)))
|
||||||
|
|
||||||
def setup_play(self):
|
def setup_play(self):
|
||||||
file_status = self.engine.file_status(self.contentId)
|
file_status = self.engine.file_status(self.contentId)
|
||||||
|
@ -474,7 +478,7 @@ class AnteoPlayer(xbmc.Player):
|
||||||
self.next_contentId = int(self.ids_video[next_contentId_index])
|
self.next_contentId = int(self.ids_video[next_contentId_index])
|
||||||
else:
|
else:
|
||||||
self.next_contentId = False
|
self.next_contentId = False
|
||||||
log('[AnteoPlayer][setup_play]: next_contentId: '+str(self.next_contentId))
|
log('['+author+'Player][setup_play]: next_contentId: '+str(self.next_contentId))
|
||||||
try:
|
try:
|
||||||
seasonId = self.get("seasonId")
|
seasonId = self.get("seasonId")
|
||||||
self.episodeId = self.get("episodeId") if not self.episodeId else int(self.episodeId) + 1
|
self.episodeId = self.get("episodeId") if not self.episodeId else int(self.episodeId) + 1
|
||||||
|
@ -494,7 +498,7 @@ class AnteoPlayer(xbmc.Player):
|
||||||
'season': int(seasonId),
|
'season': int(seasonId),
|
||||||
'tvshowtitle': title})
|
'tvshowtitle': title})
|
||||||
except:
|
except:
|
||||||
log('[AnteoPlayer]: Operation INFO failed!')
|
log('['+author+'Player]: Operation INFO failed!')
|
||||||
|
|
||||||
thumbnail = self.get("thumbnail")
|
thumbnail = self.get("thumbnail")
|
||||||
if thumbnail:
|
if thumbnail:
|
||||||
|
@ -510,12 +514,12 @@ class AnteoPlayer(xbmc.Player):
|
||||||
xbmc.sleep(200)
|
xbmc.sleep(200)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
log('[AnteoPlayer]: self.isPlaying() = %s, i = %d, xbmc.abortRequested - %s' % (str(self.isPlaying()), i, str(xbmc.abortRequested)))
|
log('['+author+'Player]: self.isPlaying() = %s, i = %d, xbmc.abortRequested - %s' % (str(self.isPlaying()), i, str(xbmc.abortRequested)))
|
||||||
if not self.isPlaying() or xbmc.abortRequested:
|
if not self.isPlaying() or xbmc.abortRequested:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if self.seek > 0:
|
if self.seek > 0:
|
||||||
log('[AnteoPlayer]: seekTime - '+str(self.seek))
|
log('['+author+'Player]: seekTime - '+str(self.seek))
|
||||||
self.seekTime(self.seek)
|
self.seekTime(self.seek)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -622,7 +626,7 @@ class AnteoPlayer(xbmc.Player):
|
||||||
if not status:
|
if not status:
|
||||||
status = self.engine.status()
|
status = self.engine.status()
|
||||||
self.engine.check_torrent_error(status)
|
self.engine.check_torrent_error(status)
|
||||||
log('[AnteoPlayer]: %.2f%% complete (down: %.1f kb/s up: %.1f kb/s peers: %d) %s' % \
|
log('['+author+'Player]: %.2f%% complete (down: %.1f kb/s up: %.1f kb/s peers: %d) %s' % \
|
||||||
(status.progress * 100, status.download_rate,
|
(status.progress * 100, status.download_rate,
|
||||||
status.upload_rate, status.num_peers, status.state_str))
|
status.upload_rate, status.num_peers, status.state_str))
|
||||||
|
|
||||||
|
|
8
Core.py
8
Core.py
|
@ -35,7 +35,7 @@ class Core:
|
||||||
userStorageDirectory = file_encode(__settings__.getSetting("storage"))
|
userStorageDirectory = file_encode(__settings__.getSetting("storage"))
|
||||||
torrentFilesDirectory = 'torrents'
|
torrentFilesDirectory = 'torrents'
|
||||||
debug = __settings__.getSetting('debug') == 'true'
|
debug = __settings__.getSetting('debug') == 'true'
|
||||||
torrent_player=__settings__.getSetting("torrent_player")
|
torrent_player = __settings__.getSetting("torrent_player")
|
||||||
history_bool = __settings__.getSetting('history') == 'true'
|
history_bool = __settings__.getSetting('history') == 'true'
|
||||||
open_option = int(__settings__.getSetting('open_option'))
|
open_option = int(__settings__.getSetting('open_option'))
|
||||||
language = {0: 'en', 1: 'ru', 2: 'uk', 3: 'he'}.get(int(__settings__.getSetting("language")))
|
language = {0: 'en', 1: 'ru', 2: 'uk', 3: 'he'}.get(int(__settings__.getSetting("language")))
|
||||||
|
@ -54,7 +54,7 @@ class Core:
|
||||||
def sectionMenu(self):
|
def sectionMenu(self):
|
||||||
if self.__settings__.getSetting('plugin_name') != self.__plugin__:
|
if self.__settings__.getSetting('plugin_name') != self.__plugin__:
|
||||||
#Every update run
|
#Every update run
|
||||||
first_run_242()
|
first_run_250()
|
||||||
self.__settings__.setSetting('plugin_name', self.__plugin__)
|
self.__settings__.setSetting('plugin_name', self.__plugin__)
|
||||||
#check_network_advancedsettings()
|
#check_network_advancedsettings()
|
||||||
check_download_dir()
|
check_download_dir()
|
||||||
|
@ -100,7 +100,7 @@ class Core:
|
||||||
image=self.ROOT + '/icons/torrentPlayer.png')
|
image=self.ROOT + '/icons/torrentPlayer.png')
|
||||||
self.drawItem('< %s >' % self.localize('Search Control Window'), 'controlCenter',
|
self.drawItem('< %s >' % self.localize('Search Control Window'), 'controlCenter',
|
||||||
image=self.ROOT + '/icons/settings.png', isFolder=False)
|
image=self.ROOT + '/icons/settings.png', isFolder=False)
|
||||||
self.drawItem('< %s >' % self.localize('Magnet-link Player'), 'magentPlayer',#if self.torrent_player!='1':
|
self.drawItem('< %s >' % self.localize('Magnet-link Player'), 'magentPlayer',
|
||||||
image=self.ROOT + '/icons/magnet.png')
|
image=self.ROOT + '/icons/magnet.png')
|
||||||
if self.debug:
|
if self.debug:
|
||||||
self.drawItem('full_download', 'full_download', image=self.ROOT + '/icons/magnet.png')
|
self.drawItem('full_download', 'full_download', image=self.ROOT + '/icons/magnet.png')
|
||||||
|
@ -1413,7 +1413,7 @@ class Core:
|
||||||
self.Player = TorrentPlayer(userStorageDirectory=self.userStorageDirectory, torrentUrl=torrentUrl, params=params)
|
self.Player = TorrentPlayer(userStorageDirectory=self.userStorageDirectory, torrentUrl=torrentUrl, params=params)
|
||||||
else:
|
else:
|
||||||
log(self.__plugin__ + " Unexpected access to method playTorrent() without torrent content")
|
log(self.__plugin__ + " Unexpected access to method playTorrent() without torrent content")
|
||||||
elif self.torrent_player == '2':
|
elif self.torrent_player == '2' or self.torrent_player == '3':
|
||||||
from Anteoloader import AnteoPlayer
|
from Anteoloader import AnteoPlayer
|
||||||
if 0 != len(torrentUrl):
|
if 0 != len(torrentUrl):
|
||||||
self.Player = AnteoPlayer(userStorageDirectory=self.userStorageDirectory, torrentUrl=torrentUrl, params=params)
|
self.Player = AnteoPlayer(userStorageDirectory=self.userStorageDirectory, torrentUrl=torrentUrl, params=params)
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Torrent():
|
||||||
self.player = 'libtorrent'
|
self.player = 'libtorrent'
|
||||||
elif player == '1':
|
elif player == '1':
|
||||||
self.player = 'acestream'
|
self.player = 'acestream'
|
||||||
elif player == '2':
|
elif player == '2' or player == '3':
|
||||||
self.player = 'anteo'
|
self.player = 'anteo'
|
||||||
|
|
||||||
def play_url_ind(self, ind, label, icon):
|
def play_url_ind(self, ind, label, icon):
|
||||||
|
|
|
@ -138,8 +138,8 @@ class Libtorrent:
|
||||||
try:
|
try:
|
||||||
xbmcvfs.rename(torrentFile, newFile)
|
xbmcvfs.rename(torrentFile, newFile)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print 'Unable to rename torrent file from "' + torrentFile + '" to "' + newFile + '" in Torrent::renameTorrent' + '. Exception: ' + str(
|
log('Unable to rename torrent file from %s to %s in Torrent::renameTorrent. Exception: %s' %
|
||||||
e)
|
(torrentFile, newFile, str(e)))
|
||||||
return
|
return
|
||||||
self.torrentFile = newFile
|
self.torrentFile = newFile
|
||||||
if not self.torrentFileInfo:
|
if not self.torrentFileInfo:
|
||||||
|
@ -436,7 +436,7 @@ class Libtorrent:
|
||||||
else:
|
else:
|
||||||
resume_file=self.resume_data_path()
|
resume_file=self.resume_data_path()
|
||||||
if xbmcvfs.exists(resume_file):
|
if xbmcvfs.exists(resume_file):
|
||||||
log('loading resume data from file'+resume_file)
|
log('loading resume data from file '+resume_file)
|
||||||
try:
|
try:
|
||||||
resumDataFile=xbmcvfs.File(resume_file,'rb')
|
resumDataFile=xbmcvfs.File(resume_file,'rb')
|
||||||
self.save_resume_data=resumDataFile.read()
|
self.save_resume_data=resumDataFile.read()
|
||||||
|
@ -444,7 +444,7 @@ class Libtorrent:
|
||||||
torrent_info['resume_data']=self.save_resume_data
|
torrent_info['resume_data']=self.save_resume_data
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log(' Failed to load resume data from file'+ resume_file)
|
log('Failed to load resume data from file '+ resume_file)
|
||||||
self.torrentHandle = self.session.add_torrent(torrent_info)
|
self.torrentHandle = self.session.add_torrent(torrent_info)
|
||||||
self.torrentHandle.set_sequential_download(True)
|
self.torrentHandle.set_sequential_download(True)
|
||||||
self.torrentHandle.set_max_connections(60)
|
self.torrentHandle.set_max_connections(60)
|
||||||
|
@ -454,7 +454,6 @@ class Libtorrent:
|
||||||
def stopSession(self):
|
def stopSession(self):
|
||||||
for i in range(self.torrentFileInfo.num_pieces()):
|
for i in range(self.torrentFileInfo.num_pieces()):
|
||||||
self.torrentHandle.piece_priority(i, 0)
|
self.torrentHandle.piece_priority(i, 0)
|
||||||
self.resume_data()
|
|
||||||
|
|
||||||
def continueSession(self, contentId=0, Offset=0, seeding=False, isMP4=False):
|
def continueSession(self, contentId=0, Offset=0, seeding=False, isMP4=False):
|
||||||
self.piece_length = self.torrentFileInfo.piece_length()
|
self.piece_length = self.torrentFileInfo.piece_length()
|
||||||
|
@ -462,10 +461,8 @@ class Libtorrent:
|
||||||
if not Offset:
|
if not Offset:
|
||||||
Offset = selectedFileInfo['size'] / (1024 * 1024)
|
Offset = selectedFileInfo['size'] / (1024 * 1024)
|
||||||
self.partOffset = (Offset * 1024 * 1024 / self.piece_length) + 1
|
self.partOffset = (Offset * 1024 * 1024 / self.piece_length) + 1
|
||||||
# print 'partOffset ' + str(self.partOffset)+str(' ')
|
|
||||||
self.startPart = selectedFileInfo['offset'] / self.piece_length
|
self.startPart = selectedFileInfo['offset'] / self.piece_length
|
||||||
self.endPart = int((selectedFileInfo['offset'] + selectedFileInfo['size']) / self.piece_length)
|
self.endPart = int((selectedFileInfo['offset'] + selectedFileInfo['size']) / self.piece_length)
|
||||||
# print 'part ' + str(self.startPart)+ str(' ')+ str(self.endPart)
|
|
||||||
multiplier = self.partOffset / 5
|
multiplier = self.partOffset / 5
|
||||||
log('continueSession: multiplier ' + str(multiplier))
|
log('continueSession: multiplier ' + str(multiplier))
|
||||||
for i in range(self.startPart, self.startPart + self.partOffset):
|
for i in range(self.startPart, self.startPart + self.partOffset):
|
||||||
|
@ -473,13 +470,12 @@ class Libtorrent:
|
||||||
self.torrentHandle.piece_priority(i, 7)
|
self.torrentHandle.piece_priority(i, 7)
|
||||||
if isMP4 and i % multiplier == 0:
|
if isMP4 and i % multiplier == 0:
|
||||||
self.torrentHandle.piece_priority(self.endPart - i / multiplier, 7)
|
self.torrentHandle.piece_priority(self.endPart - i / multiplier, 7)
|
||||||
# print str(i)
|
|
||||||
if multiplier >= i:
|
if multiplier >= i:
|
||||||
self.torrentHandle.piece_priority(self.endPart - i, 7)
|
self.torrentHandle.piece_priority(self.endPart - i, 7)
|
||||||
# print str(i)
|
|
||||||
|
|
||||||
def checkThread(self):
|
def checkThread(self):
|
||||||
if self.threadComplete == True:
|
if self.threadComplete == True:
|
||||||
|
self.resume_data()
|
||||||
log('checkThread KIIIIIIIIIIILLLLLLLLLLLLLLL')
|
log('checkThread KIIIIIIIIIIILLLLLLLLLLLLLLL')
|
||||||
try:
|
try:
|
||||||
self.session.remove_torrent(self.torrentHandle)
|
self.session.remove_torrent(self.torrentHandle)
|
||||||
|
@ -491,6 +487,7 @@ class Libtorrent:
|
||||||
self.session.stop_dht()
|
self.session.stop_dht()
|
||||||
|
|
||||||
def resume_data(self):
|
def resume_data(self):
|
||||||
|
wasPaused=self.session.is_paused()
|
||||||
self.session.pause()
|
self.session.pause()
|
||||||
self.save_resume_data=None
|
self.save_resume_data=None
|
||||||
|
|
||||||
|
@ -504,7 +501,7 @@ class Libtorrent:
|
||||||
return
|
return
|
||||||
|
|
||||||
log('[save_resume_data]: waiting for alert...')
|
log('[save_resume_data]: waiting for alert...')
|
||||||
self.torrentHandle.save_resume_data()
|
self.torrentHandle.save_resume_data(self.lt.save_resume_flags_t.flush_disk_cache)
|
||||||
received=False
|
received=False
|
||||||
while not received:
|
while not received:
|
||||||
self.session.wait_for_alert(1000)
|
self.session.wait_for_alert(1000)
|
||||||
|
@ -528,19 +525,20 @@ class Libtorrent:
|
||||||
log('[save_resume_data]: done.')
|
log('[save_resume_data]: done.')
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
if not wasPaused:
|
||||||
self.session.resume()
|
self.session.resume()
|
||||||
|
|
||||||
def debug(self):
|
def debug(self):
|
||||||
#try:
|
#try:
|
||||||
if 1==1:
|
if 1==1:
|
||||||
# print str(self.getFilePath(0))
|
# log(str(self.getFilePath(0)))
|
||||||
s = self.torrentHandle.status()
|
s = self.torrentHandle.status()
|
||||||
#get_cache_status=self.session.get_cache_status()
|
#get_cache_status=self.session.get_cache_status()
|
||||||
#log('get_cache_status - %s/%s' % (str(get_cache_status.blocks_written), str(get_cache_status.blocks_read)))
|
#log('get_cache_status - %s/%s' % (str(get_cache_status.blocks_written), str(get_cache_status.blocks_read)))
|
||||||
# get_settings=self.torrentHandle.status
|
# get_settings=self.torrentHandle.status
|
||||||
# print s.num_pieces
|
# log(s.num_pieces)
|
||||||
#priorities = self.torrentHandle.piece_priorities()
|
#priorities = self.torrentHandle.piece_priorities()
|
||||||
#print str(priorities)
|
#log(str(priorities))
|
||||||
|
|
||||||
state_str = ['queued', 'checking', 'downloading metadata',
|
state_str = ['queued', 'checking', 'downloading metadata',
|
||||||
'downloading', 'finished', 'seeding', 'allocating', 'checking fastresume']
|
'downloading', 'finished', 'seeding', 'allocating', 'checking fastresume']
|
||||||
|
@ -562,11 +560,11 @@ class Libtorrent:
|
||||||
#i = 0
|
#i = 0
|
||||||
# for t in s.pieces:
|
# for t in s.pieces:
|
||||||
# if t: i=i+1
|
# if t: i=i+1
|
||||||
#print str(self.session.pop_alert())
|
#log(str(self.session.pop_alert())
|
||||||
# print str(s.pieces[self.startPart:self.endPart])
|
# log(str(s.pieces[self.startPart:self.endPart]))
|
||||||
# print 'True pieces: %d' % i
|
# log('True pieces: %d' % i)
|
||||||
# print s.current_tracker
|
# log(s.current_tracker)
|
||||||
# print str(s.pieces)
|
# log(str(s.pieces))
|
||||||
#except:
|
#except:
|
||||||
else:
|
else:
|
||||||
log('debug error')
|
log('debug error')
|
||||||
|
|
|
@ -539,7 +539,7 @@ def localize(text):
|
||||||
'Please, restart Kodi now!':'Теперь перезагрузите Коди, пожалуйста!',
|
'Please, restart Kodi now!':'Теперь перезагрузите Коди, пожалуйста!',
|
||||||
'./ (Root folder)':'./ (Корневой каталог)',
|
'./ (Root folder)':'./ (Корневой каталог)',
|
||||||
'Opening torrent file':'Открытие torrent-файла',
|
'Opening torrent file':'Открытие torrent-файла',
|
||||||
'New player to Torrenter v2 - Torrent2HTTP! It should be faster, stable and better with Android, also seeking works in it.':'В Torrenter новый плеер - Torrent2HTTP! Он стабильнее, быстрее и отлично ладит с Android, в нем работает перемотка.',
|
'New player to Torrenter v2 - pyrrent2http! Advantages of Torrent2HTTP but with python-libtorrent library instead of libtorrent-go!':'В Torrenter новый плеер - pyrrent2http! Преимущества Torrent2HTTP, но на библиотеке python-libtorrent вместо libtorrent-go!',
|
||||||
'Would you like to try it?':'Хотите его попробовать?',
|
'Would you like to try it?':'Хотите его попробовать?',
|
||||||
'Torrent2HTTP enabled! Can be changed in Settings.':'Torrent2HTTP включен! Можно изменить в Настройках.',
|
'Torrent2HTTP enabled! Can be changed in Settings.':'Torrent2HTTP включен! Можно изменить в Настройках.',
|
||||||
'Seeking':'Перемотка',
|
'Seeking':'Перемотка',
|
||||||
|
|
|
@ -259,7 +259,7 @@ class TorrentPlayer(xbmc.Player):
|
||||||
downloadedSize = self.torrent.torrentHandle.file_progress()[self.contentId]
|
downloadedSize = self.torrent.torrentHandle.file_progress()[self.contentId]
|
||||||
status = self.torrent.torrentHandle.status()
|
status = self.torrent.torrentHandle.status()
|
||||||
iterator = int(status.progress * 100)
|
iterator = int(status.progress * 100)
|
||||||
if status.state == 0 or (status.progress == 0 and status.num_pieces > 0):
|
if status.state in [0, 1] or (status.progress == 0 and status.num_pieces > 0):
|
||||||
iterator = int(status.num_pieces * 100 / num_pieces)
|
iterator = int(status.num_pieces * 100 / num_pieces)
|
||||||
if iterator > 99: iterator = 99
|
if iterator > 99: iterator = 99
|
||||||
progressBar.update(iterator, self.localize('Checking preloaded files...'), ' ', ' ')
|
progressBar.update(iterator, self.localize('Checking preloaded files...'), ' ', ' ')
|
||||||
|
@ -286,10 +286,8 @@ class TorrentPlayer(xbmc.Player):
|
||||||
self.torrent.checkThread()
|
self.torrent.checkThread()
|
||||||
return
|
return
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
#self.torrent.torrentHandle.flush_cache()
|
|
||||||
#self.torrent.session.remove_torrent(self.torrent.torrentHandle)
|
|
||||||
self.torrent.resume_data()
|
self.torrent.resume_data()
|
||||||
self.torrent.session.remove_torrent(self.torrent.torrentHandle)
|
#self.torrent.session.remove_torrent(self.torrent.torrentHandle)
|
||||||
progressBar.update(0)
|
progressBar.update(0)
|
||||||
progressBar.close()
|
progressBar.close()
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.torrenter" name="Torrenter" version="2.4.6" provider-name="DiMartino">
|
<addon id="plugin.video.torrenter" name="Torrenter" version="2.5.0" provider-name="DiMartino">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.1.0"/>
|
<import addon="xbmc.python" version="2.1.0"/>
|
||||||
<import addon="script.module.libtorrent"/>
|
<import addon="script.module.libtorrent"/>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
English changelog at http://bit.ly/1MfSVUP
|
English changelog at http://bit.ly/1MfSVUP
|
||||||
|
|
||||||
|
[B]Version 2.5.0[/B]
|
||||||
|
[+] НОВЫЙ проигрыватель pyrrent2http от inpos! Аналог torrent2http написаный на python, а не на GO.
|
||||||
|
[+] Проигрыватель: Ускорена повторная работа с торрентом - resume data (спасибо srg70 и RussakHH)
|
||||||
|
|
||||||
[B]Version 2.4.6[/B]
|
[B]Version 2.4.6[/B]
|
||||||
[+] Проигрыватель: Уменьшена просадка после загрузки буфера (спасибо srg70 и RussakHH)
|
[+] Проигрыватель: Уменьшена просадка после загрузки буфера (спасибо srg70 и RussakHH)
|
||||||
[+] История Просмотров: Добавлено имя раздачи, тонкая настройка добавления по проценту просмотра
|
[+] История Просмотров: Добавлено имя раздачи, тонкая настройка добавления по проценту просмотра
|
||||||
|
|
16
functions.py
16
functions.py
|
@ -1749,15 +1749,15 @@ def first_run_231():
|
||||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher'))
|
xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher'))
|
||||||
|
|
||||||
def first_run_242():
|
def first_run_250():
|
||||||
if __settings__.getSetting('torrent_player')=='2':
|
if __settings__.getSetting('torrent_player')=='3':
|
||||||
__settings__.setSetting('first_run_242','True')
|
__settings__.setSetting('first_run_250','True')
|
||||||
|
|
||||||
if not __settings__.getSetting('first_run_242')=='True':
|
if not __settings__.getSetting('first_run_250')=='True':
|
||||||
__settings__.setSetting('first_run_242','True')
|
__settings__.setSetting('first_run_250','True')
|
||||||
yes=xbmcgui.Dialog().yesno('< %s >' % (Localization.localize('Torrenter Update ') + '2.4.2'),
|
yes=xbmcgui.Dialog().yesno('< %s >' % (Localization.localize('Torrenter Update ') + '2.5.0'),
|
||||||
Localization.localize('New player to Torrenter v2 - Torrent2HTTP! It should be faster, '
|
Localization.localize('New player to Torrenter v2 - pyrrent2http! Advantages of Torrent2HTTP '
|
||||||
'stable and better with Android, also seeking works in it.'),
|
'but with python-libtorrent library instead of libtorrent-go!'),
|
||||||
Localization.localize('Would you like to try it?'),)
|
Localization.localize('Would you like to try it?'),)
|
||||||
if yes:
|
if yes:
|
||||||
__settings__.openSettings()
|
__settings__.openSettings()
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
<string id="30065">Do not add to Watched History if played more (%)</string>
|
<string id="30065">Do not add to Watched History if played more (%)</string>
|
||||||
<string id="30066">Confluence (by safonov_ivan)</string>
|
<string id="30066">Confluence (by safonov_ivan)</string>
|
||||||
<string id="30067">Aeon Nox (by joyrider)</string>
|
<string id="30067">Aeon Nox (by joyrider)</string>
|
||||||
|
<string id="30068">pyrrent2http (python-libtorrent via http)</string>
|
||||||
<string id="30101">Interface</string>
|
<string id="30101">Interface</string>
|
||||||
<string id="30102">P2P Network</string>
|
<string id="30102">P2P Network</string>
|
||||||
<string id="30103">Advanced</string>
|
<string id="30103">Advanced</string>
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
<string id="30065">Не добавлять в История Просмотров если больше (%)</string>
|
<string id="30065">Не добавлять в История Просмотров если больше (%)</string>
|
||||||
<string id="30066">Confluence (от safonov_ivan)</string>
|
<string id="30066">Confluence (от safonov_ivan)</string>
|
||||||
<string id="30067">Aeon Nox (от joyrider)</string>
|
<string id="30067">Aeon Nox (от joyrider)</string>
|
||||||
|
<string id="30068">pyrrent2http (python-libtorrent по http)</string>
|
||||||
<string id="30101">Интерфейс</string>
|
<string id="30101">Интерфейс</string>
|
||||||
<string id="30102">P2P Сеть</string>
|
<string id="30102">P2P Сеть</string>
|
||||||
<string id="30103">Дополнительные</string>
|
<string id="30103">Дополнительные</string>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<setting id="debug" type="bool" label="30015" default="false"/>
|
<setting id="debug" type="bool" label="30015" default="false"/>
|
||||||
</category>
|
</category>
|
||||||
<category label="30102">
|
<category label="30102">
|
||||||
<setting id="torrent_player" type="enum" label="30023" default="2" lvalues="30021|30022|30046" />
|
<setting id="torrent_player" type="enum" label="30023" default="2" lvalues="30021|30022|30046|30068" />
|
||||||
<setting id="storage" type="folder" label="30004" default=""/>
|
<setting id="storage" type="folder" label="30004" default=""/>
|
||||||
<setting id="keep_files" type="enum" label="30008" default="1" lvalues="30043|30044|30045"/>
|
<setting id="keep_files" type="enum" label="30008" default="1" lvalues="30043|30044|30045"/>
|
||||||
<setting id="next_dl" type="bool" label="30013" default="true" visible="!eq(-3,1)"/>
|
<setting id="next_dl" type="bool" label="30013" default="true" visible="!eq(-3,1)"/>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
<setting id="torrent_qbittorrent_password" type="text" label="50316" visible="eq(-21,4)" default="admin" option="hidden"/>
|
<setting id="torrent_qbittorrent_password" type="text" label="50316" visible="eq(-21,4)" default="admin" option="hidden"/>
|
||||||
</category>
|
</category>
|
||||||
<category label="30105">
|
<category label="30105">
|
||||||
<setting id="torrent_player" type="enum" label="30023" default="2" lvalues="30021|30022|30046" />
|
<setting id="torrent_player" type="enum" label="30023" default="2" lvalues="30021|30022|30046|30068" />
|
||||||
<setting id="ask_dir" type="bool" label="30031" default="false"/>
|
<setting id="ask_dir" type="bool" label="30031" default="false"/>
|
||||||
<setting id="connections_limit" type="number" label="30051" default="200" visible=" eq(-2,2)"/>
|
<setting id="connections_limit" type="number" label="30051" default="200" visible=" eq(-2,2)"/>
|
||||||
<setting id="use_random_port" type="bool" label="30052" default="false" visible=" eq(-3,2)"/>
|
<setting id="use_random_port" type="bool" label="30052" default="false" visible=" eq(-3,2)"/>
|
||||||
|
|
Loading…
Reference in New Issue