pull/1/head
DiMartinoXBMC 2015-07-04 18:53:45 +03:00
parent 8b97221e9b
commit 730d1bf492
5 changed files with 34 additions and 33 deletions

View File

@ -274,7 +274,6 @@ class Core:
#print str(Searchers().list())
first_run_230(False)
def DownloadStatus(self, params={}):
db = DownloadDB()
get = params.get
@ -1568,6 +1567,8 @@ class Core:
]
title = self.titleMake(seeds, leechers, size, title)
#print image
if self.open_option==0:
self.drawItem(title, 'openTorrent', link_dict, image, contextMenu=contextMenu, replaceMenu=False)
elif self.open_option==1:

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.torrenter" name="Torrenter" version="2.3.0" provider-name="vadim.skorba, DiMartino">
<addon id="plugin.video.torrenter" name="Torrenter" version="2.3.0a" provider-name="vadim.skorba, DiMartino">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.libtorrent"/>

View File

@ -1,4 +1,8 @@
[B]Version 2.3.0[/B]
[B]Version 2.3.1[/B]
[+] Загрузка: Исправлена ошибка удаления базы данных
[+] Списки Медиа: Исправлен IMDB TOP 250
[B]Version 2.3.0[/B]
[+] Поиск: Поиск существенно ускорился, стал многопоточным (пока 3 потока одновременно)
[+] Поиск: Добавлена поддержка внешних серчеров с индивидуальными настройками (в стиле Pulsar)
[+] Обновлено окно Torrenter Global Control Center

View File

@ -1109,7 +1109,7 @@ class Searchers():
def get_active(self):
get_active = []
for searcher in self.list().iterkeys():
for searcher in self.list().keys():
if self.old(searcher): get_active.append(searcher + '.py')
print 'Active Searchers: ' + str(get_active)
return get_active
@ -1559,14 +1559,7 @@ class DownloadDB:
def get_all(self):
self._connect()
try:
self.cur.execute(
'select addtime, title, path, type, jsoninfo, status, torrent, ind, lastupdate, storage from downloads order by addtime DESC')
except:
Debug('[DownloadDB]: DELETE ' + str(self.filename))
xbmcvfs.delete(self.filename)
self._connect()
self.cur.execute(
self._execute(
'select addtime, title, path, type, jsoninfo, status, torrent, ind, lastupdate, storage from downloads order by addtime DESC')
x = self.cur.fetchall()
self._close()
@ -1574,15 +1567,7 @@ class DownloadDB:
def get(self, title):
self._connect()
try:
self.cur.execute(
'select addtime, title, path, type, jsoninfo, status, torrent, ind, lastupdate, storage from downloads where title="' + decode(
title) + '"')
except:
Debug('[DownloadDB]: DELETE ' + str(self.filename))
xbmcvfs.delete(self.filename)
self._connect()
self.cur.execute(
self._execute(
'select addtime, title, path, type, jsoninfo, status, torrent, ind, lastupdate, storage from downloads where title="' + decode(
title) + '"')
x = self.cur.fetchone()
@ -1591,16 +1576,27 @@ class DownloadDB:
def get_byaddtime(self, addtime):
self._connect()
self.cur.execute(
self._execute(
'select addtime, title, path, type, jsoninfo, status, torrent, ind, lastupdate, storage from downloads where addtime="' + str(
addtime) + '"')
x = self.cur.fetchone()
self._close()
return x if x else None
def _execute(self, sql):
try:
self.cur.execute(sql)
except:
self._close()
Debug('[DownloadDB]: DELETE ' + str(self.filename))
xbmcvfs.delete(self.filename)
self._connect()
self.cur.execute(sql)
def get_status(self, title):
self._connect()
self.cur.execute('select status from downloads where title="' + decode(title) + '"')
self._execute('select status from downloads where title="' + decode(title) + '"')
x = self.cur.fetchone()
self._close()
return x[0] if x else None
@ -1625,7 +1621,7 @@ class DownloadDB:
except:
pass
self._connect()
self.cur.execute(
self._execute(
'UPDATE downloads SET jsoninfo = "' + urllib.quote_plus(json.dumps(info)) + '", lastupdate=' + str(
int(time.time())) + ' where title="' + title + '"')
self.db.commit()
@ -1633,19 +1629,19 @@ class DownloadDB:
def update_status(self, addtime, status):
self._connect()
self.cur.execute('UPDATE downloads SET status = "' + status + '" where addtime="' + str(addtime) + '"')
self._execute('UPDATE downloads SET status = "' + status + '" where addtime="' + str(addtime) + '"')
self.db.commit()
self._close()
def delete(self, addtime):
self._connect()
self.cur.execute('delete from downloads where addtime="' + str(addtime) + '"')
self._execute('delete from downloads where addtime="' + str(addtime) + '"')
self.db.commit()
self._close()
def clear(self):
self._connect()
self.cur.execute('delete from downloads')
self._execute('delete from downloads')
self.db.commit()
self._close()

View File

@ -187,14 +187,14 @@ class IMDB(Content.Content):
def topmode(self, response):
contentList = []
Soup = BeautifulSoup(response)
result = Soup.findAll('tr', {'class': ['odd', 'even']})
result = Soup.findAll('tr')[1:251]
for tr in result:
#main
tdtitle = tr.find('td', 'titleColumn')
num = tdtitle.find('span', {'name': 'ir'}).text.rstrip('.')
num = tr.find('span', {'name': 'rk'}).get('data-value').rstrip('.')
originaltitle = None
title = tdtitle.find('a').text
year = tdtitle.find('span', {'name': 'rd'}).text.rstrip(')').lstrip('(')
year = tdtitle.find('span', {'class': 'secondaryInfo'}).text.rstrip(')').lstrip('(')
tdposter = tr.find('td', 'posterColumn')
img = self.biggerImg(tdposter.find('img').get('src'))