From f1c2048a32a33e7c81d20e0b5d7af2ae54ffec03 Mon Sep 17 00:00:00 2001 From: It's dura mato Date: Mon, 20 Apr 2020 22:55:35 +0100 Subject: [PATCH] Fix/privatehd login (#7991) * Fix privatehd's login when no connection * Fix cinemaz's login when no connection * Add changelog --- CHANGELOG.md | 4 ++-- medusa/providers/torrent/html/cinemaz.py | 3 +++ medusa/providers/torrent/html/privatehd.py | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d166c78e12..6da77c6aca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ ## Unreleased #### New Features -- Add Keep link as post processing method ([7986](https://github.com/pymedusa/Medusa/pull/7986)) +- Add Keep link as post processing method ([#7986](https://github.com/pymedusa/Medusa/pull/7986)) #### Improvements #### Fixes - +- Fixed PrivateHD and CinemaZ provider login ([#7991](https://github.com/pymedusa/Medusa/pull/7991)) ----- ## 0.3.15 (2020-04-13) diff --git a/medusa/providers/torrent/html/cinemaz.py b/medusa/providers/torrent/html/cinemaz.py index f0e3de3a0f..84abefd909 100644 --- a/medusa/providers/torrent/html/cinemaz.py +++ b/medusa/providers/torrent/html/cinemaz.py @@ -146,6 +146,9 @@ def login(self): return True login_html = self.session.get(self.urls['login']) + if not login_html or not login_html.text: + log.warning('Unable to connect to provider') + return False with BS4Parser(login_html.text, 'html5lib') as html: token = html.find('input', attrs={'name': '_token'}).get('value') diff --git a/medusa/providers/torrent/html/privatehd.py b/medusa/providers/torrent/html/privatehd.py index 35de0ce3dc..e2677a5957 100644 --- a/medusa/providers/torrent/html/privatehd.py +++ b/medusa/providers/torrent/html/privatehd.py @@ -148,6 +148,9 @@ def login(self): return True login_html = self.session.get(self.urls['login']) + if not login_html or not login_html.text: + log.warning('Unable to connect to provider') + return False with BS4Parser(login_html.text, 'html5lib') as html: token = html.find('input', attrs={'name': '_token'}).get('value')