From e7eef312033f99ee18ff53f093e3fb3718103ac1 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sun, 12 Jul 2015 16:14:12 +0300 Subject: [PATCH] 2.3.1 --- Core.py | 4 ++++ Localization.py | 6 ++++++ README.txt | 40 +++++++++------------------------------- SearcherABC.py | 10 ++++++++++ addon.xml | 2 +- functions.py | 22 +++++++++++++++++----- 6 files changed, 47 insertions(+), 37 deletions(-) diff --git a/Core.py b/Core.py index 48bcbb3..6131bca 100644 --- a/Core.py +++ b/Core.py @@ -1727,6 +1727,10 @@ class Core: return title def search(self, params={}): + if len(Searchers().get_active())<1: + noActiveSerachers() + return + defaultKeyword = params.get('url') showKey=params.get('showKey') diff --git a/Localization.py b/Localization.py index 12ca2d1..242b19f 100644 --- a/Localization.py +++ b/Localization.py @@ -257,6 +257,12 @@ def localize(text): 'Android Support':'Поддержка Android', 'Android has no temprorary folder':'У Android отсутствует стандартная временная папка', 'Please specify storage folder in Settings!':'Пожалуйста, укажите папку хранилища файлов!', + 'You have no installed or active searchers! More info in Search Control Window!':'У вас нет установленных или активных серчеров. Подробнее в Окне Управления Поиском.', + 'Please contact DiMartino on kodi.tv forum. We compiled python-libtorrent for Android,':'Свяжитесь с DiMartino на xbmc.ru. Мы собрали python-libtorrent на Android', + 'but we need your help with some tests on different processors.':'но нам нужна помощь в тестировании на разные процессоры.', + 'We added Android ARM full support to Torrenter v2!':'Мы добавили полную поддержку Android ARM в Torrenter v2!', + 'I deleted pre-installed ones, install them in Search Control Window!':'Теперь серчеры нужно устанавливать отдельно в Окне Управления Поиском!' + }, 'uk': { 'Seeds searching.': 'Йде пошук сідів.', diff --git a/README.txt b/README.txt index db588b0..de377ee 100644 --- a/README.txt +++ b/README.txt @@ -7,12 +7,16 @@ Plugin requires python binding --- INSTALLATION --- -1. Windows +1. Windows, Linux x86, OS X, Android ARM No installation required, will be downloaded with plugin from repository as module. -2. Linux -2.1 Run at console 'sudo apt-get install python-libtorrent' -2.2 Install addon and enjoy +2. OpenELEC +Use this build (or patch) +http://openelec.tv/forum/128-addons/75885-openelec-with-support-acestream-libtorrent + +3. Linux x86_64 +3.1 Run at console 'sudo apt-get install python-libtorrent' +3.2 Install addon and enjoy or you could compile it: @@ -24,30 +28,4 @@ cd lt/ ./configure --enable-python-binding make sudo make install -sudo ldconfig - -________________________________________________________________________________________________________ - -Вебсайт библиотеки http://www.rasterbar.com/products/libtorrent/ -Для работы плагина нужен её билд под python - ---- ИНСТАЛЯЦИЯ --- - -1. Windows -Все установится автоматически из репозитория - -2. Linux -2.1 Выполняем в терминале sudo apt-get install python-libtorrent -2.2 Устанавливаем аддон в XBMC и пользуемся - -или компилируем: - -sudo apt-get build-dep python-libtorrent -sudo apt-get install subversion -svn co https://libtorrent.svn.sourceforge.net/svnroot/libtorrent/trunk/ lt/ -cd lt/ -./autotool.sh -./configure --enable-python-binding -make -sudo make install -sudo ldconfig +sudo ldconfig \ No newline at end of file diff --git a/SearcherABC.py b/SearcherABC.py index 417b7be..6513ea1 100644 --- a/SearcherABC.py +++ b/SearcherABC.py @@ -90,6 +90,16 @@ class SearcherABC: self.cookieJar = cookielib.MozillaCookieJar(cookie) if os.path.exists(cookie): self.cookieJar.load(ignore_discard=True) + def clear_cookie(self, domain): + cookie=os.path.join(self.tempdir(),'cookie.txt') + self.cookieJar = cookielib.MozillaCookieJar(cookie) + if os.path.exists(cookie): + try: + self.cookieJar.clear('.'+domain) + print '[SearcherABC] '+self.__class__.__name__+': Cookie Deleted!' + except: + print '[SearcherABC] '+self.__class__.__name__+': Cookie clear failed!' + def makeRequest(self, url, data={}, headers={}): self.load_cookie() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookieJar)) diff --git a/addon.xml b/addon.xml index 74553bf..fbea984 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@  - + diff --git a/functions.py b/functions.py index 06f1da3..787519d 100644 --- a/functions.py +++ b/functions.py @@ -28,7 +28,7 @@ import os import json import urllib import hashlib -import shutil +import traceback import xbmcplugin import xbmcgui @@ -1127,6 +1127,7 @@ class Searchers(): except Exception, e: print 'Unable to use searcher: ' + searcher + ' at ' + __plugin__ + ' searchWithSearcher(). Exception: ' + str( e) + print(traceback.format_exc()) return filesList def downloadWithSearcher(self, url, searcher): @@ -1145,7 +1146,10 @@ class Searchers(): def search(url, searchersList, isApi=None): from threading import Thread - from Queue import Queue + try: + from Queue import Queue + except ImportError: + from queue import Queue num_threads = 3 queue = Queue() @@ -1782,11 +1786,19 @@ def first_run_231(): __settings__.setSetting('first_run_231','True') ok = xbmcgui.Dialog().ok('< %s >' % Localization.localize('Torrenter Update 2.3.1'), Localization.localize('We added Android ARM full support to Torrenter v2!'), - Localization.localize('With external searcher support I deleted pre-installed ones!')) + Localization.localize('I deleted pre-installed ones, install them in Search Control Window!')) yes=xbmcgui.Dialog().yesno('< %s >' % Localization.localize('Torrenter Update 2.3.1'), - Localization.localize('You have no installed searchers!'), - Localization.localize('Would you like to install searcher from "MyShows.me Kodi Repo" in Programs section?'),) + Localization.localize('You have no installed or active searchers! More info in Search Control Window!'), + Localization.localize('Would you like to install %s from "MyShows.me Kodi Repo" in Programs section?' % ''),) if yes: xbmc.executebuiltin('Dialog.Close(all,true)') xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher')) + +def noActiveSerachers(): + yes=xbmcgui.Dialog().yesno('< %s >' % Localization.localize('Torrenter v2'), + Localization.localize('You have no installed or active searchers! More info in Search Control Window!'), + Localization.localize('Would you like to install %s from "MyShows.me Kodi Repo" in Programs section?' % ''),) + if yes: + xbmc.executebuiltin('Dialog.Close(all,true)') + xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher'))