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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?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> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.libtorrent"/> <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 потока одновременно) [+] Поиск: Поиск существенно ускорился, стал многопоточным (пока 3 потока одновременно)
[+] Поиск: Добавлена поддержка внешних серчеров с индивидуальными настройками (в стиле Pulsar) [+] Поиск: Добавлена поддержка внешних серчеров с индивидуальными настройками (в стиле Pulsar)
[+] Обновлено окно Torrenter Global Control Center [+] Обновлено окно Torrenter Global Control Center

View File

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

View File

@ -187,14 +187,14 @@ class IMDB(Content.Content):
def topmode(self, response): def topmode(self, response):
contentList = [] contentList = []
Soup = BeautifulSoup(response) Soup = BeautifulSoup(response)
result = Soup.findAll('tr', {'class': ['odd', 'even']}) result = Soup.findAll('tr')[1:251]
for tr in result: for tr in result:
#main #main
tdtitle = tr.find('td', 'titleColumn') 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 originaltitle = None
title = tdtitle.find('a').text 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') tdposter = tr.find('td', 'posterColumn')
img = self.biggerImg(tdposter.find('img').get('src')) img = self.biggerImg(tdposter.find('img').get('src'))