cosmetics

pull/2/head
DiMartinoXBMC 2016-03-12 13:02:03 +03:00
parent acce52d081
commit 89d23556bb
2 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,7 @@ import zlib
import xbmc import xbmc
import xbmcgui import xbmcgui
import xbmcvfs import xbmcvfs
import xbmcaddon
import Localization import Localization
from functions import file_encode, isSubtitle, DownloadDB, log, debug, is_writable, unquote, file_url from functions import file_encode, isSubtitle, DownloadDB, log, debug, is_writable, unquote, file_url
@ -42,9 +43,13 @@ from functions import foldername, showMessage, clearStorage, WatchedHistoryDB, g
if sys.modules["__main__"].__settings__.getSetting("torrent_player") == '2': if sys.modules["__main__"].__settings__.getSetting("torrent_player") == '2':
from torrent2http import State, Engine, MediaType from torrent2http import State, Engine, MediaType
author = 'Anteo' author = 'Anteo'
__settings__ = xbmcaddon.Addon(id='script.module.torrent2http')
__version__ = __settings__.getAddonInfo('version')
elif sys.modules["__main__"].__settings__.getSetting("torrent_player") == '3': elif sys.modules["__main__"].__settings__.getSetting("torrent_player") == '3':
from pyrrent2http import State, Engine, MediaType from pyrrent2http import State, Engine, MediaType
author = 'Inpos' author = 'Inpos'
__settings__ = xbmcaddon.Addon(id='script.module.pyrrent2http')
__version__ = __settings__.getAddonInfo('version')
ROOT = sys.modules["__main__"].__root__ ROOT = sys.modules["__main__"].__root__
RESOURCES_PATH = os.path.join(ROOT, 'resources') RESOURCES_PATH = os.path.join(ROOT, 'resources')
@ -276,7 +281,7 @@ class AnteoPlayer(xbmc.Player):
self.userStorageDirectory = userStorageDirectory self.userStorageDirectory = userStorageDirectory
self.torrentUrl = torrentUrl self.torrentUrl = torrentUrl
xbmc.Player.__init__(self) xbmc.Player.__init__(self)
log("[AnteoPlayer] Initalized") log("["+author+"Player] Initalized v"+__version__)
self.params = params self.params = params
self.get = self.params.get self.get = self.params.get
self.contentId = int(self.get("url")) self.contentId = int(self.get("url"))
@ -395,7 +400,7 @@ class AnteoPlayer(xbmc.Player):
#self.pre_buffer_bytes = 30*1024*1024 #30 MB #self.pre_buffer_bytes = 30*1024*1024 #30 MB
ready = False ready = False
progressBar = xbmcgui.DialogProgress() progressBar = xbmcgui.DialogProgress()
progressBar.create(self.localize('Please Wait'), progressBar.create('[%sPlayer v%s] ' % (author, __version__) + self.localize('Please Wait'),
self.localize('Seeds searching.')) self.localize('Seeds searching.'))
#if self.subs_dl: #if self.subs_dl:
# subs = self.torrent.getSubsIds(os.path.basename(self.torrent.getFilePath(self.contentId))) # subs = self.torrent.getSubsIds(os.path.basename(self.torrent.getFilePath(self.contentId)))
@ -541,7 +546,7 @@ class AnteoPlayer(xbmc.Player):
if isSubtitle(filename, i.name): if isSubtitle(filename, i.name):
subs.append(i) subs.append(i)
if subs: if subs:
log("[AnteoPlayer][setup_subs]: Detected subtitles: %s" % str(subs)) log("["+author+"Player][setup_subs]: Detected subtitles: %s" % str(subs))
for sub in subs: for sub in subs:
xbmc.Player().setSubtitles(sub.url) xbmc.Player().setSubtitles(sub.url)

View File

@ -244,7 +244,7 @@ class TorrentPlayer(xbmc.Player):
def buffer(self): def buffer(self):
iterator = 0 iterator = 0
progressBar = xbmcgui.DialogProgress() progressBar = xbmcgui.DialogProgress()
progressBar.create(self.localize('Please Wait') + str(' [%s]' % str(self.torrent.lt.version)), progressBar.create('[python-libtorrent %s] - ' % str(self.torrent.lt.version) + self.localize('Please Wait'),
self.localize('Seeds searching.')) self.localize('Seeds searching.'))
if self.subs_dl: if self.subs_dl:
subs = self.torrent.getSubsIds(os.path.basename(self.path)) subs = self.torrent.getSubsIds(os.path.basename(self.path))