From: Arkadiusz Miśkiewicz Date: Wed, 13 Feb 2013 19:06:10 +0000 (+0100) Subject: - rel 3; downloaded files that have less than 20 lines are considered to be error... X-Git-Tag: auto/th/pynapi-0.18-4~1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=33a62f95d3afd65e4918448640f656ba6680de0c;p=packages%2Fpynapi.git - rel 3; downloaded files that have less than 20 lines are considered to be error messages rather than real subtitles (no proper error handling/error codes on napiprojekt server side). --- diff --git a/pynapi.py b/pynapi.py index c99d1e8..459118f 100644 --- a/pynapi.py +++ b/pynapi.py @@ -138,7 +138,7 @@ def get_subtitle(digest, lang="PL"): time.sleep(0.5) continue - if sub.startswith('NPc') or sub.find('Blad polaczenia z baza danych') != -1: + if len(sub.split('\n')) < 20: raise Exception('Subtitle NOT FOUND') repeat = 0 diff --git a/pynapi.spec b/pynapi.spec index 282fdaf..8c55f4e 100644 --- a/pynapi.spec +++ b/pynapi.spec @@ -2,7 +2,7 @@ Summary: pynapi - Movie Subtitle Downloader Summary(pl.UTF-8): pynapi - narzędzie do ściągania napisów do filmów Name: pynapi Version: 0.18 -Release: 2 +Release: 3 License: GPL v3+ Group: Applications/Multimedia Source0: pynapi.py