aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/yandexmusic.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-03-26 02:19:24 +0600
committerSergey M․ <dstftw@gmail.com>2016-03-26 02:19:24 +0600
commit6e6bc8dae577c29c072ffc5c25078b5668435435 (patch)
tree600a978f35617628856094486422e13c78d67ee7 /youtube_dl/extractor/yandexmusic.py
parent15707c7e024f1f29e7abd8ddaa362196ef2d4af6 (diff)
Use urlencode_postdata across the codebase
Diffstat (limited to 'youtube_dl/extractor/yandexmusic.py')
-rw-r--r--youtube_dl/extractor/yandexmusic.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/youtube_dl/extractor/yandexmusic.py b/youtube_dl/extractor/yandexmusic.py
index 158f3ea68..025716958 100644
--- a/youtube_dl/extractor/yandexmusic.py
+++ b/youtube_dl/extractor/yandexmusic.py
@@ -5,15 +5,13 @@ import re
import hashlib
from .common import InfoExtractor
-from ..compat import (
- compat_str,
- compat_urllib_parse_urlencode,
-)
+from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
sanitized_Request,
+ urlencode_postdata,
)
@@ -170,14 +168,14 @@ class YandexMusicPlaylistIE(YandexMusicPlaylistBaseIE):
missing_track_ids = set(map(compat_str, track_ids)) - set(present_track_ids)
request = sanitized_Request(
'https://music.yandex.ru/handlers/track-entries.jsx',
- compat_urllib_parse_urlencode({
+ urlencode_postdata({
'entries': ','.join(missing_track_ids),
'lang': mu.get('settings', {}).get('lang', 'en'),
'external-domain': 'music.yandex.ru',
'overembed': 'false',
'sign': mu.get('authData', {}).get('user', {}).get('sign'),
'strict': 'true',
- }).encode('utf-8'))
+ }))
request.add_header('Referer', url)
request.add_header('X-Requested-With', 'XMLHttpRequest')