From 576246146afafdae4fdc5ac62d9d5b5f0409efdd Mon Sep 17 00:00:00 2001 From: amet Date: Thu, 18 Aug 2011 14:09:19 +0400 Subject: [PATCH] Fixed tvshows with year in name, ex. Castle (2009). --- .../resources/lib/services/Napisy.me/service.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script.xbmc.subtitles/resources/lib/services/Napisy.me/service.py b/script.xbmc.subtitles/resources/lib/services/Napisy.me/service.py index a030665b..383e5e19 100644 --- a/script.xbmc.subtitles/resources/lib/services/Napisy.me/service.py +++ b/script.xbmc.subtitles/resources/lib/services/Napisy.me/service.py @@ -6,9 +6,10 @@ # Credits to amet, Guilherme Jardim, and many more. # mrto -import urllib2, re, string, xbmc, sys, os, time +import urllib2, re, string, xbmc, sys, os from utilities import log, languageTranslate + _ = sys.modules[ "__main__" ].__language__ main_url = "http://napisy.me/search.php?str=" @@ -47,6 +48,12 @@ def search_subtitles( file_original_path, title, tvshow, year, season, episode, subtitles_list = [] msg = "" if len(tvshow) > 0: + for rok in re.finditer(' \(\d\d\d\d\)', tvshow): + rok = rok.group() + if len(rok) > 0: + tvshow = tvshow.replace(rok, "") + else: + continue tvshow_plus = tvshow.replace(" ","+") if len(season) < 2: season_full = '0%s' % (season)