Commit 35df2583 authored by richardARPANET's avatar richardARPANET

fix title_exists

parent d76c715d
...@@ -7,6 +7,8 @@ Release History ...@@ -7,6 +7,8 @@ Release History
++++++++++++++++++ ++++++++++++++++++
- Python 2.x setup.py bugfix. - Python 2.x setup.py bugfix.
- Bugfix for ``title_exists`` method returning ``None``.
- Bugfix for ``get_title`` raising an incorrect exception when redirection title.
5.4.3 (2018-04-05) 5.4.3 (2018-04-05)
......
...@@ -103,9 +103,9 @@ class Imdb(Auth): ...@@ -103,9 +103,9 @@ class Imdb(Auth):
def title_exists(self, imdb_id): def title_exists(self, imdb_id):
self.validate_imdb_id(imdb_id) self.validate_imdb_id(imdb_id)
page_url = 'http://www.imdb.com/title/{0}/'.format(imdb_id) page_url = 'https://www.imdb.com/title/{0}/'.format(imdb_id)
response = self.session.head(page_url) response = self.session.get(page_url, allow_redirects=False)
if response.status_code == httplib.OK: if response.status_code == httplib.OK:
return True return True
...@@ -298,8 +298,8 @@ class Imdb(Auth): ...@@ -298,8 +298,8 @@ class Imdb(Auth):
def is_redirection_title(self, imdb_id): def is_redirection_title(self, imdb_id):
self.validate_imdb_id(imdb_id) self.validate_imdb_id(imdb_id)
page_url = 'http://www.imdb.com/title/{0}/'.format(imdb_id) page_url = 'https://www.imdb.com/title/{0}/'.format(imdb_id)
response = self.session.head(page_url) response = self.session.get(page_url, allow_redirects=False)
if response.status_code == httplib.MOVED_PERMANENTLY: if response.status_code == httplib.MOVED_PERMANENTLY:
return True return True
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment