The branch, frodo has been updated
       via  bf64f5cd0e4f10a61f81f9bdcaf50d67cd31c8f8 (commit)
      from  687403c52d46644bc2afccb62e88b21611a20576 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=bf64f5cd0e4f10a61f81f9bdcaf50d67cd31c8f8

commit bf64f5cd0e4f10a61f81f9bdcaf50d67cd31c8f8
Author: amet <amet.nos...@gmail.com>
Date:   Fri May 24 16:48:53 2013 +0400

    [script.xbmc.subtitles] -v3.9.8
    
    3.9.8
    - [fix] Modified Torec plugin directory structure, Mor Sela
    - [fix] Modified how Subscene handles packed files to remove unnecessary 3s 
sleep, IcE
    - [fix] Subcenter,BBLN
    - [add] Divxplanet Turkish Subtitles Support

diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index 211e003..47e7ca6 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="3.9.7"
+       version="3.9.8"
        provider-name="amet, mr_blobby">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt 
b/script.xbmc.subtitles/changelog.txt
index 8a5ecac..1e6c637 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,9 @@
+3.9.8
+- [fix] Modified Torec plugin directory structure, Mor Sela
+- [fix] Modified how Subscene handles packed files to remove unnecessary 3s 
sleep, IcE
+- [fix] Subcenter,BBLN
+- [add] Divxplanet Turkish Subtitles Support
+
 3.9.7
 - [fix] Filename on the beginning of description, EnricGodes
 - [fix] LegendasDivx, LegendasZone and Ondertitel search pattern, highlandr
diff --git a/script.xbmc.subtitles/resources/lib/services/Subscene/service.py 
b/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
index fb841b8..e302735 100644
--- a/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
@@ -282,39 +282,25 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
         except:
             log( __name__ ,"%s Failed to save subtitle to %s" % 
(debug_pretext, local_tmp_file))
         if packed:
-            files = os.listdir(tmp_sub_dir)
-            init_filecount = len(files)
-            max_mtime = 0
-            filecount = init_filecount
-            # determine the newest file from tmp_sub_dir
-            for file in files:
-                if (string.split(file,'.')[-1] in ['srt','sub','txt']):
-                    mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
-                    if mtime > max_mtime:
-                        max_mtime =  mtime
-            init_max_mtime = max_mtime
-            time.sleep(2)  # wait 2 seconds so that the unpacked files are at 
least 1 second newer
+            files_before = os.listdir(tmp_sub_dir)
+            filecount = init_filecount = len(files_before)
             xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + "," + 
tmp_sub_dir +")")
+            files_after = os.listdir(tmp_sub_dir)
+            filecount = len(files_after)
             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
-                files = os.listdir(tmp_sub_dir)
-                filecount = len(files)
-                # determine if there is a newer file created in tmp_sub_dir 
(marks that the extraction had completed)
-                for file in files:
-                    if (string.split(file,'.')[-1] in ['srt','sub','txt']):
-                        mtime = os.stat(os.path.join(tmp_sub_dir, 
file)).st_mtime
-                        if (mtime > max_mtime):
-                            max_mtime =  mtime
+            while (filecount == init_filecount) and (waittime < 200):
+                files_after = os.listdir(tmp_sub_dir)
+                filecount = len(files_after)
                 waittime  = waittime + 1
-            if waittime == 20:
+                log( __name__ ,"%s Wait time is '%s'" % (debug_pretext, 
waittime))
+                time.sleep(0.1)  # wait 0.1 second to let the builtin function 
'XBMC.extract' unpack
+            if waittime == 200:
                 log( __name__ ,"%s Failed to unpack subtitles in '%s'" % 
(debug_pretext, tmp_sub_dir))
             else:
                 log( __name__ ,"%s Unpacked files in '%s'" % (debug_pretext, 
tmp_sub_dir))
-                for file in files:
-                    # there could be more subtitle files in tmp_sub_dir, so 
make sure we get the newly created subtitle file
-                    if (string.split(file, '.')[-1] in ['srt', 'sub', 'txt']) 
and (os.stat(os.path.join(tmp_sub_dir, file)).st_mtime > init_max_mtime): # 
unpacked file is a newly created subtitle file
-                        log( __name__ ,"%s Unpacked subtitles file '%s'" % 
(debug_pretext, file))
-                        subs_file = os.path.join(tmp_sub_dir, file)
+                for new_file in set(files_after) - set(files_before):
+                    if string.split(new_file, '.')[-1] in ['srt', 'sub', 
'txt']:
+                        subs_file = os.path.join(tmp_sub_dir, new_file)
+                        break
         log( __name__ ,"%s Subtitles saved to '%s'" % (debug_pretext, 
local_tmp_file))
         return False, language, subs_file #standard output
diff --git a/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py 
b/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py
index 0833144..319a4a7 100644
--- a/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Subscenter/service.py
@@ -2,17 +2,21 @@
 
 
#===============================================================================
 # Subscenter.org subtitles service.
-# Version: 1.4
+# Version: 1.5.1
 #
+# TODO:
+#  Filter title (The Office (US) => The Office)
 # Change log:
 # 1.1 - Fixed downloading of non-Hebrew subtitles.
 # 1.2 - Added key field for download URL
 # 1.3 - Fixed null values in website dictionary (changed to None)
 # 1.4 - Fixed key field (Thanks ILRHAES)
 # 1.5 - Added User Agent to getURL, fixed string related bugs and patterns
+# 1.5.1 - Temp fix, TODO: Go over version 1.5 patterns.
 #
 # Created by: Ori Varon
 # Changed by MeatHook (1.5)
+# Version 1.5.1 by BBLN
 
#===============================================================================
 import os, re, xbmc, xbmcgui, string, time, urllib2
 from utilities import languageTranslate, log
@@ -26,8 +30,7 @@ debug_pretext = ""
 
#===============================================================================
 
 MULTI_RESULTS_PAGE_PATTERN = u"עמוד (?P<curr_page>\d*) \( סך הכל: 
(?P<total_pages>\d*) \)"
-MOVIES_SEARCH_RESULTS_PATTERN = "<div 
class=\"generalWindowRight\">(?:\r|\n|.){1,400}<a 
href=\"(?P<sid>/he/subtitle/movie/.*?)\">"
-TV_SEARCH_RESULTS_PATTERN = "<div 
class=\"generalWindowRight\">(?:\r|\n|.){1,400}<a 
href=\"(?P<sid>/he/subtitle/series/.*?)\">"
+SEARCH_RESULTS_PATTERN = "<div class=\"generalWindowRight\">.*?<a 
href=\"(?P<sid>.*?)\">"
 
 
#===============================================================================
 # Private utility functions
@@ -73,9 +76,10 @@ def getURLfilename(url):
 # languages and the current subtitles list and adds all found subtitles 
matching
 # the language selection to the subtitles list.
 def getAllSubtitles(subtitlePageID,languageList,subtitlesList):
+    log( __name__ ,"Get all subtitles")
     # Retrieve the subtitles page (html)
     try:
-        subtitlePage = getURL(BASE_URL + ''.join(subtitlePageID).lstrip())
+        subtitlePage = getURL(BASE_URL + str(subtitlePageID).lstrip())
     except:
         # Didn't find the page - no such episode?
         return
@@ -191,39 +195,27 @@ def search_subtitles( file_original_path, title, tvshow, 
year, season, episode,
     if (not searchResults):
         return subtitlesList, "", "Search timed out, please try again later."
 
-    # Look for subtitles page links
-    if tvshow:
-        subtitleIDs = 
re.findall(TV_SEARCH_RESULTS_PATTERN,searchResults,re.DOTALL)
-    else:
-        subtitleIDs = 
re.findall(MOVIES_SEARCH_RESULTS_PATTERN,searchResults,re.DOTALL)    
-    
+    subtitleIDs = re.findall(SEARCH_RESULTS_PATTERN,searchResults,re.DOTALL)
+    log( __name__ , "Looking for page links")
     # Look for more subtitle pages
     pages = 
re.search(MULTI_RESULTS_PAGE_PATTERN,unicode(searchResults,"utf-8"))
     # If we found them look inside for subtitles page links
     if (pages):
-        while (not (int(pages.group("curr_page"))) == 
int(pages.group("total_pages"))):
-            searchResults = getURL(BASE_URL + 
"/he/subtitle/search/?q="+searchString.lower()+"&page="+str(int(pages.group("curr_page"))+1))
-
-            if tvshow:
-                tempSIDs = 
re.findall(TV_SEARCH_RESULTS_PATTERN,searchResults,re.DOTALL)
-            else:
-                tempSIDs = 
re.findall(MOVIES_SEARCH_RESULTS_PATTERN,searchResults,re.DOTALL)
-
+        for pageId in xrange(int(pages.group("total_pages"))):
+            searchResults = getURL(BASE_URL + "/he/subtitle/search/?q=" + 
searchString.lower() + "&page=" + str(pageId))
+            tempSIDs = 
re.findall(SEARCH_RESULTS_PATTERN,searchResults,re.DOTALL)
             for sid in tempSIDs:
                 subtitleIDs.append(sid)
-            pages = 
re.search(MULTI_RESULTS_PAGE_PATTERN,unicode(searchResults,"utf-8"))
     # Uniqify the list
     subtitleIDs=list(set(subtitleIDs))
-    # If looking for tvshos try to append season and episode to url
+    # If looking for tvshows trying to append season and episode to url
     if tvshow:
-        for i in range(len(subtitleIDs)):
-            subtitleIDs[i] += ("/"+season+"/"+episode+"/",)
-
-    for sid in subtitleIDs:
-        getAllSubtitles(sid,languageList,subtitlesList)
-    
-    
-    # Standard output -
+        log( __name__ ,"%s Adding season and episode to urls" % 
(debug_pretext))
+        for id in xrange(len(subtitleIDs)):
+            subtitleIDs[id] += str("/"+season+"/"+episode+"/")
+    for id in subtitleIDs:
+        getAllSubtitles(id,languageList,subtitlesList)
+    # Standard output
     # subtitles list (list of tuples built in getAllSubtitles),
     # session id (e.g a cookie string, passed on to download_subtitles),
     # message to print back to the user
@@ -248,7 +240,7 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
     archive_name = getURLfilename(url)
     # Get the file content using geturl()
     content = getURL(url)
-    subs_file = ""
+    subs_file = None
     if content:
         local_tmp_file = os.path.join(tmp_sub_dir, archive_name)
         log( __name__ ,"%s Saving subtitles to '%s'" % (debug_pretext, 
local_tmp_file))
diff --git a/script.xbmc.subtitles/resources/settings.xml 
b/script.xbmc.subtitles/resources/settings.xml
index b197ca8..8cdb764 100644
--- a/script.xbmc.subtitles/resources/settings.xml
+++ b/script.xbmc.subtitles/resources/settings.xml
@@ -8,9 +8,11 @@
     <category label="30103">
       <setting id="Argenteam" type="bool" label="Argenteam.net" 
default="false"/>
       <setting id="AsiaTeam" type="bool" label="Asia-Team.net" 
default="false"/>
-      
+
       <setting id="BetaSeries" type="bool" label="betaseries.com" 
default="false"/>
-      <setting id="Bierdopje" type="bool" label="Bierdopje.com (TV Shows and 
Dutch/English subs only)" default="false"/>             
+      <setting id="Bierdopje" type="bool" label="Bierdopje.com (TV Shows and 
Dutch/English subs only)" default="false"/>
+
+      <setting id="Divxplanet" type="bool" label="Divxplanet.com (English and 
Turkish subs only)" default="false"/>
 
       <setting id="euTorrents" type="bool" label="eutorrents.me" 
