The branch, gotham has been updated
       via  a27d1505d26a3485a8b47deebb2b2a28cc875a51 (commit)
       via  2e11832a5beb1f019ca3c2c49acfa5e6e2aea0fd (commit)
      from  1ec7cb56508d373dccff84f3860ac19e994be8bc (commit)

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

commit a27d1505d26a3485a8b47deebb2b2a28cc875a51
Author: sphere <[email protected]>
Date:   Mon Mar 24 10:34:52 2014 +0100

    [service.subtitles.subscenter] updated to version 3.1.4

diff --git a/service.subtitles.subscenter/addon.xml 
b/service.subtitles.subscenter/addon.xml
index e13c1d2..0cf0558 100644
--- a/service.subtitles.subscenter/addon.xml
+++ b/service.subtitles.subscenter/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="service.subtitles.subscenter"
        name="Subscenter.org"
-       version="3.1.3"
+       version="3.1.4"
        provider-name="CaTz">
   <requires>
     <import addon="xbmc.python" version="2.14.0"/>
diff --git a/service.subtitles.subscenter/changelog.txt 
b/service.subtitles.subscenter/changelog.txt
index c6e3b7a..7d5d7bc 100644
--- a/service.subtitles.subscenter/changelog.txt
+++ b/service.subtitles.subscenter/changelog.txt
@@ -1,3 +1,6 @@
+3.1.4 - by CaTz 23/03/2014
+- Bug fix, handle HTML entities in the content show of the website
+
 3.1.3 - by CaTz 15/03/2014
 - Change python version for Gotham
 
diff --git a/service.subtitles.subscenter/resources/lib/SUBUtilities.py 
b/service.subtitles.subscenter/resources/lib/SUBUtilities.py
index e425a89..8c073aa 100644
--- a/service.subtitles.subscenter/resources/lib/SUBUtilities.py
+++ b/service.subtitles.subscenter/resources/lib/SUBUtilities.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+import HTMLParser
 import os
 import re
 import urllib
@@ -7,6 +8,7 @@ import unicodedata
 import json
 import zlib
 import shutil
+
 try:
     import StorageServer
 except ImportError:
@@ -21,9 +23,8 @@ except ImportError:
     from stubs import xbmcvfs
     from stubs import xbmcaddon
 
-
 __addon__ = xbmcaddon.Addon()
-__version__ = __addon__.getAddonInfo('version') # Module version
+__version__ = __addon__.getAddonInfo('version')  # Module version
 __scriptname__ = __addon__.getAddonInfo('name')
 __language__ = __addon__.getLocalizedString
 __profile__ = 
xbmc.translatePath(__addon__.getAddonInfo('profile')).decode("utf-8")
@@ -39,17 +40,21 @@ def normalizeString(str):
         'NFKD', unicode(unicode(str, 'utf-8'))
     ).encode('ascii', 'ignore')
 
+
 def clear_cache():
     cache.delete("tv-show%")
     xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__, 
__language__(32004))).encode('utf-8'))
 
+
 def log(module, msg):
     xbmc.log((u"### [%s] - %s" % (module, msg,)).encode('utf-8'), 
level=xbmc.LOGDEBUG)
 
+
 def get_cache_key(prefix="", str=""):
     str = re.sub('\W+', '_', str).lower()
     return prefix + str
 
+
 class SubscenterHelper:
     BASE_URL = "http://www.subscenter.org";
 
@@ -59,6 +64,7 @@ class SubscenterHelper:
     def get_subtitle_list(self, item):
         search_results = self._search(item)
         results = self._build_subtitle_list(search_results, item)
+
         return results
 
     # return list of movies / tv-series from the site`s search
@@ -66,42 +72,44 @@ class SubscenterHelper:
         results = []
 
         search_string = re.split(r'\s\(\w+\)$', item["tvshow"])[0] if 
item["tvshow"] else item["title"]
-        
+
         if item["tvshow"]:
             cache_key = get_cache_key("tv-show_", search_string)
             results = cache.get(cache_key)
             if results:
                 results = eval(results)
-            
+
         if not results:
             query = {"q": search_string.lower()}
             search_result = self.urlHandler.request(self.BASE_URL + 
"/he/subtitle/search/?" + urllib.urlencode(query))
             if search_result is None:
