Permalink
Browse files

- Fixed #2 : Crash when no subtitle found

  • Loading branch information...
1 parent de42c56 commit 047508061f2795193db09d9f4ebbb1c80e03d1dc Jérôme Renard committed Nov 17, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 fetchsubtitles.py
View
@@ -86,6 +86,11 @@ def downloadSubtitle(self, data):
subtitleLinks = div.findAll('a', {'href':re.compile('/subtitle-([\d]+).html')})
subtitleLink = self.findBestRated(subtitleLinks)
+
+ if subtitleLink is None:
+ print("No subtitle link found")
+ return False
+
downloadLink = subtitleLink['href'].replace('subtitle', 'download')
response = self._sendHTTPRequest("GET", downloadLink)

0 comments on commit 0475080

Please sign in to comment.