The branch, dharma has been updated
via 4f754c8a34d9028393c68877262ad5981bc6192a (commit)
from d5c93ff264faa2a22cd1c4ee1e899ba128beb16f (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=4f754c8a34d9028393c68877262ad5981bc6192a
commit 4f754c8a34d9028393c68877262ad5981bc6192a
Author: amet <[email protected]>
Date: Tue Mar 1 16:45:44 2011 +0400
[script.xbmc.subtitles] -v 2.3.5
2.3.5
- Corrected the fix for the problem of failing services on Unix with
unpacking subtitle file
2.3.4
- fixed: On Unix some services failed in using the unpacked subtitle file
- added: more tvshow regex for file mode search
diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index a3c96fa..2f31495 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.3.3"
+ version="2.3.5"
provider-name="Amet, mr_blobby">
<requires>
<import addon="xbmc.python" version="1.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt
b/script.xbmc.subtitles/changelog.txt
index d6f3a4c..39fdaa4 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,10 @@
+2.3.5
+- Corrected the fix for the problem of failing services on Unix with unpacking
subtitle file
+
+2.3.4
+- fixed: On Unix some services failed in using the unpacked subtitle file
+- added: more tvshow regex for file mode search
+
2.3.3
- oops, c/p error
diff --git a/script.xbmc.subtitles/resources/lib/services/Itasa/service.py
b/script.xbmc.subtitles/resources/lib/services/Itasa/service.py
index 3a04882..51e0c45 100644
--- a/script.xbmc.subtitles/resources/lib/services/Itasa/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Itasa/service.py
@@ -162,9 +162,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
filecount = init_filecount
# determine the newest file from tmp_sub_dir
for file in files:
- mtime = os.stat(os.path.join(tmp_sub_dir,
file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + ","
+ tmp_sub_dir +")")
@@ -175,9 +176,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
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:
- mtime = os.stat(os.path.join(tmp_sub_dir,
file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
waittime = waittime + 1
if waittime == 20:
log( __name__ ," Failed to unpack subtitles in '%s'" %
(tmp_sub_dir))
diff --git
a/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/service.py
b/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/service.py
index 0a800d7..7ed25b3 100644
--- a/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/OpenSubtitles/service.py
@@ -5,6 +5,7 @@ import os
from utilities import hashFile, log
from os_utilities import OSDBServer
import socket
+import xbmc
_ = sys.modules[ "__main__" ].__language__
@@ -35,7 +36,6 @@ def set_filehash(path,rar):
def search_subtitles( file_original_path, title, tvshow, year, season,
episode, set_temp, rar, lang1, lang2, lang3 ): #standard input
- import xbmc
ok = False
msg = ""
hash_search = False
@@ -46,8 +46,7 @@ def search_subtitles( file_original_path, title, tvshow,
year, season, episode,
OS_search_string = ("%s S%.2dE%.2d" % (tvshow, int(season),
int(episode),)).replace(" ","+")
else: # Movie
or not in Library
- if str(year) == "":
- import xbmc # Not in
Library
+ if str(year) == "": # Not in
Library
title, year = xbmc.getCleanMovieTitle( title )
else: # Movie
in Library
year = year
diff --git a/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
b/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
index 413a81c..088d16d 100644
--- a/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Subdivx/service.py
@@ -150,9 +150,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
max_mtime = 0
# determine the newest file from tmp_sub_dir
for file in files:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + "," +
tmp_sub_dir +")")
@@ -163,9 +164,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
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:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
waittime = waittime + 1
if waittime == 20:
log( __name__ ,"%s Failed to unpack subtitles in '%s'" %
(debug_pretext, tmp_sub_dir))
diff --git a/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
b/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
index 8e00d84..bc78e59 100644
--- a/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Subscene/service.py
@@ -252,9 +252,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
filecount = init_filecount
# determine the newest file from tmp_sub_dir
for file in files:
- mtime = os.stat(os.path.join(tmp_sub_dir,
file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
xbmc.executebuiltin("XBMC.Extract(" +
local_tmp_file + "," + tmp_sub_dir +")")
@@ -265,9 +266,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
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:
- mtime =
os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
waittime = waittime + 1
if waittime == 20:
log( __name__ ,"%s Failed to unpack
subtitles in '%s'" % (debug_pretext, tmp_sub_dir))
diff --git a/script.xbmc.subtitles/resources/lib/services/Swesub/service.py
b/script.xbmc.subtitles/resources/lib/services/Swesub/service.py
index f407e13..124aebf 100644
--- a/script.xbmc.subtitles/resources/lib/services/Swesub/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Swesub/service.py
@@ -101,9 +101,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
filecount = init_filecount
# determine the newest file from tmp_sub_dir
for file in files:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + "," +
tmp_sub_dir +")")
@@ -114,9 +115,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
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:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
waittime = waittime + 1
if waittime == 20:
log( __name__ ,"Failed to unpack subtitles in '%s'" %
(tmp_sub_dir))
diff --git a/script.xbmc.subtitles/resources/lib/services/Titlovi/service.py
b/script.xbmc.subtitles/resources/lib/services/Titlovi/service.py
index 3250c3a..74054d0 100644
--- a/script.xbmc.subtitles/resources/lib/services/Titlovi/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Titlovi/service.py
@@ -177,9 +177,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
filecount = init_filecount
# determine the newest file from tmp_sub_dir
for file in files:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + "," +
tmp_sub_dir +")")
@@ -190,9 +191,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
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:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
waittime = waittime + 1
if waittime == 20:
log( __name__ ,"%s Failed to unpack subtitles in '%s'" %
(debug_pretext, tmp_sub_dir))
diff --git
a/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
b/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
index fe78859..bc1101c 100644
--- a/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
@@ -151,9 +151,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
filecount = init_filecount
# determine the newest file from tmp_sub_dir
for file in files:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + "," +
tmp_sub_dir +")")
@@ -164,9 +165,10 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
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:
- mtime = os.stat(os.path.join(tmp_sub_dir, file)).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
+ 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
waittime = waittime + 1
if waittime == 20:
log( __name__ ,"%s Failed to unpack subtitles in '%s'" %
(debug_pretext, tmp_sub_dir))
diff --git a/script.xbmc.subtitles/resources/lib/utilities.py
b/script.xbmc.subtitles/resources/lib/utilities.py
index 9d49ee4..9c618ce 100644
--- a/script.xbmc.subtitles/resources/lib/utilities.py
+++ b/script.xbmc.subtitles/resources/lib/utilities.py
@@ -60,8 +60,10 @@ def regex_tvshow(compare, file, sub = ""):
'[\\\\/\\._ -]([0-9]+)([0-9][0-9])[^\\/]*',
'Season ([0-9]+) - Episode ([0-9]+)[^\\/]*',
'[\\\\/\\._ -][0]*([0-9]+)x[0]*([0-9]+)[^\\/]*',
- '[[Ss]([0-9]+)\]_\[[Ee]([0-9]+)([^\\/]*)'
#foo_[s01]_[e01]
- '[\._ \-][Ss]([0-9]+)[\.\-]?[Ee]([0-9]+)([^\\/]*)'
#foo, s01e01, foo.s01.e01, foo.s01-e01
+ '[[Ss]([0-9]+)\]_\[[Ee]([0-9]+)([^\\/]*)',
#foo_[s01]_[e01]
+ '[\._ \-][Ss]([0-9]+)[\.\-]?[Ee]([0-9]+)([^\\/]*)',
#foo, s01e01, foo.s01.e01, foo.s01-e01
+ '[Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+)([^\\\\/]*)$',
+ '[\\\\/\\._ \\[\\(-]([0-9]+)x([0-9]+)([^\\\\/]*)$'
]
sub_info = ""
tvshow = 0
-----------------------------------------------------------------------
Summary of changes:
script.xbmc.subtitles/addon.xml | 2 +-
script.xbmc.subtitles/changelog.txt | 7 +++++++
.../resources/lib/services/Itasa/service.py | 14 ++++++++------
.../lib/services/OpenSubtitles/service.py | 5 ++---
.../resources/lib/services/Subdivx/service.py | 14 ++++++++------
.../resources/lib/services/Subscene/service.py | 14 ++++++++------
.../resources/lib/services/Swesub/service.py | 14 ++++++++------
.../resources/lib/services/Titlovi/service.py | 14 ++++++++------
.../resources/lib/services/Undertexter/service.py | 14 ++++++++------
script.xbmc.subtitles/resources/lib/utilities.py | 6 ++++--
10 files changed, 62 insertions(+), 42 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons