From 131d43750470077732d133d40d1897c203aec18f Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Wed, 8 Aug 2018 12:53:21 +0300 Subject: [PATCH 1/6] 2.6.6 --- .idea/workspace.xml | 158 ++++--------------------- Core.py | 8 +- resources/language/spanish/strings.xml | 14 +-- 3 files changed, 28 insertions(+), 152 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dd8ecf9..54adac5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1032,7 +1032,6 @@ @@ -1089,55 +1088,7 @@ - - - - - - - + - + + - - - - - - - - - - - + + - - diff --git a/Core.py b/Core.py index 39a8067..82302d1 100644 --- a/Core.py +++ b/Core.py @@ -556,11 +556,9 @@ class Core: if action2 == 'open': filename, foldername, path, url, seek, length, ind = db.get('filename, foldername, path, url, seek, length, ind', 'addtime', str(addtime)) - if os.path.exists(path) and os.path.getsize(path) > 0: + if os.path.exists(path): self.__settings__.setSetting("lastTorrent", path) else: - if os.path.exists(path): - os.unlink(path) torrent = Downloader.Torrent(self.userStorageDirectory, torrentFilesDirectory=self.torrentFilesDirectory) path = torrent.saveTorrent(url) self.__settings__.setSetting("lastTorrent", path) @@ -576,11 +574,9 @@ class Core: seek = int(seek) else: seek = 0 - if os.path.exists(path) and os.path.getsize(path) > 0: + if os.path.exists(path): self.__settings__.setSetting("lastTorrent", path) else: - if os.path.exists(path): - os.unlink(path) torrent = Downloader.Torrent(self.userStorageDirectory, torrentFilesDirectory=self.torrentFilesDirectory) self.__settings__.setSetting("lastTorrent", torrent.saveTorrent(url)) xbmc.executebuiltin('xbmc.RunPlugin("plugin://plugin.video.torrenter/?action=playTorrent&url='+str(ind)+'&seek='+str(seek)+'")') diff --git a/resources/language/spanish/strings.xml b/resources/language/spanish/strings.xml index 19ca48d..1eeb97e 100644 --- a/resources/language/spanish/strings.xml +++ b/resources/language/spanish/strings.xml @@ -17,7 +17,7 @@ Transperency (de slng) Confluence (de DiMartino) Confluence (de RussakHH) - Habilitar historial de búsquedas + Habilitar el historial de búsquedas python-libtorrent Ace Stream Reproductor P2P @@ -44,11 +44,9 @@ Guardar archivos Preguntar para guardar Torrent2HTTP (libtorrent vía HTTP) - Proxy para búsquedas - Proxy para listas de contenido - Dirección IP de proxy SOCKS + Proxy Ninguno - Anti-zapret (antirrestricción) + Anti-zapret (antirestricción) Tor Inmunidad Núm. máx. de conexiones (0 = ilimitadas) @@ -60,12 +58,12 @@ Promedio/Buen PC Por debajo de la media, PC/router Tamaño mínimo de almacenaje para autoborrado (GB) - Diferir inicio de reproductor + Diferir inicio del reproductor Ordenar resultados de la búsqueda Por fuentes No ordenar Por nombre - Añadir a historial de vistos después del (%) + Añadir al historial de vistos después del (%) Confluence (de safonov_ivan) Aeon Nox (de joyrider) pyrrent2http (python-libtorrent vía HTTP) @@ -101,7 +99,7 @@ Contraseña Cliente de BitTorrent URL (no SSL) - Sustitución de ruta (solo remoto) + Sustitución de ruta (Solo remoto) Cerrar Abrir "Ajustes" Navegador de cliente BitTorrent From 2d071d09d3a3f451cdefeedcaed86f7a2789ab10 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Wed, 8 Aug 2018 12:58:10 +0300 Subject: [PATCH 2/6] 2.6.6 --- .idea/workspace.xml | 2096 ++++++------------------------------------- 1 file changed, 293 insertions(+), 1803 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 54adac5..be3d6ec 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,20 +1,8 @@ - - - - - - - - - - - - - - + + @@ -26,7 +14,6 @@ - + - - - - - - - - - - - + + - - - - - - - - - - - @@ -1088,6 +397,18 @@ + + + @@ -1505,28 +826,27 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -1560,7 +880,6 @@ - - - - + + @@ -1604,14 +918,14 @@ - + - + @@ -1625,22 +939,20 @@ - - - + - + - + @@ -1650,7 +962,7 @@ - + @@ -1664,7 +976,7 @@ - + @@ -1672,7 +984,7 @@ - + @@ -1686,7 +998,7 @@ - + @@ -1697,14 +1009,7 @@ - - - - - - - - + @@ -1715,28 +1020,28 @@ - + - + - + - + @@ -1749,9 +1054,7 @@ - - - + @@ -1770,9 +1073,7 @@ - - - + @@ -1784,486 +1085,25 @@ - - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2271,292 +1111,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + @@ -2565,227 +1133,149 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + From 21248ecbb4824b792b9ad8e6b66d6c4460aa9655 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Wed, 8 Aug 2018 13:59:56 +0300 Subject: [PATCH 3/6] add socks port --- Anteoloader.py | 6 ++++++ Content.py | 3 ++- Inposloader.py | 6 ++++++ SearcherABC.py | 3 ++- SkorbaLoader.py | 2 +- addon.xml | 2 +- changelog.txt | 5 ++++- resources/language/English/strings.xml | 1 + resources/language/Russian/strings.xml | 1 + resources/settings.xml | 3 ++- 10 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Anteoloader.py b/Anteoloader.py index 6b50e07..87eb9cb 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -285,6 +285,12 @@ class AnteoPlayer(xbmc.Player): def __init__(self, userStorageDirectory, torrentUrl, params={}): self.userStorageDirectory = userStorageDirectory self.torrentUrl = torrentUrl + if not is_writable(self.userStorageDirectory): + xbmcgui.Dialog().ok(Localization.localize('Torrenter v2'), + Localization.localize('Your storage path is not writable or not local! Please change it in settings!'), + self.storageDirectory) + + sys.exit(1) xbmc.Player.__init__(self) log("["+author+"Player] Initalized v"+__version__) self.params = params diff --git a/Content.py b/Content.py index 42f5ffb..0b01299 100644 --- a/Content.py +++ b/Content.py @@ -25,7 +25,8 @@ if proxy == 1: socks_ip = sys.modules["__main__"].__settings__.getSetting("socks_ip") import socket from resources import socks - socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, socks_ip, 9050) + socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, socks_ip, + int(sys.modules["__main__"].__settings__.getSetting("socks_port"))) socket.socket = socks.socksocket import urllib import urllib2 diff --git a/Inposloader.py b/Inposloader.py index 89b86dd..7387436 100644 --- a/Inposloader.py +++ b/Inposloader.py @@ -253,6 +253,12 @@ class InposPlayer(xbmc.Player): def __init__(self, userStorageDirectory, torrentUrl, params={}): self.userStorageDirectory = userStorageDirectory self.torrentUrl = torrentUrl + if not is_writable(self.userStorageDirectory): + xbmcgui.Dialog().ok(Localization.localize('Torrenter v2'), + Localization.localize('Your storage path is not writable or not local! Please change it in settings!'), + self.storageDirectory) + + sys.exit(1) xbmc.Player.__init__(self) log("["+author+"Player] Initalized v"+__version__) self.params = params diff --git a/SearcherABC.py b/SearcherABC.py index fbf95bf..ba55425 100644 --- a/SearcherABC.py +++ b/SearcherABC.py @@ -31,7 +31,8 @@ proxy = int(sys.modules["__main__"].__settings__.getSetting("proxy")) if proxy == 2: socks_ip = sys.modules["__main__"].__settings__.getSetting("socks_ip") from resources import socks - socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, socks_ip, 9050) + socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, socks_ip, + int(sys.modules["__main__"].__settings__.getSetting("socks_port"))) socket.socket = socks.socksocket import urllib import urllib2 diff --git a/SkorbaLoader.py b/SkorbaLoader.py index cd316db..c0995e8 100644 --- a/SkorbaLoader.py +++ b/SkorbaLoader.py @@ -243,7 +243,7 @@ class SkorbaLoader: return self.getContentList()[contentId]['size'] def getFilePath(self, contentId=0): - return os.path.join(self.storageDirectory, self.getContentList()[contentId]['title']) # .decode('utf8') + return os.path.join(self.storageDirectory, decode_str(self.getContentList()[contentId]['title'])) def getContentList(self): filelist = [] diff --git a/addon.xml b/addon.xml index 9980c8e..60f59c2 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/changelog.txt b/changelog.txt index 6d81d34..556fe84 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ -[B]Version 2.6.6[/B] +[B]Version 2.6.7[/B] +[+] Теперь можно указать порт SOCKS-прокси, при использоании прокси Tor + +[B]Version 2.6.6[/B] [+] Добавлена поддержка прокси для windows [+] Теперь можно указать адрес SOCKS-прокси, при использоании прокси Tor diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index b2ea4f8..c6fbd15 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -47,6 +47,7 @@ Proxy for Search Proxy for Content Lists SOCKS-proxy IP + SOCKS-proxy Port None Anti-zapret Tor diff --git a/resources/language/Russian/strings.xml b/resources/language/Russian/strings.xml index b612cf3..dc4057a 100644 --- a/resources/language/Russian/strings.xml +++ b/resources/language/Russian/strings.xml @@ -47,6 +47,7 @@ Прокси для поиска Прокси для списков медиа IP SOCKS-прокси + Порт SOCKS-прокси Не использовать Anti-zapret Tor diff --git a/resources/settings.xml b/resources/settings.xml index 46f30b2..cc65347 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -13,8 +13,9 @@ - + + From 1c106b15baccd7afc64fec33117b4c622625993b Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Wed, 8 Aug 2018 15:20:50 +0300 Subject: [PATCH 4/6] .torrent and AM --- .idea/workspace.xml | 1668 ++++++++++++++++++++++++++---- Core.py | 4 +- changelog.txt | 2 + resources/contenters/RiperAM.py | 2 +- resources/contenters/RuTorOrg.py | 2 +- 5 files changed, 1461 insertions(+), 217 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index be3d6ec..0415f4e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,8 +1,12 @@ - + + + + + @@ -27,18 +31,38 @@ + + - + - + + + - + + + + + + + + + + + + + + + + + @@ -47,7 +71,7 @@ - + @@ -74,11 +98,11 @@ - + - - + + @@ -87,11 +111,71 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -99,8 +183,8 @@ - - + + @@ -148,10 +232,111 @@ - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -161,33 +346,469 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -195,8 +816,8 @@ - - + + @@ -207,17 +828,8 @@ - - - - - - - - - - - + + @@ -234,8 +846,8 @@ - - + + @@ -253,11 +865,6 @@ - navi_save - last_link - self.last_right_button - self.last_top_button - navi_restore traceback self.filesList self.navi_back @@ -273,7 +880,6 @@ __main__ url_after log( - debug torrentPlayer json onPlayBackStopped @@ -283,6 +889,12 @@ setSetting ettings__.setSetting('loadsw_onstop' self.close + cl_proxy + 32048 + 9050 + debug + forums + self.d pyxbmct.Button( @@ -309,10 +921,6 @@ @@ -374,8 +986,29 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -1128,13 +1151,6 @@ @@ -1487,7 +1510,7 @@ - + @@ -1497,7 +1520,7 @@ - + @@ -1540,7 +1563,6 @@ - - - - - @@ -1760,6 +1778,23 @@ + + + + + + + + + + + + + + + + + @@ -1770,27 +1805,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1894,6 +1908,20 @@ + + + + + + + + + + + + + + @@ -1915,51 +1943,20 @@ - - - - + - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1984,7 +1981,6 @@ - @@ -1999,7 +1995,6 @@ - @@ -2067,17 +2062,17 @@ - + - - + + - - + + @@ -2319,8 +2314,6 @@ - - @@ -2394,128 +2387,165 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Anteoloader.py b/Anteoloader.py index 87eb9cb..74bc784 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -133,7 +133,7 @@ class AnteoLoader: keep_incomplete = True dht_routers = ["router.bittorrent.com:6881", "router.utorrent.com:6881"] - user_agent = 'uTorrent/2200(24683)' + user_agent = '' self.engine = Engine(uri=file_url(localize_path(self.torrentFile)), download_path=self.storageDirectory, connections_limit=connections_limit, encryption=encryption, keep_complete=keep_complete, keep_incomplete=keep_incomplete, @@ -386,7 +386,7 @@ class AnteoPlayer(xbmc.Player): enable_dht = self.__settings__.getSetting("enable_dht") == 'true' dht_routers = ["router.bittorrent.com:6881","router.utorrent.com:6881"] - user_agent = 'uTorrent/2200(24683)' + user_agent = '' self.pre_buffer_bytes = int(self.__settings__.getSetting("pre_buffer_bytes"))*1024*1024 self.engine = Engine(uri=file_url(self.torrentUrl), download_path=self.userStorageDirectory, diff --git a/Content.py b/Content.py index 0b01299..f52ba68 100644 --- a/Content.py +++ b/Content.py @@ -24,7 +24,7 @@ proxy = int(sys.modules["__main__"].__settings__.getSetting("cl_proxy")) if proxy == 1: socks_ip = sys.modules["__main__"].__settings__.getSetting("socks_ip") import socket - from resources import socks + from resources.proxy import socks socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, socks_ip, int(sys.modules["__main__"].__settings__.getSetting("socks_port"))) socket.socket = socks.socksocket diff --git a/Core.py b/Core.py index 7cf0500..ab5f3cb 100644 --- a/Core.py +++ b/Core.py @@ -1085,28 +1085,6 @@ class Core: self.drawItem(title, 'downloadLibtorrent', link, image=img, info=info, contextMenu=contextMenu, replaceMenu=False) #self.drawItem(title, 'openTorrent', link, img, info=info, contextMenu=contextMenu, replaceMenu=False) - def ActionInfo(self, params={}): - from resources.skins.DialogXml import DialogXml - get = params.get - contenter=get('provider') - infolink=get('url') - link=get('link') - if ROOT + os.sep + 'resources' + os.sep + 'contenters' not in sys.path: - sys.path.insert(0, ROOT + os.sep + 'resources' + os.sep + 'contenters') - try: - self.Content = getattr(__import__(contenter), contenter)() - except Exception, e: - log('Unable to use contenter: ' + contenter + ' at ' + ' ActionInfo(). Exception: ' + str(e)) - - movieInfo=self.Content.get_info(infolink) - if movieInfo: - w = DialogXml("movieinfo.xml", ROOT, "Default") - w.doModal(movieInfo, link) - del w - del movieInfo - else: - showMessage(self.localize('Information'),self.localize('Information not found!')) - def searchOption(self, params={}): try: apps = json.loads(urllib.unquote_plus(params.get("url"))) diff --git a/Inposloader.py b/Inposloader.py index 7387436..2017251 100644 --- a/Inposloader.py +++ b/Inposloader.py @@ -140,7 +140,7 @@ class InposLoader: enable_dht = self.__settings__.getSetting("enable_dht") == 'true' dht_routers = ["router.bittorrent.com:6881", "router.utorrent.com:6881"] - user_agent = 'uTorrent/2200(24683)' + user_agent = '' self.engine = Engine(uri=file_url(self.torrentFile), download_path=self.storageDirectory, connections_limit=connections_limit, encryption=encryption, keep_complete=keep_complete, keep_incomplete=keep_incomplete, @@ -375,7 +375,7 @@ class InposPlayer(xbmc.Player): resume_file=os.path.join(self.userStorageDirectory, 'torrents', os.path.basename(self.torrentUrl)+'.resume_data') dht_routers = ["router.bittorrent.com:6881","router.utorrent.com:6881"] - user_agent = 'uTorrent/2200(24683)' + user_agent = '' self.pre_buffer_bytes = int(self.__settings__.getSetting("pre_buffer_bytes"))*1024*1024 if self.__settings__.getSetting('debug') == 'true': showMessage('[%sPlayer v%s] ' % (author, __version__), self.localize('Please Wait')) diff --git a/Player.py b/Player.py index 78909ba..ef9a94b 100644 --- a/Player.py +++ b/Player.py @@ -30,7 +30,7 @@ import Downloader import xbmcgui import xbmcvfs import Localization -from functions import calculate, showMessage, clearStorage, WatchedHistoryDB, DownloadDB, get_ids_video, log, debug, foldername, ensure_str, loadsw_onstop +from functions import calculate, showMessage, clearStorage, WatchedHistoryDB, DownloadDB, get_ids_video, log, debug, foldername, ensure_str, loadsw_onstop, decode_str ROOT = sys.modules["__main__"].__root__ RESOURCES_PATH = os.path.join(ROOT, 'resources') @@ -388,10 +388,11 @@ class TorrentPlayer(xbmc.Player): addition = os.path.dirname(title).lstrip(folder + os.sep).replace(os.sep, '.').replace(' ', '_').strip() ext = temp.split('.')[-1] temp = temp[:len(temp) - len(ext) - 1] + '.' + addition + '.' + ext - newFileName = os.path.join(os.path.dirname(path), temp) - debug('[setup_subs]: '+str((os.path.join(os.path.dirname(os.path.dirname(path)),title),newFileName))) + newFileName = os.path.join(ensure_str(os.path.dirname(decode_str(path))), ensure_str(temp)) + debug('[setup_subs]: {} {}'.format(newFileName, title)) if not xbmcvfs.exists(newFileName): - xbmcvfs.copy(os.path.join(os.path.dirname(os.path.dirname(path)), title), newFileName) + fileName = os.path.join(ensure_str(os.path.dirname(os.path.dirname(decode_str(path)))), ensure_str(title)) + xbmcvfs.copy(fileName, newFileName) def onPlayBackStarted(self): for f in self.on_playback_started: diff --git a/SearcherABC.py b/SearcherABC.py index ba55425..6a7bbc4 100644 --- a/SearcherABC.py +++ b/SearcherABC.py @@ -30,7 +30,7 @@ import sys proxy = int(sys.modules["__main__"].__settings__.getSetting("proxy")) if proxy == 2: socks_ip = sys.modules["__main__"].__settings__.getSetting("socks_ip") - from resources import socks + from resources.proxy import socks socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, socks_ip, int(sys.modules["__main__"].__settings__.getSetting("socks_port"))) socket.socket = socks.socksocket diff --git a/SkorbaLoader.py b/SkorbaLoader.py index c0995e8..7d5d105 100644 --- a/SkorbaLoader.py +++ b/SkorbaLoader.py @@ -381,7 +381,7 @@ class SkorbaLoader: session_settings['rate_limit_ip_overhead'] = True session_settings['request_timeout'] = 1 session_settings['torrent_connect_boost'] = 50 - session_settings['user_agent'] = 'uTorrent/2200(24683)' + session_settings['user_agent'] = '' if pc_config == 0: #good pc session_settings['connections_limit'] = 200 @@ -412,7 +412,7 @@ class SkorbaLoader: session_settings.rate_limit_ip_overhead = True session_settings.request_timeout = 1 session_settings.torrent_connect_boost = 100 - session_settings.user_agent = 'uTorrent/2200(24683)' + session_settings.user_agent = '' # self.session.set_settings(session_settings) diff --git a/changelog.txt b/changelog.txt index cc55f5e..6c3bf79 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ [+] Теперь можно указать порт SOCKS-прокси, при использоании прокси Tor [+] Списки медиа: исправлен RiperAM [+] .torrent Player: Исправлена работа c длинными названиями +[-] Удален user-agent "uTorrent/2200(24683)" во избежании бана [B]Version 2.6.6[/B] [+] Добавлена поддержка прокси для windows diff --git a/resources/socks.py b/resources/proxy/socks.py similarity index 99% rename from resources/socks.py rename to resources/proxy/socks.py index 0694f56..c21eceb 100644 --- a/resources/socks.py +++ b/resources/proxy/socks.py @@ -67,7 +67,7 @@ from base64 import b64encode if os.name == "nt" and sys.version_info < (3, 0): try: - from resources import win_inet_pton + from resources.proxy import win_inet_pton except ImportError: raise ImportError("To run PySocks on Windows you must install win_inet_pton") diff --git a/resources/win_inet_pton.py b/resources/proxy/win_inet_pton.py old mode 100755 new mode 100644 similarity index 100% rename from resources/win_inet_pton.py rename to resources/proxy/win_inet_pton.py diff --git a/searchwindow.py b/searchwindow.py index e6403fd..0db5619 100644 --- a/searchwindow.py +++ b/searchwindow.py @@ -1270,8 +1270,6 @@ class InfoWindow(pyxbmct.AddonDialogWindow): # self.set_navigation() def set_controls(self): - # pyxbmct.AddonWindow().setImage(__root__ + '/resources/skins/Default/media/ConfluenceDialogBack.png') - # self.placeControl(self.background, 0, 0, rowspan=3, columnspan=2) self.listing = pyxbmct.List(_imageWidth=30, _imageHeight=30, _itemTextXOffset=1, _itemTextYOffset=0, _itemHeight=30, _space=0, _alignmentY=0) self.placeControl(self.listing, 0, 1, 2, 2) From 1858e2d0de836ad38ab6013ca6b02600f6879b17 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Wed, 8 Aug 2018 22:40:39 +0300 Subject: [PATCH 6/6] fixed pause overlay --- .idea/workspace.xml | 1541 +++++++----------------------------- Anteoloader.py | 10 +- Core.py | 14 +- resources/images/black.png | Bin 95 -> 120 bytes 4 files changed, 325 insertions(+), 1240 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f36a5e2..7df0bc6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,21 +1,11 @@ - - - + - - - - - - - - - + @@ -40,23 +30,25 @@ - + - + + + - - + + - - + + @@ -98,8 +90,8 @@ - - + + @@ -107,11 +99,11 @@ - + - - + + @@ -124,58 +116,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -189,50 +130,110 @@ - + - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -241,8 +242,8 @@ - - + + @@ -251,99 +252,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -353,11 +263,11 @@ - + - - + + @@ -423,375 +333,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -827,7 +369,7 @@ - + @@ -836,27 +378,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -888,9 +409,6 @@ - route - if self.listing.size(): - navi_route rutor- __main__ url_after @@ -918,6 +436,9 @@ socks import socks win_inet_pton + OverlayText + XBFONT_CENTER_X + alignment pyxbmct.Button( @@ -982,7 +503,6 @@ @@ -1151,13 +672,6 @@ @@ -1514,13 +1035,13 @@ - + - + @@ -1563,7 +1084,6 @@ @@ -1736,13 +1257,7 @@ - - - - - - - + @@ -1795,6 +1310,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -1805,55 +1341,34 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -1861,53 +1376,31 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -1922,10 +1415,13 @@ - + - - + + + + + @@ -1943,136 +1439,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -2138,413 +1508,114 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Anteoloader.py b/Anteoloader.py index 74bc784..dd94c6c 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -668,7 +668,8 @@ class OverlayText(object): self._shown = False self._text = "" self._label = xbmcgui.ControlLabel(x, y, w, h, self._text, *args, **kwargs) - self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(RESOURCES_PATH, "images", "black.png")) + filename = os.path.join(RESOURCES_PATH, "images", "black.png") + self._background = xbmcgui.ControlImage(x, y, w, h, filename) self._background.setColorDiffuse("0xD0000000") def show(self): @@ -702,5 +703,10 @@ class OverlayText(object): skin_path = xbmc.translatePath("special://skin/") tree = ET.parse(os.path.join(skin_path, "addon.xml")) - res = tree.findall("./extension/res")[0] + res = None + for element in tree.findall("./extension/res"): + if element.attrib["default"] == 'true': + res = element + break + if res is None: res = tree.findall("./extension/res")[0] return int(res.attrib["width"]), int(res.attrib["height"]) \ No newline at end of file diff --git a/Core.py b/Core.py index ab5f3cb..1177af4 100644 --- a/Core.py +++ b/Core.py @@ -297,9 +297,17 @@ class Core: def test(self, params={}): pass - import searchwindow - params = {'mode': 'file_browser', 'path':'D:\\', 'tdir':'D:\\FRAPS\\'} - searchwindow.main(params) + xbmc.Player().play('D:\\filmz\\The Missing (2014).mp4') + from Anteoloader import OverlayText, OVERLAY_WIDTH, OVERLAY_HEIGHT, XBFONT_CENTER_X,XBFONT_CENTER_Y + overlay = OverlayText(w=OVERLAY_WIDTH, h=OVERLAY_HEIGHT, + alignment=XBFONT_CENTER_X | XBFONT_CENTER_Y) + overlay.show() + overlay.text = 'XXXXXXXXXXXXXXXXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXXXXXXXXXXXXXXXXXX\r\n' \ + 'YYyyyYyYYyYyY' + time.sleep(5) + overlay.hide() + time.sleep(1) + xbmc.Player().stop() def swHistory(self, params={}): import searchwindow diff --git a/resources/images/black.png b/resources/images/black.png index 1914264c08781d1f30ee0b8482bccf44586f2dc1..7a07a124ea6342ad2e72d765e3cbf06ac65df208 100644 GIT binary patch delta 101 zcma#Am>`kB!N$PAATN5P6G$-@2e~^jtUD+363Agmcl32+VA$Bt{U?zX$mcBZh%9Dc w;5!1sj8nDwq=ACGo-U3d65+`S2?;;=85mg@8446qxq%W4p00i_>zopr0JUTnVE_OC delta 76 zcmb=3pCIAR$jrdNpn5y(6p&&L@Ck7R(#xxCZviRBk|4ie28U-i(tsQ;PZ!4!j_b(@ YKsFNt<0HjA#y}Q>r>mdKI;Vst0K{4n+yDRo