default="false"/>
       <setting id="euTuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30148" default=""/>
@@ -20,7 +22,7 @@
       <setting id="Itasa" type="bool" label="Itasa (Italiansubs.net, TV Shows 
and Italian only)" default="false"/>
       <setting id="ITuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30126" default=""/>
       <setting id="ITpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30127" default=""/>
-      
+
       <setting id="LegendasDivx" type="bool" label="LegendasDivx.com" 
default="false"/>
       <setting id="LDivxuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30132" default=""/>
       <setting id="LDivxpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30133" default=""/>
@@ -29,8 +31,8 @@
       <setting id="LTVpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30124" default=""/>
       <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=""/>      
-      
+      <setting id="LZpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30139" default=""/>
+
       <setting id="Napiprojekt" type="bool" label="Napiprojekt.pl 
(Polish/English subs only)" default="false"/>
       <setting id="Napisy24pl" type="bool" label="Napisy24.pl (Mostly 
Polish/English subs)" default="false"/>
       <setting id="Napisy24_type" type="enum" 
lvalues="30141|30142|30143|30144" visible= "eq(-1,true)" enable="eq(-1,true)" 
default="2" label="30140"/>
@@ -39,8 +41,8 @@
 
       <setting id="OmniSubs" type="bool" label="OmniSubs.net" default="false"/>
       <setting id="Omniuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30136" default=""/>
-      <setting id="Omnipass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30137" default=""/>      
-      <setting id="Ondertitel" type="bool" label="Ondertitel.com (Movies and 
Dutch subs only)" default="false"/>      
+      <setting id="Omnipass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30137" default=""/>
+      <setting id="Ondertitel" type="bool" label="Ondertitel.com (Movies and 
Dutch subs only)" default="false"/>
       <setting id="OpenSubtitles" type="bool" label="OpenSubtitles.org" 
default="true"/>
 
       <setting id="Pipocas" type="bool" label="Pipocas.tv" default="false"/>
@@ -48,7 +50,7 @@
       <setting id="Pipocaspass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30159" default=""/>
       <setting id="Podnapisi" type="bool" label="Podnapisi.net" 
default="true"/>
       <setting id="PNuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30104" default=""/>
-      <setting id="PNpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30105" default=""/> 
+      <setting id="PNpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30105" default=""/>
       <setting id="PTSubs" type="bool" label="PT-SUBS.NET" default="false"/>
       <setting id="PTSuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30134" default=""/>
       <setting id="PTSpass" type="text" option = "hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30135" default=""/>
@@ -59,27 +61,27 @@
       <setting id="Sratim" type="bool" label="Sratim.co.il" default="false"/>
       <setting id="SubClub" type="bool" label="SubClub.eu" default="false"/>
       <setting id="SubDB" type="bool" label="theSubDB.com" default="false"/>
-      <setting id="Subdivx" type="bool" label="Subdivx.com (Spanish subs 
only)" default="false"/>      
-      <setting id="Sublight" type="bool" label="Sublight.si" default="false"/> 
            
+      <setting id="Subdivx" type="bool" label="Subdivx.com (Spanish subs 
only)" default="false"/>
+      <setting id="Sublight" type="bool" label="Sublight.si" default="false"/>
       <setting id="Subs4Free" type="bool" label="Subs4Free (Greek subs only)" 
default="false"/>
       <setting id="Subscene" type="bool" label="Subscene.com" default="false"/>
       <setting id="Subscenter" type="bool" label="Subscenter.org" 
default="false"/>
       <setting id="SubtitlesGR" type="bool" label="Subtitles.gr (Greek subs 
only)" default="false"/>
       <setting id="SubtitulosES" type="bool" label="Subtitulos.es" 
