accepting no valid xml in response as missing subtitles

This commit is contained in:
Paweł Płazieński 2016-03-07 00:00:55 +01:00
parent 2de212873d
commit 71b4e37d2d

4
napi
View file

@ -55,7 +55,9 @@ for movie_filename in args:
response = urllib.urlopen(base_url, request_data) response = urllib.urlopen(base_url, request_data)
response_data = response.read() response_data = response.read()
response_xml = XML(response_data) response_xml = XML(response_data)
if response_xml.find('status').text != 'success':
response_status = response_xml.find('status')
if response_status is None or response_status.text != 'success':
print "%s: No subtitles found" % (movie_filename,) print "%s: No subtitles found" % (movie_filename,)
continue continue