Skip to content

Commit e775b1f

Browse files
qwertyadrianpython273
authored andcommitted
Исправлена ошибка ChunkedEncodingError при получении аудиозаписей
1 parent 372a637 commit e775b1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vk_api/audio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def get_iter(self, owner_id=None, album_id=None, access_hash=None):
118118
'access_hash': access_hash,
119119
'is_loading_all': 1
120120
},
121+
headers={"X-Requested-With": "XMLHttpRequest"},
121122
allow_redirects=False
122123
).json()
123124

@@ -643,7 +644,8 @@ def scrap_tracks(ids, user_id, http, convert_m3u8_links=True):
643644

644645
result = http.post(
645646
'https://m.vk.com/audio',
646-
data={'act': 'reload_audio', 'ids': ','.join(['_'.join(i) for i in ids_group])}
647+
data={'act': 'reload_audio', 'ids': ','.join(['_'.join(i) for i in ids_group])},
648+
headers={"X-Requested-With": "XMLHttpRequest"},
647649
).json()
648650

649651
last_request = time.time()

0 commit comments

Comments
 (0)