The branch, eden-pre has been updated
via c8aeb5bf630fe920001bf5b3cf367c728c1b7fde (commit)
from f79b520cd8d8460ccfba00236602aae77006e36a (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=c8aeb5bf630fe920001bf5b3cf367c728c1b7fde
commit c8aeb5bf630fe920001bf5b3cf367c728c1b7fde
Author: amet <[email protected]>
Date: Sat Jul 2 14:19:49 2011 +0400
[script.xbmc.subtitles] -v2.9.13
- OpenSubtitles fix and re-factor search
-- download first "sync" subtitle will attempt to download without bringing
the window up, if unsuccessful it will work as usual
- added: SuperSubtitles service, thx kispaljr and mukka
diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index b0ec04b..c16db44 100644
--- a/script.xbmc.subtitles/addon.xml
+++ b/script.xbmc.subtitles/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmc.subtitles"
name="XBMC Subtitles"
- version="2.9.12"
+ version="2.9.13"
provider-name="Amet, mr_blobby">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt
b/script.xbmc.subtitles/changelog.txt
index 4590229..5dc8aaa 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,8 @@
+2.9.13
+- OpenSubtitles fix and re-factor search
+-- download first "sync" subtitle will attempt to download without bringing
the window up, if unsuccessful it will work as usual
+- added: SuperSubtitles service, thx kispaljr and mukka
+
2.9.12
- fixed: ordering of OpenSubtitles results, thx to cidus
- fixed: Undertexter, it will now find Swedish subs
diff --git a/script.xbmc.subtitles/default.py b/script.xbmc.subtitles/default.py
index b1982e3..2172900 100644
--- a/script.xbmc.subtitles/default.py
+++ b/script.xbmc.subtitles/default.py
@@ -17,13 +17,26 @@ __author__ = "Amet,mr_blobby"
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( __cwd__, 'resources',
'lib' ) )
sys.path.append (BASE_RESOURCE_PATH)
+from utilities import *
+
xbmc.output("### [%s] - Version: %s" %
(__scriptname__,__version__,),level=xbmc.LOGDEBUG )
if ( __name__ == "__main__" ):
- if not xbmc.getCondVisibility('Player.Paused') : xbmc.Player().pause()
#Pause if not paused
+
import gui
ui = gui.GUI( "script-XBMC-Subtitles-main.xml" , __cwd__ , "Default")
- ui.doModal()
+ movieFullPath = ui.set_allparam()
+ if (__settings__.getSetting( "auto_download" ) == "true") and
(__settings__.getSetting( "auto_download_file" ) != os.path.basename(
movieFullPath )):
+ notification = UserNotificationNotifier(__scriptname__, __language__(764),
2000)
+ if not ui.Search_Subtitles(False):
+ if not xbmc.getCondVisibility('Player.Paused') : xbmc.Player().pause()
#Pause if not paused
+ ui.doModal()
+ else:
+ notification.close(__language__(765), 1000)
+ else:
+ if not xbmc.getCondVisibility('Player.Paused') : xbmc.Player().pause()
#Pause if not paused
+ ui.doModal()
+
del ui
if xbmc.getCondVisibility('Player.Paused'): xbmc.Player().pause() # if
Paused, un-pause
sys.modules.clear()
diff --git a/script.xbmc.subtitles/resources/language/English/strings.xml
b/script.xbmc.subtitles/resources/language/English/strings.xml
index 8901541..c4f3502 100644
--- a/script.xbmc.subtitles/resources/language/English/strings.xml
+++ b/script.xbmc.subtitles/resources/language/English/strings.xml
@@ -28,6 +28,8 @@
<string id="761">You must be logged in to download these
subtitles,[CR]verify your settings at the addon Configuration</string>
<string id="762">Addon Settings</string>
<string id="763">Auto downloading first 'sync' subtitle</string>
+ <string id="764">Downloading first 'sync' sub</string>
+ <string id="765">first 'sync' subtitle downloaded</string>
<!-- Script Settings -->
diff --git a/script.xbmc.subtitles/resources/lib/gui.py
b/script.xbmc.subtitles/resources/lib/gui.py
index 59703d0..4c88d6a 100644
--- a/script.xbmc.subtitles/resources/lib/gui.py
+++ b/script.xbmc.subtitles/resources/lib/gui.py
@@ -32,7 +32,25 @@ class GUI( xbmcgui.WindowXMLDialog ):
pass
def onInit( self ):
- self.set_allparam()
+# self.set_allparam()
+ self.on_run()
+
+ def on_run( self ):
+ if not self.checkSubs():
+ self.getControl( 111 ).setVisible( False )
+ try:
+ self.list_services()
+ except:
+ self.newWindow = False
+ self.list_services()
+
+ try:
+ self.Search_Subtitles()
+ except:
+ errno, errstr = sys.exc_info()[:2]
+# self.getControl( STATUS_LABEL ).setLabel( "Error:" + " " +
str(errstr) )
+ xbmc.sleep(2000)
+ self.exit_script()
def set_allparam(self):
self.list = []
@@ -59,8 +77,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.stream_sub_dir = os.path.join( __profile__ ,"sub_stream" )
# Stream subtitle directory
def_movie_service = __settings__.getSetting( "defmovieservice")
# Default Movie service
def_tv_service = __settings__.getSetting( "deftvservice")
# Default TV Show service
-
- self.getControl( 111 ).setVisible( False )
# check for existing subtitles and set to "True" if found
+
if (movieFullPath.find("http://") > -1 ):
if not xbmcvfs.exists(self.stream_sub_dir):
@@ -72,6 +89,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
elif (movieFullPath.find("rar://") > -1 ):
self.rar = True
+ self.temp = True
movieFullPath = movieFullPath.replace("rar://","")
if path:
self.sub_folder = os.path.dirname(os.path.dirname( movieFullPath ))
@@ -144,8 +162,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
else:
self.rem_files(self.tmp_sub_dir)
- if self.checkSubs():
- self.getControl( 111 ).setVisible( True )
+
if (__settings__.getSetting( "auto_download" ) == "true") and
(__settings__.getSetting( "auto_download_file" ) != os.path.basename(
movieFullPath )):
self.autoDownload = True
@@ -189,34 +206,21 @@ class GUI( xbmcgui.WindowXMLDialog ):
log( __name__ ,"Languages: [%s] [%s] [%s]" % (self.language_1,
self.language_2, self.language_3,))
log( __name__ ,"Parent Folder Search: [%s]" % self.parsearch)
log( __name__ ,"Stacked(CD1/CD2)?: [%s]" % self.stack)
-
- try:
- self.list_services()
- except:
- self.newWindow = False
- self.list_services()
- try:
- self.Search_Subtitles()
- except:
- errno, errstr = sys.exc_info()[:2]
- self.getControl( STATUS_LABEL ).setLabel( "Error:" + " " + str(errstr)
)
- xbmc.sleep(2000)
- self.exit_script()
- else:
- self.getControl( STATUS_LABEL ).setLabel( "No Services Have been
selected" )
- xbmc.sleep(2000)
- self.exit_script()
-
+
+ return movieFullPath
+
###-------------------------- Search Subtitles -------------################
- def Search_Subtitles( self ):
+ def Search_Subtitles( self, gui = True ):
self.subtitles_list = []
- self.getControl( SUBTITLES_LIST ).reset()
- self.getControl( LOADING_IMAGE ).setImage( xbmc.translatePath(
os.path.join( SERVICE_DIR, self.service, "logo.png") ) )
+ if gui:
+ self.getControl( SUBTITLES_LIST ).reset()
+ self.getControl( LOADING_IMAGE ).setImage( xbmc.translatePath(
os.path.join( SERVICE_DIR, self.service, "logo.png") ) )
exec ( "from services.%s import service as Service" % (self.service))
self.Service = Service
- self.getControl( STATUS_LABEL ).setLabel( _( 646 ) )
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( _( 646 ) )
msg = ""
socket.setdefaulttimeout(float(__settings__.getSetting( "timeout" )))
try:
@@ -231,7 +235,8 @@ class GUI( xbmcgui.WindowXMLDialog ):
errno, errstr = sys.exc_info()[:2]
msg = "Error: %s" % ( str(errstr), )
socket.setdefaulttimeout(None)
- self.getControl( STATUS_LABEL ).setLabel( _( 642 ) % ( "...", ) )
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( _( 642 ) % ( "...", ) )
if not self.subtitles_list:
if ((__settings__.getSetting( "search_next" )== "true") and
(len(self.next) > 1)):
@@ -242,54 +247,60 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.Search_Subtitles()
else:
self.next = list(self.service_list)
- if msg != "":
- self.getControl( STATUS_LABEL ).setLabel( msg )
- else:
- self.getControl( STATUS_LABEL ).setLabel( _( 657 ) )
- if self.newWindow:
- window_list = SERVICES_LIST
- else:
- window_list = SUBTITLES_LIST
- self.list_services()
- self.setFocusId( window_list )
- self.getControl( window_list ).selectItem( 0 )
+ if gui:
+ if msg != "":
+ self.getControl( STATUS_LABEL ).setLabel( msg )
+ else:
+ self.getControl( STATUS_LABEL ).setLabel( _( 657 ) )
+ if self.newWindow:
+ window_list = SERVICES_LIST
+ else:
+ window_list = SUBTITLES_LIST
+ self.list_services()
+ if gui:
+ self.setFocusId( window_list )
+ self.getControl( window_list ).selectItem( 0 )
else:
if not self.newWindow: self.list_services()
subscounter = 0
itemCount = 0
for item in self.subtitles_list:
if self.autoDownload and item["sync"] and (item["language_name"] ==
languageTranslate(languageTranslate(self.language_1,0,2),2,0)):
- self.Download_Subtitles(itemCount, True)
+ self.Download_Subtitles(itemCount, True, gui)
__settings__.setSetting("auto_download_file", os.path.basename(
self.file_original_path ))
+ return True
break
else:
- listitem = xbmcgui.ListItem( label=item["language_name"],
label2=item["filename"], iconImage=item["rating"],
thumbnailImage=item["language_flag"] )
- if item["sync"]:
- listitem.setProperty( "sync", "true" )
- else:
- listitem.setProperty( "sync", "false" )
- self.list.append(subscounter)
- subscounter = subscounter + 1
- self.getControl( SUBTITLES_LIST ).addItem( listitem )
+ if gui:
+ listitem = xbmcgui.ListItem( label=item["language_name"],
label2=item["filename"], iconImage=item["rating"],
thumbnailImage=item["language_flag"] )
+ if item["sync"]:
+ listitem.setProperty( "sync", "true" )
+ else:
+ listitem.setProperty( "sync", "false" )
+ self.list.append(subscounter)
+ subscounter = subscounter + 1
+ self.getControl( SUBTITLES_LIST ).addItem( listitem )
itemCount += 1
- self.getControl( STATUS_LABEL ).setLabel( '%i %s '"' %s '"'' % (len (
self.subtitles_list ), _( 744 ), self.file_name,) )
- self.setFocusId( SUBTITLES_LIST )
- self.getControl( SUBTITLES_LIST ).selectItem( 0 )
-
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( '%i %s '"' %s '"'' % (len (
self.subtitles_list ), _( 744 ), self.file_name,) )
+ self.setFocusId( SUBTITLES_LIST )
+ self.getControl( SUBTITLES_LIST ).selectItem( 0 )
+ return False
###-------------------------- Download Subtitles -------------################
- def Download_Subtitles( self, pos, auto = False ):
- if auto:
- self.getControl( STATUS_LABEL ).setLabel( _( 763 ) )
- else:
- self.getControl( STATUS_LABEL ).setLabel( _( 649 ) )
+ def Download_Subtitles( self, pos, auto = False, gui = True ):
+ if gui:
+ if auto:
+ self.getControl( STATUS_LABEL ).setLabel( _( 763 ) )
+ else:
+ self.getControl( STATUS_LABEL ).setLabel( _( 649 ) )
zip_subs = os.path.join( self.tmp_sub_dir, "zipsubs.zip")
zipped, language, file =
self.Service.download_subtitles(self.subtitles_list, pos, zip_subs,
self.tmp_sub_dir, self.sub_folder,self.session_id)
sub_lang = str(languageTranslate(language,0,2))
if zipped :
- self.Extract_Subtitles(zip_subs,sub_lang)
+ self.Extract_Subtitles(zip_subs,sub_lang, gui)
else:
sub_ext = os.path.splitext( file )[1]
sub_name = os.path.splitext( os.path.basename( self.file_original_path )
)[0]
@@ -315,32 +326,35 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.rem_files(self.tmp_sub_dir)
self.exit_script()
else:
- self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
- if self.newWindow:
- window_list = SERVICES_LIST
- else:
- window_list = SUBTITLES_LIST
- self.list_services()
- self.setFocusId( window_list )
- self.getControl( window_list ).selectItem( 0 )
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
+ if self.newWindow:
+ window_list = SERVICES_LIST
+ else:
+ window_list = SUBTITLES_LIST
+ self.list_services()
+ self.setFocusId( window_list )
+ self.getControl( window_list ).selectItem( 0 )
###-------------------------- Extract, Rename & Activate Subtitles
-------------################
- def Extract_Subtitles( self, zip_subs, subtitle_lang ):
+ def Extract_Subtitles( self, zip_subs, subtitle_lang, gui = True ):
xbmc.executebuiltin('XBMC.Extract("%s","%s")' %
(zip_subs,self.tmp_sub_dir,))
xbmc.sleep(1000)
files = os.listdir(self.tmp_sub_dir)
sub_filename = os.path.basename( self.file_original_path )
exts = [".srt", ".sub", ".txt", ".smi", ".ssa", ".ass" ]
if len(files) < 1 :
- self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
- if self.newWindow:
- self.setFocusId( SERVICES_LIST )
- self.getControl( SERVICES_LIST ).selectItem( 0 )
- else:
- self.list_services()
- else :
- self.getControl( STATUS_LABEL ).setLabel( _( 652 ) )
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
+ if self.newWindow:
+ self.setFocusId( SERVICES_LIST )
+ self.getControl( SERVICES_LIST ).selectItem( 0 )
+ else:
+ self.list_services()
+ else :
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( _( 652 ) )
subtitle_set = False
movie_sub = False
episode = 0
@@ -378,14 +392,15 @@ class GUI( xbmcgui.WindowXMLDialog ):
xbmc.Player().setSubtitles(subToActivate)
self.exit_script()
else:
- self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
- if self.newWindow:
- window_list = SERVICES_LIST
- else:
- window_list = SUBTITLES_LIST
- self.list_services()
- self.setFocusId( window_list )
- self.getControl( window_list ).selectItem( 0 )
+ if gui:
+ self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
+ if self.newWindow:
+ window_list = SERVICES_LIST
+ else:
+ window_list = SUBTITLES_LIST
+ self.list_services()
+ self.setFocusId( window_list )
+ self.getControl( window_list ).selectItem( 0 )
###-------------------------- Create name -------------################
@@ -499,7 +514,8 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.keyboard(True)
elif selection == "Set":
__settings__.openSettings()
- self.set_allparam()
+ self.set_allparam()
+ self.on_run()
else:
self.service = selection
self.Search_Subtitles()
diff --git
a/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/os_utilities.py
b/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/os_utilities.py
index 953dd58..c44605d 100644
--- a/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/os_utilities.py
+++ b/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/os_utilities.py
@@ -1,138 +1,75 @@
# -*- coding: utf-8 -*-
-import sys
import os
+import sys
+import xbmc
import xmlrpclib
from utilities import *
-import xbmc
-from xml.dom import minidom
-import urllib
-_ = sys.modules[ "__main__" ].__language__
+
+_ = sys.modules[ "__main__" ].__language__
+__scriptname__ = sys.modules[ "__main__" ].__scriptname__
BASE_URL_XMLRPC = u"http://api.opensubtitles.org/xml-rpc"
-BASE_URL_HASH =
u"http://www.opensubtitles.org/en/search/sublanguageid-%s/moviebytesize-%s/moviehash-%s/simplexml"
-BASE_URL_NAME =
u"http://www.opensubtitles.com/en/search/sublanguageid-%s/moviename-%s/simplexml"
class OSDBServer:
-###-------------------------- Merge Subtitles All -------------################
-
-
def mergesubtitles( self ):
self.subtitles_list = []
if( len ( self.subtitles_hash_list ) > 0 ):
for item in self.subtitles_hash_list:
if item["format"].find( "srt" ) == 0 or item["format"].find( "sub" )
== 0:
self.subtitles_list.append( item )
+
if( len ( self.subtitles_list ) > 0 ):
self.subtitles_list.sort(key=lambda x: [not x['sync'],x['lang_index']])
-###-------------------------- Sort Subtitles -------------################
-
- def sortsubtitles(self, subtitle, hashed, url_base):
- filename = movie = lang_name = subtitle_id = lang_id = link = ""
- lang_index = 3
- flag_image = "-.gif"
- if subtitle.getElementsByTagName("releasename")[0].firstChild:
- filename =
subtitle.getElementsByTagName("releasename")[0].firstChild.data
- if subtitle.getElementsByTagName("format")[0].firstChild:
- format = subtitle.getElementsByTagName("format")[0].firstChild.data
- filename = "%s.%s" % ( filename,format, )
- if subtitle.getElementsByTagName("movie")[0].firstChild:
- movie = subtitle.getElementsByTagName("movie")[0].firstChild.data
- if subtitle.getElementsByTagName("language")[0].firstChild:
- lang_name = subtitle.getElementsByTagName("language")[0].firstChild.data
- if subtitle.getElementsByTagName("idsubtitle")[0].firstChild:
- subtitle_id =
subtitle.getElementsByTagName("idsubtitle")[0].firstChild.data
- if subtitle.getElementsByTagName("iso639")[0].firstChild:
- lang_id = subtitle.getElementsByTagName("iso639")[0].firstChild.data
- flag_image = "flags/%s.gif" % (lang_id,)
- lang_index=0
- for user_lang_id in self.langs_ids:
- if user_lang_id == lang_id:
- break
- lang_index+=1
- if subtitle.getElementsByTagName("download")[0].firstChild:
- link = subtitle.getElementsByTagName("download")[0].firstChild.data
- link = url_base + link
- if subtitle.getElementsByTagName("subrating")[0].firstChild:
- rating = subtitle.getElementsByTagName("subrating")[0].firstChild.data
-
-
self.subtitles_hash_list.append({'lang_index':lang_index,'filename':filename,'link':link,'language_name':lang_name,'language_id':lang_id,'language_flag':flag_image,'movie':movie,"ID":subtitle_id,"rating":str(
int( rating[0] ) ),"format":format,"sync":hashed})
-
-
- def get_results ( self, search_url ):
- socket = urllib.urlopen( search_url )
- log( __name__ , "Search url [ %s ]" % (search_url,))
- result = socket.read()
- socket.close()
- return result
-
-###-------------------------- Opensubtitles Search
-------------################
-
-
def searchsubtitles( self, srch_string , lang1,lang2,lang3,hash_search,
_hash = "000000000", size = "000000000"):
- msg = ""
- search_url1 = None
- search_url2 = None
- self.subtitles_list =[]
+ msg = ""
+ lang_index = 3
+ searchlist = []
self.subtitles_hash_list = []
- self.langs_ids = [languageTranslate(lang1,0,2),
languageTranslate(lang2,0,2), languageTranslate(lang3,0,2)]
- language = languageTranslate(lang1,0,3)
+ self.langs_ids = [languageTranslate(lang1,0,2),
languageTranslate(lang2,0,2), languageTranslate(lang3,0,2)]
+ language = languageTranslate(lang1,0,3)
+
if lang1 != lang2:
language += "," + languageTranslate(lang2,0,3)
- search_url1 = BASE_URL_NAME % (languageTranslate(lang2,0,3),srch_string,)
if lang3 != lang1 and lang3 != lang2:
language += "," + languageTranslate(lang3,0,3)
- search_url2 = BASE_URL_NAME %
(languageTranslate(lang3,0,3),srch_string,)
+
+ self.server = xmlrpclib.Server( BASE_URL_XMLRPC, verbose=0 )
+ login = self.server.LogIn("", "", "en", __scriptname__.replace(" ","_"))
+
+ self.osdb_token = login[ "token" ]
+ log( __name__ ,"Token:[%s]" % str(self.osdb_token))
+
try:
- if hash_search:
- search_url = BASE_URL_HASH % (language,size, _hash,)
- result = self.get_results( search_url )
- test = True
- if result.find('<?xml version=') < 0:
- msg = _( 755 )
- else:
- xmldoc = minidom.parseString(result)
- subtitles_alt = xmldoc.getElementsByTagName("subtitle")
- if subtitles_alt:
- url_base = xmldoc.childNodes[0].childNodes[1].firstChild.data
- for subtitle in subtitles_alt:
- self.sortsubtitles(subtitle, True, url_base)
+ if ( self.osdb_token ) :
+ if hash_search:
+ searchlist.append({'sublanguageid':language, 'moviehash':_hash,
'moviebytesize':str( size ) })
+ searchlist.append({'sublanguageid':language, 'query':srch_string })
+ search = self.server.SearchSubtitles( self.osdb_token, searchlist )
+ if search["data"]:
+ for item in search["data"]:
+ if item["ISO639"]:
+ lang_index=0
+ for user_lang_id in self.langs_ids:
+ if user_lang_id == item["ISO639"]:
+ break
+ lang_index+=1
+ flag_image = "flags/%s.gif" % item["ISO639"]
+ else:
+ flag_image = "-.gif"
- if (not hash_search) or (not self.subtitles_hash_list):
- search_url = BASE_URL_NAME %
(languageTranslate(lang1,0,3),srch_string,)
- result = self.get_results( search_url )
- if result.find('<?xml version=') < 0:
- msg = _( 755 )
- else:
- xmldoc = minidom.parseString(result)
- subtitles_alt = xmldoc.getElementsByTagName("subtitle")
-
- if search_url1 != None :
- result = self.get_results( search_url1 )
- if result.find('<?xml version=') < 0:
- msg = _( 755 )
- else:
- xmldoc = minidom.parseString(result)
- subtitles_alt += xmldoc.getElementsByTagName("subtitle")
+ if str(item["MatchedBy"]) == "moviehash":
+ sync = True
+ else:
+ sync = False
+
+
self.subtitles_hash_list.append({'lang_index':lang_index,'filename':item["SubFileName"],'link':item["ZipDownloadLink"],"language_name":item["LanguageName"],"language_flag":flag_image,"language_id":item["SubLanguageID"],"ID":item["IDSubtitle"],"rating":str(
int( item["SubRating"][0] ) ),"format":item["SubFormat"],"sync":sync})
- if search_url2 != None :
- result = self.get_results( search_url2 )
- if result.find('<?xml version=') < 0:
- msg = _( 755 )
- else:
- xmldoc = minidom.parseString(result)
- subtitles_alt += xmldoc.getElementsByTagName("subtitle")
-
- if subtitles_alt:
- url_base = xmldoc.childNodes[0].childNodes[1].firstChild.data
- for subtitle in subtitles_alt:
- self.sortsubtitles(subtitle, False, url_base)
-
except:
- pass
+ msg = "Error Searching For Subs"
self.mergesubtitles()
return self.subtitles_list, msg
diff --git a/script.xbmc.subtitles/resources/lib/utilities.py
b/script.xbmc.subtitles/resources/lib/utilities.py
index 2de1f56..d33d152 100644
--- a/script.xbmc.subtitles/resources/lib/utilities.py
+++ b/script.xbmc.subtitles/resources/lib/utilities.py
@@ -137,4 +137,13 @@ def languageTranslate(lang, lang_from, lang_to):
return x[lang_to]
-
+class UserNotificationNotifier:
+ def __init__(self, title, initialMessage, time = -1):
+ self.__title = title
+ xbmc.executebuiltin("Notification(%s,%s,%i)" % (title, initialMessage,
time))
+
+ def update(self, message, time = -1):
+ xbmc.executebuiltin("Notification(%s,%s,-1)" % (self.__title, message,
time))
+
+ def close(self, message, time = -1):
+ xbmc.executebuiltin("Notification(%s,%s,%i)" % (self.__title, message,
time))
diff --git a/script.xbmc.subtitles/resources/settings.xml
b/script.xbmc.subtitles/resources/settings.xml
index df01405..076bfb3 100644
--- a/script.xbmc.subtitles/resources/settings.xml
+++ b/script.xbmc.subtitles/resources/settings.xml
@@ -43,6 +43,7 @@
<setting id="Subscenter" type="bool" label="Subscenter.org"
default="false"/>
<setting id="AsiaTeam" type="bool" label="Asia-Team.net"
default="false"/>
<setting id="Sratim" type="bool" label="Sratim.co.il" default="false"/>
+ <setting id="SuperSubtitles" type="bool" label="SuperSubtitles
(Feliratok.info)" default="false"/>
<setting id="LegendasZone" type="bool" label="Legendas-Zone.org"
default="false"/>
<setting id="LZuser" type="text" visible= "eq(-1,true)"
enable="eq(-1,true)" label="30138" default=""/>
<setting id="LZpass" type="text" option = "hidden" visible=
"eq(-2,true)" enable="eq(-2,true)" label="30139" default=""/>
-----------------------------------------------------------------------
Summary of changes:
script.xbmc.subtitles/addon.xml | 2 +-
script.xbmc.subtitles/changelog.txt | 5 +
script.xbmc.subtitles/default.py | 17 +-
.../resources/language/English/strings.xml | 2 +
script.xbmc.subtitles/resources/lib/gui.py | 184 +++++++------
.../lib/services/OpenSubtitles/os_utilities.py | 147 +++--------
.../lib/services/SuperSubtitles}/__init__.py | 0
.../resources/lib/services/SuperSubtitles/logo.png | Bin 0 -> 22540 bytes
.../lib/services/SuperSubtitles/service.py | 277 ++++++++++++++++++++
.../lib/services/SuperSubtitles/subenv.py | 19 ++
.../lib/services/SuperSubtitles/subutils.py | 103 ++++++++
script.xbmc.subtitles/resources/lib/utilities.py | 11 +-
script.xbmc.subtitles/resources/settings.xml | 1 +
13 files changed, 575 insertions(+), 193 deletions(-)
copy {script.cu.lyrics/resources/lib/scrapers =>
script.xbmc.subtitles/resources/lib/services/SuperSubtitles}/__init__.py (100%)
create mode 100644
script.xbmc.subtitles/resources/lib/services/SuperSubtitles/logo.png
create mode 100644
script.xbmc.subtitles/resources/lib/services/SuperSubtitles/service.py
create mode 100644
script.xbmc.subtitles/resources/lib/services/SuperSubtitles/subenv.py
create mode 100644
script.xbmc.subtitles/resources/lib/services/SuperSubtitles/subutils.py
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons