search window
This commit is contained in:
1 parent
4ff0f33bd2
commit
f65919d690
3 files changed
+119
-3
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.torrenter" name="Torrenter" version="2.5.4a" provider-name="DiMartino">
|
||||
<addon id="plugin.video.torrenter" name="Torrenter" version="2.5.5" provider-name="DiMartino">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.1.0"/>
|
||||
<import addon="script.module.libtorrent"/>
|
||||
|
||||
+5
-2
@@ -1,14 +1,17 @@
|
||||
English changelog at http://bit.ly/1MfSVUP
|
||||
|
||||
[B]Version 2.5.5[/B]
|
||||
[+] Control Center: Исправлена работа выбора трекеров для определенного запроса
|
||||
|
||||
[B]Version 2.5.4[/B]
|
||||
Исправлено "открыть без возврата". Спасибо viorel-m.
|
||||
[+] Исправлено "открыть без возврата". Спасибо viorel-m.
|
||||
|
||||
[B]Version 2.5.3[/B]
|
||||
[+] Венгерский язык
|
||||
[+] Совместимость с Коди 17
|
||||
|
||||
[B]Version 2.5.2[/B]
|
||||
[+] Упорядочивание по разверу файла
|
||||
[+] Упорядочивание по размеру файла
|
||||
|
||||
[B]Version 2.5.1[/B]
|
||||
[+] Исправлена работа с кодировками
|
||||
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Torrenter v2 plugin for XBMC/Kodi
|
||||
Copyright (C) 2012-2015 Vadim Skorba v1 - DiMartino v2
|
||||
https://forums.tvaddons.ag/addon-releases/29224-torrenter-v2.html
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the#
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
import os
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
import xbmcaddon
|
||||
import pyxbmct.addonwindow as pyxbmct
|
||||
|
||||
_addon = xbmcaddon.Addon()
|
||||
_path = _addon.getAddonInfo("path")
|
||||
__settings__ = xbmcaddon.Addon(id='plugin.video.torrenter')
|
||||
__version__ = __settings__.getAddonInfo('version')
|
||||
__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__
|
||||
|
||||
|
||||
class MultiChoiceDialog(pyxbmct.AddonDialogWindow):
|
||||
def __init__(self, title="", filesList=None):
|
||||
super(MultiChoiceDialog, self).__init__(title)
|
||||
self.setGeometry(1280, 720, 9, 16)
|
||||
self.selected = []
|
||||
self.set_controls()
|
||||
self.connect_controls()
|
||||
self.filesList = filesList
|
||||
self.items()
|
||||
self.set_navigation()
|
||||
|
||||
def set_controls(self):
|
||||
self.input_search = pyxbmct.Edit("Search"+"...")
|
||||
self.placeControl(self.input_search, 0, 0, 1, 5)
|
||||
self.button_search = pyxbmct.Button("Search")
|
||||
self.placeControl(self.button_search, 0, 5, 1, 1)
|
||||
self.button_keyboard = pyxbmct.Button("keyboard")
|
||||
self.placeControl(self.button_keyboard, 0, 6, 1, 1)
|
||||
|
||||
self.listing = pyxbmct.List(_imageWidth=40, _imageHeight=40, _itemTextXOffset=10, _itemTextYOffset=2, _itemHeight=40, _space=2, _alignmentY=4)
|
||||
self.placeControl(self.listing, 1, 0, 8, 15)
|
||||
|
||||
|
||||
def connect_controls(self):
|
||||
self.connect(self.listing, self.press)
|
||||
#self.connect(self.ok_button, self.ok)
|
||||
#self.connect(self.cancel_button, self.close)
|
||||
|
||||
def set_navigation(self):
|
||||
self.listing.controlUp(self.input_search)
|
||||
self.listing.controlDown(self.input_search)
|
||||
self.input_search.setNavigation(self.listing, self.listing, self.button_keyboard, self.button_search)
|
||||
self.button_search.setNavigation(self.listing, self.listing, self.input_search, self.button_keyboard)
|
||||
self.button_keyboard.setNavigation(self.listing, self.listing, self.button_search, self.input_search)
|
||||
if self.listing.size():
|
||||
self.setFocus(self.listing)
|
||||
else:
|
||||
self.setFocus(self.input_search)
|
||||
|
||||
def items(self):
|
||||
self.listing.reset()
|
||||
for (order, seeds, leechers, size, title, link, image) in self.filesList:
|
||||
title = titleMake(seeds, leechers, size, title)
|
||||
log(title)
|
||||
list_item = xbmcgui.ListItem(title, "", image, '', '')
|
||||
self.listing.addItem(list_item)
|
||||
|
||||
def press(self):
|
||||
self.filesList = sorted(self.filesList, key=lambda x: x[4], reverse=True)
|
||||
self.items()
|
||||
|
||||
def log(msg):
|
||||
try:
|
||||
xbmc.log("### [%s]: %s" % (__plugin__,msg,), level=xbmc.LOGNOTICE )
|
||||
except UnicodeEncodeError:
|
||||
xbmc.log("### [%s]: %s" % (__plugin__,msg.encode("utf-8", "ignore"),), level=xbmc.LOGNOTICE )
|
||||
except:
|
||||
xbmc.log("### [%s]: %s" % (__plugin__,'ERROR LOG',), level=xbmc.LOGNOTICE )
|
||||
|
||||
def titleMake(seeds, leechers, size, title):
|
||||
|
||||
#AARRGGBB
|
||||
clGreen = '[COLOR FF008000]%s[/COLOR]'
|
||||
clDodgerblue = '[COLOR FF1E90FF]%s[/COLOR]'
|
||||
clDimgray = '[COLOR FF696969]%s[/COLOR]'
|
||||
clWhite = '[COLOR FFFFFFFF]%s[/COLOR]'
|
||||
clAliceblue = '[COLOR FFF0F8FF]%s[/COLOR]'
|
||||
clRed = '[COLOR FFFF0000]%s[/COLOR]'
|
||||
|
||||
title = title.replace('720p', '[B]720p[/B]').replace('1080p', '[B]1080p[/B]')
|
||||
title = clWhite % title
|
||||
second = '\r\n[I](%s) [S/L: %d/%d] [/I]' % (size, seeds, leechers)
|
||||
title += ' ' + second
|
||||
return title
|
||||
|
||||
if __name__ == "__main__":
|
||||
items = [(1919, 1919, 52, u'102.66 MiB', u'South.Park.S20E06.HDTV.x264-FUM[ettv]', u'ThePirateBay::magnet:?xt=urn:btih:0792ea51bc16a19893871197fa927ecec7ca25aa&dn=South.Park.S20E06.HDTV.x264-FUM%5Bettv%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (1545, 1545, 31, u'97.26 MiB', u'South.Park.S20E05.HDTV.x264-KILLERS[ettv]', u'ThePirateBay::magnet:?xt=urn:btih:437487c32ce82f050cdbfccfc04e4e20aca0d4cb&dn=South.Park.S20E05.HDTV.x264-KILLERS%5Bettv%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (1265, 1265, 75, u'89.69 MiB', u'South.Park.S20E07.HDTV.x264-FLEET', u'ThePirateBay::magnet:?xt=urn:btih:a122b0b79c4cbacea959e6e032ab540674ce49eb&dn=South.Park.S20E07.HDTV.x264-FLEET&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (1083, 1083, 9, u'99.5 MiB', u'South.Park.S20E03.PROPER.HDTV.x264-KILLERS[ettv]', u'ThePirateBay::magnet:?xt=urn:btih:ed2806f33629ec637caeabcc25ae1e70d5971ebe&dn=South.Park.S20E03.PROPER.HDTV.x264-KILLERS%5Bettv%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (429, 429, 19, u'85.08 MiB', u'South.Park.S20E08.WEBRip.x264-FUM[ettv]', u'ThePirateBay::magnet:?xt=urn:btih:988728720702c55fd1d19cde10f9af720ed934eb&dn=South.Park.S20E08.WEBRip.x264-FUM%5Bettv%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (311, 311, 229, u'251.67 MiB', u'South.Park.S20E08.1080p.HDTV.x264[state]', u'ThePirateBay::magnet:?xt=urn:btih:a5fa25dfccfa43723e34466b47fed2f89dd34072&dn=South.Park.S20E08.1080p.HDTV.x264%5Bstate%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (272, 272, 51, '6.08 \xd0\x93\xd0\x91', '\xd0\xae\xd0\xb6\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xbf\xd0\xb0\xd1\x80\xd0\xba / South Park (C\xd0\xb5\xd0\xb7\xd0\xbe\xd0\xbd 18 , \xd0\xa1\xd0\xb5\xd1\x80\xd0\xb8\xd1\x8f 1-10 \xd0\xb8\xd0\xb7 10) [2014, \xd0\x9c\xd1\x83\xd0\xbb\xd1\x8c\xd1\x82\xd1\x81\xd0\xb5\xd1\x80\xd0\xb8\xd0\xb0\xd0\xbb, \xd0\x9a\xd0\xbe\xd0\xbc\xd0\xb5\xd0\xb4\xd0\xb8\xd1\x8f, \xd0\x9f\xd0\xb0\xd1\x80\xd0\xbe\xd0\xb4\xd0\xb8\xd1\x8f, WEB-DL (720p), \xd0\x9f\xd1\x80\xd0\xbe\xd1\x84\xd0\xb5\xd1\x81\xd1\x81\xd0\xb8\xd0\xbe\xd0\xbd\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd1\x8b\xd0\xb9 (\xd0\xb4\xd0\xb2\xd1\x83\xd1\x85\xd0\xb3\xd0\xbe\xd0\xb3\xd0\xbe\xd0\xbb\xd0\xbe\xd1\x81\xd1\x8b\xd0\xb9, \xd0\xb7\xd0\xb0\xd0\xba\xd0\xb0\xd0\xb4\xd1\x80\xd0\xbe\xd0\xb2\xd1\x8b\xd0\xb9) - \xd0\x9a\xd1\x83\xd0\xb1\xd0\xb8\xd0\xba \xd0\xb2 \xd0\x9a\xd1\x83\xd0\xb1\xd0\xb5]', 'RiperAM::http://riperam.orghttp://riperam.org/foreign-multserials/ujniy-park-south-park-cezon-10-seriya-1-iz-10-t111662.html?id=602710', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.RiperAM\\icon.png'), (237, 237, 6, u'367.96 MiB', u'South.Park.S20E03.720p.HDTV.x264-AVS[rarbg]', u'ThePirateBay::magnet:?xt=urn:btih:a6fd5218db8b5445981ce1466a501ae1e72fc538&dn=South.Park.S20E03.720p.HDTV.x264-AVS%5Brarbg%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', 'C:\\Users\\Admin\\AppData\\Roaming\\Kodi\\addons\\torrenter.searcher.ThePirateBay\\icon.png'), (206, 206, 127, '4.1 \xd0\x93\xd0\x91', '\xd0\xae\xd0\xb6\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\x9f\xd0\xb0\xd1\x80\xd0\xba (19 \xd1\x81\xd0\xb5\xd0\xb7\xd0\xbe\xd0\xbd: 1-10 \xd1\x81\xd0\xb5\xd1\x80\xd0\xb8\xd1\x8f \xd0\xb8\xd0\xb7 10) / South Park [2015, \xd0\x9c\xd1\x83\xd0\xbb\xd1\x8c\xd1\x82\xd1\x81\xd0\xb5\xd1\x80\xd0\xb8\xd0\xb0\xd0Line truncated
|
||||
dialog = MultiChoiceDialog("Select items", items)
|
||||
dialog.doModal()
|
||||
del dialog #You need to delete your instance when it is no longer needed
|
||||
#because underlying xbmcgui classes are not grabage-collected.
|
||||
Reference in new issue
Block a user