コミット
c64a4a606d
|
@ -1,12 +1,14 @@
|
|||
import re
|
||||
import logging
|
||||
import requests
|
||||
import builtins
|
||||
|
||||
# Не используется ujson из-за отсутствия в нём object_hook'a
|
||||
# Отправка вообще application/x-www-form-urlencoded, а не JSON'a
|
||||
# https://github.com/psf/requests/blob/master/requests/models.py#L508
|
||||
import json
|
||||
|
||||
import requests
|
||||
|
||||
from yandex_music.utils.captcha_response import CaptchaResponse
|
||||
from yandex_music.utils.response import Response
|
||||
from yandex_music.exceptions import Unauthorized, BadRequest, NetworkError, YandexMusicError, CaptchaRequired, \
|
||||
|
@ -17,6 +19,7 @@ HEADERS = {
|
|||
'X-Yandex-Music-Client': 'WindowsPhone/3.20',
|
||||
}
|
||||
|
||||
reserved_names = [name.lower() for name in dir(builtins)] + ['client']
|
||||
|
||||
logging.getLogger('urllib3').setLevel(logging.WARNING)
|
||||
|
||||
|
@ -63,7 +66,8 @@ class Request:
|
|||
cleaned_object = {}
|
||||
for key, value in obj.items():
|
||||
key = Request._convert_camel_to_snake(key.replace('-', '_'))
|
||||
key = key.replace('client', 'client_')
|
||||
if key in reserved_names:
|
||||
key += '_'
|
||||
|
||||
if len(key) and key[0].isdigit():
|
||||
key = '_' + key
|
||||
|
|
読み込み中…
新しいイシューから参照