From 8ea7184f79c54b43dbd8bb80ed4c05d59ed423c0 Mon Sep 17 00:00:00 2001 From: djoole Date: Mon, 28 Oct 2013 10:53:39 +0100 Subject: [PATCH 1/6] Update Podnapisi.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Podnapisi plugins wasn't finding the exact subtitles because it wasn't taking into account the release team. I made some changes to improve the search results (use of sTS, sTE and sR options) Moreover, file download didn't work for French user because Podnapisi site detect the local language and changes the img title as "Télécharger" instead of "Download". --- periscope/plugins/Podnapisi.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/periscope/plugins/Podnapisi.py b/periscope/plugins/Podnapisi.py index cbd420a..56c2d02 100644 --- a/periscope/plugins/Podnapisi.py +++ b/periscope/plugins/Podnapisi.py @@ -77,15 +77,26 @@ def query(self, token, langs=None): else: params["sJ"] = 0 - searchurl = self.host + self.search + urllib.urlencode(params) + sK = params["sK"] + sJ = params["sJ"] + sTS = str(guessedData["season"]) + sTE = str(guessedData["episode"]) + teams = guessedData["teams"] + sR = "" + for team in teams: + sR = sR + "+" + team + sR = sR.replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") + options = "&sK=" + sK + "&sJ=" + sJ + "&sTS=" + sTS + "&sTE=" + sTE + "&sR=" + sR + + searchurl = self.host + self.search + options content = self.downloadContent(searchurl, 10) # Workaround for the Beautifulsoup 3.1 bug content = content.replace("scr'+'ipt", "script") soup = BeautifulSoup(content) for subs in soup("tr", {"class":"a"}) + soup("tr", {"class": "b"}): - details = subs.find("span", {"class" : "opis"}).findAll("b") - if guessedData["type"] == "tvshow" and guessedData["season"] == int(details[0].text) and guessedData["episode"] == int(details[1].text): + details = subs.find("td").findAll("b") + if guessedData["type"] == "tvshow" and guessedData["season"] == int(details[1].text) and guessedData["episode"] == int(details[2].text): links = subs.findAll("a") lng = subs.find("a").find("img")["src"].rsplit("/", 1)[1][:-4] if langs and not self.getLG(lng) in langs: @@ -117,6 +128,8 @@ def createFile(self, subtitle): content = content.replace(" Date: Mon, 28 Oct 2013 11:50:29 +0100 Subject: [PATCH 2/6] Update Podnapisi.py --- periscope/plugins/Podnapisi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/periscope/plugins/Podnapisi.py b/periscope/plugins/Podnapisi.py index 56c2d02..0637c11 100644 --- a/periscope/plugins/Podnapisi.py +++ b/periscope/plugins/Podnapisi.py @@ -85,7 +85,7 @@ def query(self, token, langs=None): sR = "" for team in teams: sR = sR + "+" + team - sR = sR.replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") + sR = sR.replace("+hd-", "").replace("+tv-", "").replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") options = "&sK=" + sK + "&sJ=" + sJ + "&sTS=" + sTS + "&sTE=" + sTE + "&sR=" + sR searchurl = self.host + self.search + options From fa1907e938dd5e16d023225dce25e42d4d78cc63 Mon Sep 17 00:00:00 2001 From: djoole Date: Mon, 28 Oct 2013 12:29:29 +0100 Subject: [PATCH 3/6] Update Podnapisi.py --- periscope/plugins/Podnapisi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/periscope/plugins/Podnapisi.py b/periscope/plugins/Podnapisi.py index 0637c11..aa0ae5e 100644 --- a/periscope/plugins/Podnapisi.py +++ b/periscope/plugins/Podnapisi.py @@ -85,7 +85,7 @@ def query(self, token, langs=None): sR = "" for team in teams: sR = sR + "+" + team - sR = sR.replace("+hd-", "").replace("+tv-", "").replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") + sR = sR.replace("+hd-", "").replace("+hd", "").replace("+tv-", "").replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") options = "&sK=" + sK + "&sJ=" + sJ + "&sTS=" + sTS + "&sTE=" + sTE + "&sR=" + sR searchurl = self.host + self.search + options From 40783d31481a19625cba3a4aa2bd9b9d2b80f0e6 Mon Sep 17 00:00:00 2001 From: djoole Date: Mon, 28 Oct 2013 22:22:57 +0100 Subject: [PATCH 4/6] Update Podnapisi.py --- periscope/plugins/Podnapisi.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/periscope/plugins/Podnapisi.py b/periscope/plugins/Podnapisi.py index aa0ae5e..4147b75 100644 --- a/periscope/plugins/Podnapisi.py +++ b/periscope/plugins/Podnapisi.py @@ -71,14 +71,16 @@ def query(self, token, langs=None): ''' makes a query on podnapisi and returns info (link, lang) about found subtitles''' guessedData = self.guessFileData(token) sublinks = [] - params = {"sK" : token} if langs and len(langs) == 1: - params["sJ"] = self.getLanguage(langs[0]) + sJ = self.getLanguage(langs[0]) else: - params["sJ"] = 0 + sJ = 0 + sK = guessedData["name"].replace(" ", ".") + + #Series name adaptation + if sK == "once.upon.a.time.2011": + sK = "once.upon.a.time" - sK = params["sK"] - sJ = params["sJ"] sTS = str(guessedData["season"]) sTE = str(guessedData["episode"]) teams = guessedData["teams"] @@ -86,6 +88,12 @@ def query(self, token, langs=None): for team in teams: sR = sR + "+" + team sR = sR.replace("+hd-", "").replace("+hd", "").replace("+tv-", "").replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") + if "dimension" in sR: + sR += "+lol+sys" + if "immerse" in sR: + sR += "+xii+asap" + if "orenji" in sR: + sR += "+fqm" options = "&sK=" + sK + "&sJ=" + sJ + "&sTS=" + sTS + "&sTE=" + sTE + "&sR=" + sR searchurl = self.host + self.search + options From f3a54cd6dc15db1b6119bc3588575deb16442fe7 Mon Sep 17 00:00:00 2001 From: djoole Date: Mon, 28 Oct 2013 23:01:37 +0100 Subject: [PATCH 5/6] Update Podnapisi.py --- periscope/plugins/Podnapisi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/periscope/plugins/Podnapisi.py b/periscope/plugins/Podnapisi.py index 4147b75..032228c 100644 --- a/periscope/plugins/Podnapisi.py +++ b/periscope/plugins/Podnapisi.py @@ -87,7 +87,7 @@ def query(self, token, langs=None): sR = "" for team in teams: sR = sR + "+" + team - sR = sR.replace("+hd-", "").replace("+hd", "").replace("+tv-", "").replace("720p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("bluray", "").replace("x264", "") + sR = sR.replace("+hd-", "").replace("+hd", "").replace("+tv-", "").replace("720p-", "").replace("1080p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("1080p", "").replace("bluray", "").replace("x264", "") if "dimension" in sR: sR += "+lol+sys" if "immerse" in sR: From 9961aaac47d5585feb733c83537c3705b6dd125d Mon Sep 17 00:00:00 2001 From: djoole Date: Thu, 7 Nov 2013 22:54:22 +0100 Subject: [PATCH 6/6] Update Podnapisi.py --- periscope/plugins/Podnapisi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/periscope/plugins/Podnapisi.py b/periscope/plugins/Podnapisi.py index 032228c..6e10377 100644 --- a/periscope/plugins/Podnapisi.py +++ b/periscope/plugins/Podnapisi.py @@ -87,7 +87,7 @@ def query(self, token, langs=None): sR = "" for team in teams: sR = sR + "+" + team - sR = sR.replace("+hd-", "").replace("+hd", "").replace("+tv-", "").replace("720p-", "").replace("1080p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").replace("1080p", "").replace("bluray", "").replace("x264", "") + sR = sR.replace("-", "+").replace("+hd-", "").replace("+hd", "").replace("+tv-", "").replace("720p-", "").replace("1080p-", "").replace("bluray-", "").replace("x264-", "").replace("720p", "").repl if "dimension" in sR: sR += "+lol+sys" if "immerse" in sR: