diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-03-02 18:38:42 -0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-03-03 10:36:32 -0500 |
commit | c45f60d3f5914d7924e9940c504bd3443f2eb8de (patch) | |
tree | 17b974fdd296b96ec647ebe057b2438c02afd827 /youtube | |
parent | 60a6ddc5efdbcad42894d2340f30dfe4dd63020a (diff) | |
download | yt-local-c45f60d3f5914d7924e9940c504bd3443f2eb8de.tar.lz yt-local-c45f60d3f5914d7924e9940c504bd3443f2eb8de.tar.xz yt-local-c45f60d3f5914d7924e9940c504bd3443f2eb8de.zip |
util.py: Encode data using utf-8, not ascii
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/util.py b/youtube/util.py index 3d5d030..1142c1d 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -236,9 +236,9 @@ def fetch_url_response(url, headers=(), timeout=15, data=None, if data is not None: method = "POST" if isinstance(data, str): - data = data.encode('ascii') + data = data.encode('utf-8') elif not isinstance(data, bytes): - data = urllib.parse.urlencode(data).encode('ascii') + data = urllib.parse.urlencode(data).encode('utf-8') if cookiejar_send is not None or cookiejar_receive is not None: # Use urllib req = urllib.request.Request(url, data=data, headers=headers) |