commit e6e68069f6fe25fe4a2b72487be840ba2ec3c5c6
parent f3672ac522e85b3eae339a95d34f46e92d8ebaa3
Author: Philipp Hagemeister <phihag@phihag.de>
Date:   Wed, 14 Mar 2018 11:23:09 +0100

[tennistv] Correctly encode POST parameters

In python 3.x, the POST parameters must be bytes, not str.

Diffstat:
MChangeLog | 2+-
Myoutube_dl/extractor/tennistv.py | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -2,7 +2,7 @@ version <unreleased> Extractors + [line] Add support for tv.line.me (#9427) - ++ [tennistv] Add support for tennistv.com version 2018.03.10 diff --git a/youtube_dl/extractor/tennistv.py b/youtube_dl/extractor/tennistv.py @@ -40,7 +40,7 @@ class TennisTVIE(InfoExtractor): 'Email': username, 'Password': password, } - login_json = json.dumps(login_form) + login_json = json.dumps(login_form).encode('utf-8') headers = { 'content-type': 'application/json', 'Referer': 'https://www.tennistv.com/login', @@ -81,7 +81,7 @@ class TennisTVIE(InfoExtractor): 'videoID': internal_id, 'VideoUrlType': 'HLSV3', } - check_json = json.dumps(check_data) + check_json = json.dumps(check_data).encode('utf-8') check_result = self._download_json( 'https://www.tennistv.com/api/users/v1/entitlementchecknondiva', video_id, note='Checking video authorization', headers=headers, data=check_json)