default="false"/>
-      <setting id="SuperSubtitles" type="bool" label="SuperSubtitles 
(Feliratok.info)" default="false"/>      
+      <setting id="SuperSubtitles" type="bool" label="SuperSubtitles 
(Feliratok.info)" default="false"/>
       <setting id="Swesub" type="bool" label="Swesub.nu" default="false"/>
-      
-      <setting id="Titlovi" type="bool" label="Titlovi.com" default="false"/> 
-      <setting id="Titulky" type="bool" label="Titulky.com (Czech and Slovak 
subs only)" default="false"/>       
+
+      <setting id="Titlovi" type="bool" label="Titlovi.com" default="false"/>
+      <setting id="Titulky" type="bool" label="Titulky.com (Czech and Slovak 
subs only)" default="false"/>
       <setting id="Titulkyuser" type="text"  visible= "eq(-1,true)" 
enable="eq(-1,true)" label="30128" default=""/>
       <setting id="Titulkypass" type="text" option ="hidden" visible= 
"eq(-2,true)" enable="eq(-2,true)" label="30129" default=""/>
       <setting id="Torec" type="bool" label="Torec.net" default="false"/>
-           
+
       <setting id="Undertexter" type="bool" label="Undertexter.se (Swedish and 
English subs only)" default="false"/>
     </category>
     <category label="30106">
       <setting id="defmovieservice" type="select" mask="/" label="30113" 
default="OpenSubtitles" source="/resources/lib/services" />
-      <setting id="deftvservice" type="select" mask="/" label="30114" 
default="OpenSubtitles" source="/resources/lib/services" />    
+      <setting id="deftvservice" type="select" mask="/" label="30114" 
default="OpenSubtitles" source="/resources/lib/services" />
       <setting id="subfolder" type="bool" label="30107" default="true" />
       <setting id="subfolderpath" type="folder" visible= "eq(-1,false)" 
source="files" label="30108" default="" />
       <setting id="searchstr" type="bool" label="30110" default="false"/>

-----------------------------------------------------------------------

Summary of changes:
 script.xbmc.subtitles/addon.xml                    |    2 +-
 script.xbmc.subtitles/changelog.txt                |    6 +
 .../{Torec/Torec => Divxplanet}/__init__.py        |    0
 .../resources/lib/services/Divxplanet/logo.png     |  Bin 0 -> 20433 bytes
 .../resources/lib/services/Divxplanet/service.py   |  256 ++++++++++++++++++++
 .../resources/lib/services/Subscene/service.py     |   42 +---
 .../resources/lib/services/Subscenter/service.py   |   50 ++---
 .../Torec/{ => }/Torec/TorecSubtitlesDownloader.py |    0
 .../resources/lib/services/Torec}/__init__.py      |    0
 .../lib/services/Torec/{ => }/Torec/logo.png       |  Bin 26338 -> 26338 bytes
 .../lib/services/Torec/{ => }/Torec/service.py     |    0
 script.xbmc.subtitles/resources/settings.xml       |   34 ++--
 12 files changed, 316 insertions(+), 74 deletions(-)
 rename script.xbmc.subtitles/resources/lib/services/{Torec/Torec => 
Divxplanet}/__init__.py (100%)
 create mode 100644 
script.xbmc.subtitles/resources/lib/services/Divxplanet/logo.png
 create mode 100644 
script.xbmc.subtitles/resources/lib/services/Divxplanet/service.py
 rename script.xbmc.subtitles/resources/lib/services/Torec/{ => 
}/Torec/TorecSubtitlesDownloader.py (100%)
 copy {script.cu.lrclyrics/resources/lib/culrcscrapers => 
script.xbmc.subtitles/resources/lib/services/Torec}/__init__.py (100%)
 rename script.xbmc.subtitles/resources/lib/services/Torec/{ => 
}/Torec/logo.png (100%)
 rename script.xbmc.subtitles/resources/lib/services/Torec/{ => 
}/Torec/service.py (100%)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to