1
0
Fork 0
mirror of https://codeberg.org/polarisfm/youtube-dl.git synced 2024-12-26 01:26:45 +00:00

[utils] update_url_query: Encode the strings in the query dict

The test case with {'test': '第二行тест'} was failing on python 2 (the non-ascii characters were replaced with '?').
This commit is contained in:
Jaime Marquínez Ferrándiz 2016-03-04 22:18:40 +01:00
parent cf074e5ddd
commit 3233a68fbb

View file

@ -1743,6 +1743,7 @@ def update_url_query(url, query):
parsed_url = compat_urlparse.urlparse(url) parsed_url = compat_urlparse.urlparse(url)
qs = compat_parse_qs(parsed_url.query) qs = compat_parse_qs(parsed_url.query)
qs.update(query) qs.update(query)
qs = encode_dict(qs)
return compat_urlparse.urlunparse(parsed_url._replace( return compat_urlparse.urlunparse(parsed_url._replace(
query=compat_urllib_parse.urlencode(qs, True))) query=compat_urllib_parse.urlencode(qs, True)))