Skip to content

Commit

Permalink
2.0.9
Browse files Browse the repository at this point in the history
- fixed: Addic7ed languages, would fail on Chinese (Traditional) and Chinese (Simplified).
  • Loading branch information
amet committed Nov 3, 2010
1 parent 23ac602 commit a13bee4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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.0.8"
version="2.0.9"
provider-name="Amet">
<requires>
<import addon="xbmc.python" version="1.0"/>
Expand Down
3 changes: 3 additions & 0 deletions script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,6 @@
2.0.9
- fixed: Addic7ed languages, would fail on Chinese (Traditional) and Chinese (Simplified).

2.0.8
- fix: Arabic had incorrect two letter code(would crash podnapisi search)
- added: "# -*- coding: utf-8 -*-" for Python 2.5+ compatibility
Expand Down
12 changes: 8 additions & 4 deletions script.xbmc.subtitles/resources/lib/services/Addic7ed/service.py
Expand Up @@ -30,7 +30,10 @@ def query_TvShow(name, season, episode, file_original_path, langs):
hashed = True
else:
hashed = False
lang = toOpenSubtitles_two(langs_html.string.strip())
try:
lang = toOpenSubtitles_two(langs_html.string.strip())
except:
lang = ""
statusTD = langs_html.findNext("td")
status = statusTD.find("strong").string.strip()
link = "%s%s"%(self_host,statusTD.findNext("td").find("a")["href"])
Expand All @@ -48,16 +51,17 @@ def query_Film(name, file_original_path,year, langs):
content = content.replace("The safer, easier way", "The safer, easier way \" />")
soup = BeautifulSoup(content)
for subs in soup("td", {"class":"NewsTitle", "colspan" : "3"}):
print subs
langs_html = subs.findNext("td", {"class" : "language"})
print langs_html
subteams = self_release_pattern.match(str(subs.contents[1])).groups()[0].lower()
file_name = os.path.basename(file_original_path).lower()
if (file_name.find(str(subteams))) > -1:
hashed = True
else:
hashed = False
lang = toOpenSubtitles_two(str(langs_html.string.strip()))
try:
lang = toOpenSubtitles_two(langs_html.string.strip())
except:
lang = ""
statusTD = langs_html.findNext("td")
status = statusTD.find("strong").string.strip()
link = "%s%s"%(self_host,statusTD.findNext("td").find("a")["href"])
Expand Down
4 changes: 2 additions & 2 deletions script.xbmc.subtitles/resources/lib/utilities.py
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import sys
import os
import xbmc
Expand Down Expand Up @@ -166,6 +164,8 @@ def toOpenSubtitles_two( id ):
u"Spanish (Latin America)" : "es",
u"Español" : "es",
u"Spanish (Spain)" : "es",
u"Chinese (Traditional)" : "zh",
u"Chinese (Simplified)" : "zh",
"All" : "all"
}
return languages[ id ]
Expand Down

0 comments on commit a13bee4

Please sign in to comment.