Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def audio_api(method, query, count):
- API_URL = "https://api.vk.com/method/"
- TOKEN = ""
- headers = {
- "Host":"api.vk.com",
- "User-Agent": ("KateMobileAndroid/45 lite-421 (Android 5.0; SDK 21; armeabi-v7a; LENOVO Lenovo A1000; ru)")
- }
- async with aiohttp.ClientSession() as sess:
- async with sess.get(API_URL + str(method) + f"?q={query}&count={count}&access_token={TOKEN}&v=5.78", headers=headers) as resp:
- response = await resp.read()
- if not response:
- return None
- return json.loads(response)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement