log update
This commit is contained in:
1 parent
32196e5876
commit
de2323f7af
13 files changed
+589
-655
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#
|
||||
try:
|
||||
import xbmcaddon
|
||||
from functions import log, debug
|
||||
|
||||
__settings__ = xbmcaddon.Addon("plugin.video.torrenter")
|
||||
debug = __settings__.getSetting("debug")
|
||||
@@ -10,31 +11,19 @@ except:
|
||||
|
||||
|
||||
def Log(msg, force=False):
|
||||
try:
|
||||
print "[torrenter log] " + msg
|
||||
except UnicodeEncodeError:
|
||||
print "[torrenter log] " + msg.encode("utf-8", "ignore")
|
||||
log(msg)
|
||||
|
||||
|
||||
def Debug(msg, force=False):
|
||||
if debug == 'true' or force:
|
||||
try:
|
||||
print "[torrenter] " + msg
|
||||
except UnicodeEncodeError:
|
||||
print "[torrenter] " + msg.encode("utf-8", "ignore")
|
||||
debug(msg, True)
|
||||
|
||||
|
||||
def Info(msg, force=False):
|
||||
if debug == 'true' or force:
|
||||
try:
|
||||
print "[torrenter] " + msg
|
||||
except UnicodeEncodeError:
|
||||
print "[torrenter] " + msg.encode("utf-8", "ignore")
|
||||
debug(msg, True)
|
||||
|
||||
|
||||
def Warn(msg, force=False):
|
||||
if debug == 'true' or force:
|
||||
try:
|
||||
print "[torrenter] " + msg
|
||||
except UnicodeEncodeError:
|
||||
print "[torrenter] " + msg.encode("utf-8", "ignore")
|
||||
debug(msg, True)
|
||||
@@ -4,6 +4,7 @@ import time
|
||||
import urllib
|
||||
|
||||
from cache import Cache
|
||||
from functions import log
|
||||
import tmdb
|
||||
|
||||
|
||||
@@ -154,9 +155,9 @@ class TmDb:
|
||||
movie_id = None
|
||||
for name in search:
|
||||
movies = tmdb.Movies(title=name, year=year, limit=True).get_ordered_matches()
|
||||
print '********************************************************'
|
||||
log('********************************************************')
|
||||
try:
|
||||
print str(isAsciiString(movies[1]['title']))
|
||||
log(str(isAsciiString(movies[1]['title'])))
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -320,7 +321,7 @@ def scoreMediaTitleMatch(mediaName, mediaAltTitle, mediaYear, title, original_ti
|
||||
|
||||
|
||||
def get_best(Data, search, year):
|
||||
print '****** Finding TMDB: ' + str(search) + '; year ' + str(year)
|
||||
log('****** Finding TMDB: ' + str(search) + '; year ' + str(year))
|
||||
shows = []
|
||||
itemIndex = -1
|
||||
if len(search) == 2:
|
||||
@@ -349,7 +350,7 @@ def get_best(Data, search, year):
|
||||
release_date=str(show.get('release_date').split('-')[0])
|
||||
else:
|
||||
release_date='0'
|
||||
print (' ... %d: id="%s", name="%s", year="%s", score="%d".' %
|
||||
log(' ... %d: id="%s", name="%s", year="%s", score="%d".' %
|
||||
(i, str(show['id']), show.get('title').encode('utf-8'), release_date,
|
||||
s['rate']))
|
||||
if shows:
|
||||
|
||||
@@ -10,6 +10,7 @@ import zipfile
|
||||
import xbmc
|
||||
from net import HTTP
|
||||
from cache import Cache
|
||||
from functions import log
|
||||
|
||||
|
||||
class TvDb:
|
||||
@@ -82,7 +83,7 @@ class TvDb:
|
||||
# print url
|
||||
response = self.http.fetch(url, headers=self.headers, download=os.path.join(dirname, 'movie.zip'), timeout=20)
|
||||
if response.error:
|
||||
print "ERRRRRROR! " + str(response.error)
|
||||
log("ERRRRRROR! " + str(response.error))
|
||||
self._movie_clear(dirname)
|
||||
return False, None
|
||||
|
||||
@@ -411,7 +412,7 @@ def get_best(Data, search, year):
|
||||
shows.append({'rate': rate, 'id': id})
|
||||
|
||||
shows = sorted(shows, key=lambda x: x['rate'], reverse=True)
|
||||
print '********************** TheTVDB ******************************'
|
||||
print str(shows) + str(mediaName.encode('utf-8'))
|
||||
log('********************** TheTVDB ******************************')
|
||||
log(str(shows) + str(mediaName.encode('utf-8')))
|
||||
if shows:
|
||||
return shows[0]
|
||||
@@ -853,7 +853,7 @@ class Deluge:
|
||||
if port:
|
||||
self.url += ':' + str(port)
|
||||
self.url += url
|
||||
print str(self.url)
|
||||
log(str(self.url))
|
||||
self.http = HTTP()
|
||||
|
||||
def get_info(self):
|
||||
|
||||
Reference in new issue
Block a user