Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for LegendasDivx, LegendasZone and Ondertitel search pattern.

  • Loading branch information...
commit eca949be44af380460f9b9995d6d27bd8dfc3589 1 parent 3a0b7f0
@highlandr highlandr authored
View
8 script.xbmc.subtitles/resources/lib/services/LegendasDivx/service.py
@@ -153,8 +153,8 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
url = main_url + "modules.php?name=Downloads&file=jz&d_op=search_next&order=&form_cat=30&page=" + str(page) + "&query=" + urllib.quote_plus(searchstring)
elif languageshort == "en":
url = main_url + "modules.php?name=Downloads&file=jz&d_op=search_next&order=&form_cat=31&page=" + str(page) + "&query=" + urllib.quote_plus(searchstring)
-# else:
-# url = main_url + "index.php"
+ else:
+ url = main_url + "index.php"
content = geturl(url)
log( __name__ ,"%s Getting '%s' subs ..." % (debug_pretext, languageshort))
@@ -224,8 +224,8 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
url = main_url + "modules.php?name=Downloads&file=jz&d_op=search_next&order=&form_cat=30&page=" + str(page) + "&query=" + urllib.quote_plus(searchstring)
elif languageshort == "en":
url = main_url + "modules.php?name=Downloads&file=jz&d_op=search_next&order=&form_cat=31&page=" + str(page) + "&query=" + urllib.quote_plus(searchstring)
-# else:
-# url = main_url + "index.php"
+ else:
+ url = main_url + "index.php"
content = geturl(url)
View
36 script.xbmc.subtitles/resources/lib/services/LegendasZone/service.py
@@ -102,7 +102,11 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
page = 0
if languageshort == "pb":
languageshort = "br"
- url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ #url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ if languageshort == "pt" or languageshort == "br" or languageshort == "en" or languageshort == "es":
+ url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ else:
+ url = main_url + "index.php"
content = opener.open(url)
#log( __name__ ,"%s Content: '%s'" % (debug_pretext, content))
@@ -174,7 +178,11 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
page = page + 1
if languageshort == "br":
languageshort = "pb"
- url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+# url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ if languageshort == "pt" or languageshort == "br" or languageshort == "en" or languageshort == "es":
+ url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ else:
+ url = main_url + "index.php"
content = opener.open(url)
content = content.read().decode('latin1')
#For DEBUG only uncomment next line
@@ -183,7 +191,11 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
page = 0
if languageshort == "pb":
languageshort = "br"
- url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ if languageshort == "pt" or languageshort == "br" or languageshort == "en" or languageshort == "es":
+ url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ else:
+ url = main_url + "index.php"
+ #url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
content = opener.open(url)
content = content.read().decode('latin1')
maxsubs = re.findall(multiple_results_pattern, content, re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE)
@@ -197,7 +209,11 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
page1 = 0
if languageshort == "pb":
languageshort = "br"
- content1 = opener.open(main_url + "legendas.php?l=" + languageshort + "&imdb=" + imdb + "&page=" + str(page1))
+ if languageshort == "pt" or languageshort == "br" or languageshort == "en" or languageshort == "es":
+ content1 = opener.open(main_url + "legendas.php?l=" + languageshort + "&imdb=" + imdb + "&page=" + str(page1))
+ else:
+ content1 = main_url + "index.php"
+ #content1 = opener.open(main_url + "legendas.php?l=" + languageshort + "&imdb=" + imdb + "&page=" + str(page1))
content1 = content1.read()
content1 = content1.decode('latin1')
while re.search(subtitle_pattern, content1, re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE) and page1 == 0:
@@ -263,12 +279,20 @@ def getallsubs(searchstring, languageshort, languagelong, file_original_path, su
languageshort = "pb"
subtitles_list.append({'rating': str(downloads), 'no_files': no_files, 'id': id, 'filename': filename, 'desc': desc, 'sync': sync, 'hits' : hits, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name': languagelong})
page1 = page1 + 1
- content1 = opener.open(main_url + "legendas.php?l=" + languageshort + "&imdb=" + imdb + "&page=" + str(page1))
+ if languageshort == "pt" or languageshort == "br" or languageshort == "en" or languageshort == "es":
+ content1 = opener.open(main_url + "legendas.php?l=" + languageshort + "&imdb=" + imdb + "&page=" + str(page1))
+ else:
+ content1 = main_url + "index.php"
+ #content1 = opener.open(main_url + "legendas.php?l=" + languageshort + "&imdb=" + imdb + "&page=" + str(page1))
content1 = content1.read().decode('latin1')
page = page + 1
if languageshort == "pb":
languageshort = "br"
- url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ #url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ if languageshort == "pt" or languageshort == "br" or languageshort == "en" or languageshort == "es":
+ url = main_url + "legendas.php?l=" + languageshort + "&page=" + str(page) + "&s=" + urllib.quote_plus(searchstring)
+ else:
+ url = main_url + "index.php"
content = opener.open(url)
content = content.read().decode('latin1')
################### IMDB DISABLED FOR NOW #######################################
View
8 script.xbmc.subtitles/resources/lib/services/Ondertitel/service.py
@@ -18,8 +18,12 @@
<a href="/ondertitels/info/(500)-Days-of-Summer/44032.html" title="ondertitel (500) Days of Summer" style="color: #000;">(500) Days of Summer</a></strong> <img src="/images/nederlandse_vlag.jpg" height="11" width="18"></div> <div style="float:left;"><a href="http://www.imdb.com/title/tt1022603/" target="_blank"><img src="/images/imdb_logo.gif" border="0"></a> </div><br clear="both"></div>
<div style="width: 490px; overflow:hidden; overflow:hidden"><font style="font-size: 11px; color: #444445;"><i>500.Days.of.Summer.2009.720p.BluRay.DTS.x264-WiKi</i></font><br></div>
"""
-subtitle_pattern = "<a href=\"(/ondertitels/info/[^/\n\r\t]+/\d+?\.html)\" title=\"[^/\n\r\t]+\" style=\"color: #000;\">[^\n\r\t]*?[\n\r\t]+\
-<div style=\"width: 490px; overflow:hidden; overflow:hidden\"><font style=\"font-size: 11px; color: #444445;\"><i>([^\n\r\t<]+?)</i></font><br></div>"
+### Old pattern.
+#subtitle_pattern = "<a href=\"(/ondertitels/info/[^/\n\r\t]+/\d+?\.html)\" title=\"[^/\n\r\t]+\" style=\"color: #000;\">[^\n\r\t]*?[\n\r\t]+\
+#<div style=\"width: 490px; overflow:hidden; overflow:hidden\"><font style=\"font-size: 11px; color: #444445;\"><i>([^\n\r\t<]+?)</i></font><br></div>"
+
+### HTML in the search results changed. This pattern fix it. ###
+subtitle_pattern = "<a href=\"(/ondertitels/info/.+?.html)\" style=\"color: #161616;\">.+?[\r\n\t].+?<i>(.+?)</i></font></div>"
# group(1) = link, group(2) = filename
Please sign in to comment.
Something went wrong with that request. Please try again.