-                return results # return empty set
+                return results  # return empty set
 
             urls = re.findall('<a 
href=".*/he/subtitle/(movie|series)/([^/]+)/">[^/]+ / ([^<]+)</a>', 
search_result)
             years = re.findall(u'<span class="special">[^:]+: 
</span>(\d{4}).<br />', search_result)
             for i, url in enumerate(urls):
-                year = years[i] if len(years)>i else ''
+                year = years[i] if len(years) > i else ''
                 urls[i] += (year,)
+
             results = self._filter_urls(urls, search_string, item)
-            
+
             if item["tvshow"] and results:
                 cache.set(cache_key, repr(results))
-            
+
         return results
 
 
     def _filter_urls(self, urls, search_string, item):
         filtered = []
         search_string = search_string.lower()
-
+        h = HTMLParser.HTMLParser()
         for i, (content_type, slug, eng_name, year) in enumerate(urls):
+            eng_name = h.unescape(eng_name)
             if ((content_type == "movie" and not item["tvshow"]) or
                     (content_type == "series" and item["tvshow"])) and \
                     search_string.startswith(eng_name.replace(' ...', 
'').lower()) and \
                     (item["year"] == '' or
-                    year == '' or
+                             year == '' or
                                  (int(year) - 1) <= int(item["year"]) <= 
(int(year) + 1) or
                                  (int(item["year"]) - 1) <= int(year) <= 
(int(item["year"]) + 1)):
                 filtered.append({"type": content_type, "name": eng_name, 
"slug": slug, "year": year})
@@ -139,7 +147,7 @@ class SubscenterHelper:
                                          'sync': subtitle_rate >= 4,
                                          'hearing_imp': 
current["hearing_impaired"] > 0
                                         })
-            # Fix the rating
+        # Fix the rating
         if total_downloads:
             for it in ret:
                 it["rating"] = str(int(round(it["rating"] / 
float(total_downloads), 1) * 5))
@@ -154,7 +162,7 @@ class SubscenterHelper:
         file_name = re.sub('\W+', '.', file_name).lower()
         folder_name = re.sub('\W+', '.', folder_name).lower()
         log(__scriptname__, "# Comparing Releases:\n [subtitle-rls] %s \n 
[filename-rls] %s \n [folder-rls] %s" % (
-        subsfile, file_name, folder_name))
+            subsfile, file_name, folder_name))
 
         subsfile = subsfile.split('.')
         file_name = file_name.split('.')[:-1]
@@ -228,19 +236,4 @@ class URLHandler():
         except Exception as e:
             log(__scriptname__, "Failed to get url: %s\n%s" % (url, e))
             # Second parameter is the filename
-        return content
-
-
-# item = {'episode': '11', 'temp': False, 'title': '', 'season': '11', 'year': 
'', 'rar': False,
-#        'tvshow': 'Two and a Half Men',
-#        'file_original_path': 
u'D:\\Videos\\Series\\Two.and.a.Half.Men\\Season 
11\\Two.and.a.Half.Men.S11E13.480p.HDTV.X264-DIMENSION.mkv',
-#       '3let_language': ['en', 'he']}
-# # item = {'episode': '', 'temp': False, 'title': 'Broken Arrow', 'season': 
'', 'year': '1997', 'rar': False, 'tvshow': '',
-# #         'file_original_path': u'D:\\Videos\\Movies\\Broken Arrow 
(1996)\\Broken-Arrow_720p BluRay,,DTS.x264-CDDHD.mp4',
-# #         '3let_language': ['en', 'he']}
-# # {'episode': '4', 'temp': False, 'title': 'Killer Within', 'season': '3', 
'year': '', 'rar': False, 'tvshow': 'The Walking Dead', 'file_original_path': 
u'D:\\Videos\\Series\\The.Walking.Dead\\Season 
3\\The.Walking.Dead.S03E04.720p.HDTV.x264-IMMERSE.mkv', '3let_language': 
['eng', 'heb']}
-# item = {'episode': '', 'temp': False, 'title': 'Free Birds', 'season': '', 
'year': '2013', 'rar': False, 'tvshow': '',
-#         'file_original_path': 
u'D:\\Videos\\Movies\\Free.Birds.2013.1080p.BRRip.x264-YIFY\\FB13.1080p.BRRip.x264-YIFY.mp4',
-#         '3let_language': ['en', 'he']}
-# helper = SubscenterHelper()
-# helper.get_subtitle_list(item)
+        return content
\ No newline at end of file

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=2e11832a5beb1f019ca3c2c49acfa5e6e2aea0fd

commit 2e11832a5beb1f019ca3c2c49acfa5e6e2aea0fd
Author: sphere <[email protected]>
Date:   Mon Mar 24 10:34:30 2014 +0100

    [service.subtitles.subtitle] updated to version 4.1.5

diff --git a/service.subtitles.subtitle/addon.xml 
b/service.subtitles.subtitle/addon.xml
index 7720a60..f17d92b 100644
--- a/service.subtitles.subtitle/addon.xml
+++ b/service.subtitles.subtitle/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="service.subtitles.subtitle"
        name="Subtitle.co.il"
