Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make Subscene handle hearing impaired

Instead of ignoring subtitles for the
hearing impaired, mark them as hearing
impaired and append them to the search
result.
  • Loading branch information...
commit 74246770bd3fdce87891397394aac6748afc420e 1 parent c703de3
@MartinWallgren MartinWallgren authored
View
9 script.xbmc.subtitles/resources/lib/services/Subscene/service.py
@@ -38,8 +38,8 @@
"""
subtitle_pattern = "..<tr>.{5}<td>.{6}<a class=\"a1\" href=\"/([^\n\r]{10,200}?-\d{3,10}.aspx)\" title=\"[^\n\r]{10,200}\">\
[\r\n\t ]+?<span class=\"r(0|100)\" >[\r\n\t\ ]+([^\r\n\t]+?) [\r\n\t]+</span>[\r\n\t ]+?<span id=\"r\d+\">([^\r\n\t]{5,500})</span>\
-[\r\n\t]+?</a>[\r\n\t ]+?</td>[\r\n\t ]+?<td class=\"a3\">1[\r\n\t\ ]+?</td>[\r\n\t\ ]+?<td>(?!<div id=imgEar)"
-# group(1) = downloadlink, group(2) = qualitycode, group(3) = language, group(4) = filename
+[\r\n\t]+?</a>[\r\n\t ]+?</td>[\r\n\t ]+?<td class=\"a3\">1[\r\n\t\ ]+?</td>[\r\n\t\ ]+?<td>(|.{52})\r\n\t\t\t</td>"
+# group(1) = downloadlink, group(2) = qualitycode, group(3) = language, group(4) = filename, group(5) = hearing impaired
# movie/seasonfound pattern example:
@@ -114,15 +114,16 @@ def getallsubs(response_url, content, language, title, subtitles_list, search_st
link = main_url + matches.group(1)
languageshort = languageTranslate(language,0,2)
filename = matches.group(4)
+ hearing_imp = len(matches.group(5)) > 0
if search_string != "":
log( __name__ , "string.lower(filename) = >" + string.lower(filename) + "<" )
log( __name__ , "string.lower(search_string) = >" + string.lower(search_string) + "<" )
if string.find(string.lower(filename),string.lower(search_string)) > -1:
log( __name__ ,"%s Subtitles found: %s, %s" % (debug_pretext, languagefound, filename))
- subtitles_list.append({'rating': '0', 'movie': title, 'filename': filename, 'sync': False, 'link': link, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name': language})
+ subtitles_list.append({'rating': '0', 'movie': title, 'filename': filename, 'sync': False, 'link': link, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name': language, 'hearing_imp': hearing_imp})
else:
log( __name__ ,"%s Subtitles found: %s, %s" % (debug_pretext, languagefound, filename))
- subtitles_list.append({'rating': '0', 'movie': title, 'filename': filename, 'sync': False, 'link': link, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name': language})
+ subtitles_list.append({'rating': '0', 'movie': title, 'filename': filename, 'sync': False, 'link': link, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name': language, 'hearing_imp': hearing_imp})
def geturl(url):
Please sign in to comment.
Something went wrong with that request. Please try again.