]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[tennistv] Correctly encode POST parameters
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 14 Mar 2018 10:23:09 +0000 (11:23 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 14 Mar 2018 10:23:10 +0000 (11:23 +0100)
In python 3.x, the POST parameters must be bytes, not str.

ChangeLog
youtube_dl/extractor/tennistv.py

index f2f0d6143b648e45369a85003659a8734e4c5716..ad639c8053db729e7e9e41453f0ada116649cd9b 100644 (file)
--- 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
 
index 601a17e57d96d2937f74cf6cfa57640f1d45be51..def29b6fa0ecbae4a45f8c13023b2c53469ab9cb 100644 (file)
@@ -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)