-       version="4.1.4"
+       version="4.1.5"
        provider-name="CaTz">
     <requires>
         <import addon="xbmc.python" version="2.14.0"/>
diff --git a/service.subtitles.subtitle/changelog.txt 
b/service.subtitles.subtitle/changelog.txt
index 45097ca..15df192 100644
--- a/service.subtitles.subtitle/changelog.txt
+++ b/service.subtitles.subtitle/changelog.txt
@@ -1,3 +1,6 @@
+4.1.5 - By CaTz 23/03/2014
+- Bug fix, handle HTML entities in the content show of the website
+
 4.1.4 - by sagiben 14/03/2014
 - Remove msvc9compiler import to support non Windows OS
 - Change python version for Gotham
diff --git a/service.subtitles.subtitle/resources/lib/SUBUtilities.py 
b/service.subtitles.subtitle/resources/lib/SUBUtilities.py
index 864980d..3aa8d8d 100644
--- a/service.subtitles.subtitle/resources/lib/SUBUtilities.py
+++ b/service.subtitles.subtitle/resources/lib/SUBUtilities.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+import HTMLParser
 import cookielib
 import os
 import re
@@ -135,8 +136,11 @@ class SubtitleHelper:
         filtered = []
         search_string = search_string.lower()
 
+        h = HTMLParser.HTMLParser()
+
         if not item["tvshow"]:
             for (id, eng_name, year) in urls:
+                eng_name = h.unescape(eng_name)
                 if search_string.startswith(eng_name.lower()) and \
                         (item["year"] == '' or
                                  year == '' or
@@ -145,6 +149,7 @@ class SubtitleHelper:
                     filtered.append({"name": eng_name, "id": id, "year": year})
         else:
             for (id, eng_name) in urls:
+                eng_name = h.unescape(eng_name)
                 if search_string.startswith(eng_name.lower()):
                     filtered.append({"name": eng_name, "id": id})
 
@@ -380,25 +385,4 @@ class URLHandler():
         return content
 
     def save_cookie(self):
-        self.cookie_jar.save()
-
-        # item = {'episode': '11', 'temp': False, 'title': '', 'season': '11', 
'year': '', 'rar': False,
-        #         'tvshow': 'Two and a Half Men',
-        #         'file_original_path': 
u'D:\\Videos\\Series\\Two.and.a.Half.Men\\Season 
11\\Two.and.a.Half.Men.S11E13.480p.HDTV.X264-DIMENSION.mkv',
-        #         '3let_language': ['en', 'he']}
-        # item = {'episode': '', 'temp': False, 'title': 'Her', 'season': '', 
'year': '2014', 'rar': False, 'tvshow': '',
-        #         'file_original_path': 
u'D:\\Videos\\Movies\\Her\\Her.2013.DVDScr.XviD-SaM.mp4',
-        #         '3let_language': ['en', 'he']}
-        # # {'episode': '4', 'temp': False, 'title': 'Killer Within', 
'season': '3', 'year': '', 'rar': False, 'tvshow': 'The Walking Dead', 
'file_original_path': u'D:\\Videos\\Series\\The.Walking.Dead\\Season 
3\\The.Walking.Dead.S03E04.720p.HDTV.x264-IMMERSE.mkv', '3let_language': 
['eng', 'heb']}
-        # item = {'episode': '', 'temp': False, 'title': 'Free Birds', 
'season': '', 'year': '2013', 'rar': False, 'tvshow': '',
-        #         'file_original_path': 
u'D:\\Videos\\Movies\\Free.Birds.2013.1080p.BRRip.x264-YIFY\\FB13.1080p.BRRip.x264-YIFY.mp4',
-        #         '3let_language': ['en', 'he']}
-
-
-        # item = {'episode': '11', 'temp': False, 'title': 'Blind Spot', 
'season': '2', 'year': '', 'rar': False,
-        #         'tvshow': 'Arrow',
-        #         'file_original_path': u'D:\\Videos\\Series\\Arrow\\Season  
2\\Arrow.S02E11.720p.HDTV.X264-DIMENSION.mkv',
-        #         '3let_language': ['en', 'he']}
-        # helper = SubtitleHelper()
-        # print helper.get_subtitle_list(item)
-        # print helper.login()
+        self.cookie_jar.save()
\ No newline at end of file

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

Summary of changes:
 service.subtitles.subscenter/addon.xml             |    2 +-
 service.subtitles.subscenter/changelog.txt         |    3 +
 .../resources/lib/SUBUtilities.py                  |   49 ++++++++-----------
 service.subtitles.subtitle/addon.xml               |    2 +-
 service.subtitles.subtitle/changelog.txt           |    3 +
 .../resources/lib/SUBUtilities.py                  |   28 ++---------
 6 files changed, 35 insertions(+), 52 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/13534_NeoTech
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to