]> git.bitcoin.ninja Git - youtube-dl/commitdiff
replace urlencode.encode with urlencode_postdata
authorsprhawk <465558+sprhawk@users.noreply.github.com>
Fri, 29 Dec 2017 17:08:56 +0000 (01:08 +0800)
committersprhawk <465558+sprhawk@users.noreply.github.com>
Fri, 29 Dec 2017 17:08:56 +0000 (01:08 +0800)
youtube_dl/extractor/weibo.py

index 2be31fe771260efd1cc8d760df4ef46a19ade5ab..0b28952c9d62bd8c5c04cd26bf86113c73d8871f 100644 (file)
@@ -8,11 +8,11 @@ import random
 import re
 
 from ..compat import (
-    compat_urllib_parse_urlencode,
     compat_urlparse,
 )
 from ..utils import (
     js_to_json,
+    urlencode_postdata,
 )
 
 
@@ -44,10 +44,10 @@ class WeiboIE(InfoExtractor):
             "screenInfo": "1440*900*24",
             "plugins": ""
         }
-        data = compat_urllib_parse_urlencode({
+        data = urlencode_postdata({
             "cb": "gen_callback",
             "fp": json.dumps(fp),
-        }).encode()
+        })
 
         genvisitor_url = 'https://passport.weibo.com/visitor/genvisitor'
         webpage, _ = self._download_webpage_handle(genvisitor_url, video_id, data=data, headers=headers, note="gen visitor")