The branch, gotham has been updated
via 7f6d9e1b99b244b800ed86fa06af21294d57bbac (commit)
from 2455e77372c4e02331b0f9233b293a425bca6d87 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=7f6d9e1b99b244b800ed86fa06af21294d57bbac
commit 7f6d9e1b99b244b800ed86fa06af21294d57bbac
Author: Martijn Kaijser <[email protected]>
Date: Thu Jun 5 10:38:52 2014 +0200
[service.subtitles.legendasdivx] 0.0.9
diff --git a/service.subtitles.legendasdivx/addon.xml
b/service.subtitles.legendasdivx/addon.xml
index ebe10c6..e63d5ab 100644
--- a/service.subtitles.legendasdivx/addon.xml
+++ b/service.subtitles.legendasdivx/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.subtitles.legendasdivx"
name="LegendasDivx.com"
- version="0.0.8"
+ version="0.0.9"
provider-name="HiGhLaNdeR">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
diff --git a/service.subtitles.legendasdivx/changelog.txt
b/service.subtitles.legendasdivx/changelog.txt
index 7622ae8..809e86d 100644
--- a/service.subtitles.legendasdivx/changelog.txt
+++ b/service.subtitles.legendasdivx/changelog.txt
@@ -1,3 +1,5 @@
+0.0.9
+- Account verification added.
0.0.8
- Fixed more Unicode issues.
0.0.7
diff --git
a/service.subtitles.legendasdivx/resources/language/English/strings.xml
b/service.subtitles.legendasdivx/resources/language/English/strings.xml
index 3846a4e..1cca3fa 100644
--- a/service.subtitles.legendasdivx/resources/language/English/strings.xml
+++ b/service.subtitles.legendasdivx/resources/language/English/strings.xml
@@ -14,4 +14,10 @@
<string id="32011">Auto</string>
<string id="32012">Always on</string>
<string id="32013">Off</string>
+ <string id="32014">Language Settings</string>
+ <string id="32015">Advanced Settings</string>
+ <string id="32016">Username is required! Check add-on setttings!</string>
+ <string id="32017">Password is required! Check add-on setttings!</string>
+ <string id="32018">Username and Password is required! Check add-on
setttings!</string>
+ <string id="32019">Only for registered users! Wrong username and/or
password? Check add-on settings. Thanks.</string>
</strings>
diff --git a/service.subtitles.legendasdivx/resources/language/Portuguese
(Brazil)/strings.xml
b/service.subtitles.legendasdivx/resources/language/Portuguese
(Brazil)/strings.xml
index 71e507f..c90a904 100644
--- a/service.subtitles.legendasdivx/resources/language/Portuguese
(Brazil)/strings.xml
+++ b/service.subtitles.legendasdivx/resources/language/Portuguese
(Brazil)/strings.xml
@@ -14,4 +14,10 @@
<string id="32011">Auto</string>
<string id="32012">Sempre ligado</string>
<string id="32013">Desligado</string>
+ <string id="32014">Idiomas (Site)</string>
+ <string id="32015">Avançadas</string>
+ <string id="32016">O usuario é obrigatório! Verifique as definições do
serviço!</string>
+ <string id="32017">A senha é obrigatória! Verifique as definições do
serviço!</string>
+ <string id="32018">O usuario e senha são obrigatórios! Verifique as
definições do serviço!</string>
+ <string id="32019">Apenas para usuarios registados! Usuario e/ou Senha
errados? Verifique as definições do serviço!. Obrigado.</string>
</strings>
diff --git
a/service.subtitles.legendasdivx/resources/language/Portuguese/strings.xml
b/service.subtitles.legendasdivx/resources/language/Portuguese/strings.xml
index e708d72..186e9b9 100644
--- a/service.subtitles.legendasdivx/resources/language/Portuguese/strings.xml
+++ b/service.subtitles.legendasdivx/resources/language/Portuguese/strings.xml
@@ -14,4 +14,10 @@
<string id="32011">Auto</string>
<string id="32012">Sempre ligado</string>
<string id="32013">Desligado</string>
+ <string id="32014">Idiomas (Site)</string>
+ <string id="32015">Avançadas</string>
+ <string id="32016">O utilizador é obrigatório! Verifique as definições
do serviço!</string>
+ <string id="32017">A palavra-passe é obrigatória! Verifique as
definições do serviço!</string>
+ <string id="32018">O utilizador e palavra-passe são obrigatórios!
Verifique as definições do serviço!</string>
+ <string id="32019">Apenas para utilizadores registados! Utilizador e/ou
Palavra-passe errados? Verifique as definições do serviço!.
Obrigado.</string>
</strings>
diff --git a/service.subtitles.legendasdivx/resources/settings.xml
b/service.subtitles.legendasdivx/resources/settings.xml
index efc6888..be8f9c2 100644
--- a/service.subtitles.legendasdivx/resources/settings.xml
+++ b/service.subtitles.legendasdivx/resources/settings.xml
@@ -3,10 +3,14 @@
<category label="32003">
<setting id="LDuser" type="text" label="32001" default=""/>
<setting id="LDpass" type="text" option = "hidden" label="32002"
default=""/>
+ </category>
+ <category label="32014">
<setting id="PT" type="bool" label="32004" default="true"/>
<setting id="PTBR" type="bool" label="32005" default="true"/>
<setting id="ES" type="bool" label="32006" default="true"/>
<setting id="EN" type="bool" label="32007" default="true"/>
+ </category>
+ <category label="32015">
<setting id="DESC" type="bool" label="32008" default="false"/>
<setting id="PARENT" type="enum" lvalues="32011|32013" label="32010"
default="0"/>
</category>
diff --git a/service.subtitles.legendasdivx/service.py
b/service.subtitles.legendasdivx/service.py
index bcabbdb..e3e4934 100644
--- a/service.subtitles.legendasdivx/service.py
+++ b/service.subtitles.legendasdivx/service.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Service LegendasDivx.com version 0.0.8
+# Service LegendasDivx.com version 0.0.9
# Code based on Undertext (FRODO) service
# Coded by HiGhLaNdR@OLDSCHOOL
# Ported to Gotham by HiGhLaNdR@OLDSCHOOL
@@ -125,8 +125,8 @@ def getallsubs(searchstring, languageshort, languagelong,
file_original_path, se
subtitles_list = []
#For DEBUG only uncomment next line
- log(u"_searchstring '%s' ..." % searchstring)
- log(u"_searchstring_notclean '%s' ..." % searchstring_notclean)
+ #log(u"_searchstring '%s' ..." % searchstring)
+ #log(u"_searchstring_notclean '%s' ..." % searchstring_notclean)
page = 1
if languageshort == "pt":
url = main_url +
"modules.php?name=Downloads&file=jz&d_op=search_next&order=&form_cat=28&page="
+ str(page) + "&query=" + urllib.quote_plus(searchstring)
@@ -181,18 +181,18 @@ def getallsubs(searchstring, languageshort, languagelong,
file_original_path, se
filesearch = os.path.abspath(file_original_path)
#For DEBUG only uncomment next line
#log( __name__ ,"%s abspath: '%s'" % (debug_pretext, filesearch))
- log(u"filesearch1: '%s'" % filesearch)
+ #log(u"filesearch1: '%s'" % filesearch)
filesearch = os.path.split(filesearch)
#For DEBUG only uncomment next line
#log( __name__ ,"%s path.split: '%s'" % (debug_pretext,
filesearch))
dirsearch = filesearch[0].split(os.sep)
#For DEBUG only uncomment next line
#log( __name__ ,"%s dirsearch: '%s'" % (debug_pretext, dirsearch))
- log(u"dirsearch: '%s'" % dirsearch)
+ #log(u"dirsearch: '%s'" % dirsearch)
dirsearch_check = string.split(dirsearch[-1], '.')
#For DEBUG only uncomment next line
#log( __name__ ,"%s dirsearch_check: '%s'" % (debug_pretext,
dirsearch_check))
- log(u"dirsearch_check: '%s'" % dirsearch_check)
+ #log(u"dirsearch_check: '%s'" % dirsearch_check)
#### PARENT FOLDER TWEAK DEFINED IN THE ADD-ON SETTINGS (AUTO |
ALWAYS ON (DEACTIVATED) | OFF)
__parentfolder__ = __addon__.getSetting( 'PARENT' )
if __parentfolder__ == '0':
@@ -282,13 +282,24 @@ def Search(item):
#### use item["some_property"] that was set earlier
#### once done, set xbmcgui.ListItem() below and pass it to
xbmcplugin.addDirectoryItem()
#
+ #### CHECKING FOR ANYTHING IN THE USERNAME AND PASSWORD, IF NULL IT STOPS
THE SCRIPT WITH A WARNING
+ username = __addon__.getSetting( 'LDuser' )
+ password = __addon__.getSetting( 'LDpass' )
+ if username == '' or password == '':
+ xbmcplugin.endOfDirectory(int(sys.argv[1]))
+ if username == '' and password != '':
+ xbmc.executebuiltin(('Notification(%s,%s,%d)' % (__scriptname__ ,
__language__(32016).encode('utf-8'),5000)))
+ if username != '' and password == '':
+ xbmc.executebuiltin(('Notification(%s,%s,%d)' % (__scriptname__ ,
__language__(32017).encode('utf-8'),5000)))
+ if username == '' and password == '':
+ xbmc.executebuiltin(('Notification(%s,%s,%d)' % (__scriptname__ ,
__language__(32018).encode('utf-8'),5000)))
#### PARENT FOLDER TWEAK DEFINED IN THE ADD-ON SETTINGS (AUTO | ALWAYS ON
(DEACTIVATED) | OFF)
file_original_path = item['file_original_path']
__parentfolder__ = __addon__.getSetting( 'PARENT' )
if __parentfolder__ == '0':
filename = os.path.abspath(file_original_path)
dirsearch = filename.split(os.sep)
- log(u"dirsearch_search string = %s" % (dirsearch,))
+ #log(u"dirsearch_search string = %s" % (dirsearch,))
if re.search(release_pattern, dirsearch[-2], re.IGNORECASE):
__parentfolder__ = '1'
else:
@@ -297,10 +308,10 @@ def Search(item):
filename = os.path.abspath(file_original_path)
dirsearch = filename.split(os.sep)
filename = dirsearch[-2]
- log(u"__parentfolder1__ = %s" % (filename,))
+ #log(u"__parentfolder1__ = %s" % (filename,))
if __parentfolder__ == '2':
filename = os.path.splitext(os.path.basename(file_original_path))[0]
- log(u"__parentfolder2__ = %s" % (filename,))
+ #log(u"__parentfolder2__ = %s" % (filename,))
filename = xbmc.getCleanMovieTitle(filename)[0]
searchstring_notclean =
os.path.splitext(os.path.basename(file_original_path))[0]
@@ -316,8 +327,8 @@ def Search(item):
tvshow = item['tvshow']
season = item['season']
episode = item['episode']
- log(u"Tvshow string = %s" % (tvshow,))
- log(u"Title string = %s" % (title,))
+ #log(u"Tvshow string = %s" % (tvshow,))
+ #log(u"Title string = %s" % (title,))
subtitles_list = []
if item['mansearch']:
@@ -389,7 +400,7 @@ def Search(item):
for sub in subtitles_list:
append_subtitle(sub)
if 'eng' not in item['languages'] and 'spa' not in item['languages'] and
'por' not in item['languages'] and 'por' not in item['languages']:
- xbmc.executebuiltin((u'Notification(%s,%s,%d)' % (__scriptname__ ,
'Only Portuguese | Portuguese Brazilian | English | Spanish.',15000)))
+ xbmc.executebuiltin((u'Notification(%s,%s,%d)' % (__scriptname__ ,
'Only Portuguese | Portuguese Brazilian | English | Spanish.',5000)))
def recursive_glob(treeroot, pattern):
results = []
@@ -421,6 +432,10 @@ def Download(id, filename):
content =
my_opener.open('http://www.legendasdivx.com/modules.php?name=Downloads&d_op=getit&lid='
+ id + '&username=' + username)
content = content.read()
+ #### If user is not registered or User\Pass is misspelled it will generate
an error message and break the script execution!
+ if 'Apenas Disponvel para utilizadores registados.' in
content.decode('utf8', 'ignore'):
+ xbmcplugin.endOfDirectory(int(sys.argv[1]))
+ xbmc.executebuiltin(('Notification(%s,%s,%d)' % (__scriptname__ ,
__language__(32019).encode('utf8'),5000)))
if content is not None:
header = content[:4]
if header == 'Rar!':
@@ -445,7 +460,7 @@ def Download(id, filename):
if packed:
files = os.listdir(__temp__)
init_filecount = len(files)
- log(u"legendasdivx: número de init_filecount %s" %
(init_filecount,)) #EGO
+ #log(u"legendasdivx: número de init_filecount %s" %
(init_filecount,)) #EGO
filecount = init_filecount
max_mtime = 0
# Determine the newest file from __temp__
@@ -457,7 +472,7 @@ def Download(id, filename):
init_max_mtime = max_mtime
# Wait 2 seconds so that the unpacked files are at least 1 second
newer
time.sleep(2)
- xbmc.executebuiltin("XBMC.Extract(" +
local_tmp_file.encode("utf-8") + ", " + __temp__.encode("utf-8") +")")
+ xbmc.executebuiltin("XBMC.Extract(" +
local_tmp_file.encode("utf-8") + ", " + __temp__ +")")
waittime = 0
while filecount == init_filecount and waittime < 20 and
init_max_mtime == max_mtime: # nothing yet extracted
time.sleep(1) # wait 1 second to let the builtin function
'XBMC.extract' unpack
@@ -575,4 +590,4 @@ elif params['action'] == 'download':
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sub,
listitem=listitem, isFolder=False)
# Send end of directory to XBMC
-xbmcplugin.endOfDirectory(int(sys.argv[1]))
+xbmcplugin.endOfDirectory(int(sys.argv[1]))
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
service.subtitles.legendasdivx/addon.xml | 2 +-
service.subtitles.legendasdivx/changelog.txt | 2 +
.../resources/language/English/strings.xml | 6 +++
.../language/Portuguese (Brazil)/strings.xml | 6 +++
.../resources/language/Portuguese/strings.xml | 6 +++
.../resources/settings.xml | 4 ++
service.subtitles.legendasdivx/service.py | 45 +++++++++++++-------
7 files changed, 55 insertions(+), 16 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons