1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

tv4play: wrong user/passwd crashes the script.

exception handling cant handle unicode on py2
This commit is contained in:
Johan Andersson 2016-03-20 18:35:53 +01:00
parent a32074dbbe
commit 260bd6c5c6

View File

@ -204,7 +204,10 @@ class Tv4play(Service, OpenGraphThumbMixin):
self.cookies = data.cookies
fail = re.search("<p class='failed-login'>([^<]+)</p>", data.text)
if fail:
return ServiceError(fail.group(1))
message = fail.group(1)
if is_py2:
message = message.encode("utf8")
return ServiceError(message)
return True