Skip to main content

Simple vk.com audio address decoder

Project description

PyPI - License GitHub issues PyPI

Maintainability Test Coverage

Usage:

pip install vaud

Decode urls:

import vaud

uid = 1
url = 'https://m.vk.com/mp3/audio_api_unavailable.mp3?extra=zuHdAgfLvxaXtd1W...CsDasdvv32yLjpy3yVBxrm#AqVYStC'
decoded_url = vaud.decode(uid, url)  # One track
import vaud

uid = 1
urls = [
    'https://m.vk.com/mp3/audio_api_unavailable.mp3?extra=zuHdAgfLvxaXtd1W...CsDasdvv32yLjpy3yVBxrm#AqVYStC',
    'https://m.vk.com/mp3/audio_api_unavailable.mp3?extra=zuHdAgfLvxaXtd1W...CsDasdvv32yLjpy3yVBxrm#AqVYStC',
    'https://m.vk.com/mp3/audio_api_unavailable.mp3?extra=zuHdAgfLvxaXtd1W...CsDasdvv32yLjpy3yVBxrm#AqVYStC',
]
decoder = vaud.Decoder(uid)  # Multiple tracks
decoded_urls = []
for url in urls:
    decoded_urls.append(decoder.decode(url))

Get all audio (not auto-decode):

import vaud

my_vk = MyVkClass()  # Own class for vk.com
cookies = my_vk.cookies # Get site cookies. dict()
uid = my_vk.uid  # User id

audio_parser = vaud.AlAudio(uid, cookies)
urls = audio_parser.main()  [{'ur': 'Encoded url', 'track': 'Track title', 'author': 'Author', 'id': 'VK Track id'}, ...]
urls = audio_parser.main(True)  [('Encoded url', 'Track title', 'Author', 'VK Track id'), ...]

decoded_urls = []  # Look before examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vaud, version 0.4.3
Filename, size File type Python version Upload date Hashes
Filename, size vaud-0.4.3.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page