vkaudiotoken-python
Port of vodka2/vk-audio-token, originally written in PHP, to Python. This package obtains tokens, that work for VK audio API. Actually there are two versions of the API, one for Kate Mobile, and one for official VK client, each requires a different token.
vkaudiotoken is compatible with Python 2.7 and >=3.5. requests package is required.
pip install vkaudiotoken
You can also run examples in the examples directory without installing the package
Getting tokens
The simplest example:
from vkaudiotoken import get_kate_token, get_vk_official_token
login = '+71234567890' # your vk login, e-mail or phone number
password = '12345' # your vk password
# print tokens and corresponding user-agent headers
print(get_kate_token(login, password))
print(get_vk_official_token(login, password))
More advanced examples are in the example directory. See also examples and README in vodka2/vk-audio-token repository.
Using tokens
The simplest example:
import requests
token = '...'
user_agent = '...'
sess = requests.session()
sess.headers.update({'User-Agent': user_agent})
sess.get(
"https://api.vk.com/method/audio.getById",
params=[('access_token', token),
('audios', '371745461_456289486'),
('v', '5.95')]
)
See examples in the example/usage directory and in vodka2/vk-audio-token. Some VK API documentation, still in progress, is available at vodka2.github.io/vk-audio-token/.
2FA
Two factor authorization with SMS is supported, however VK sometimes does not send it. If you don't receive an SMS, you can use TwoFAHelper class to force resending.
It is also possible to create separate passwords in VK account settings and use them instead of your account password.
Metadata
Release files for vkaudiotoken 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vkaudiotoken-0.5.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for vkaudiotoken-0.5.1-py2.py3-none-any.whl |
Release files / vkaudiotoken-0.5.1-py2.py3-none-any.whl
| Download URL | vkaudiotoken-0.5.1-py2.py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d7f883439136707666124994de5c5640b96b39d631a1b909c65d2114a4d7cc1d
|
|
BLAKE2b-256 checksum How to use checksums |
34b393665d73d12d4af81b181b9ab5510213f8bf50d85e7f2cf9b2e57a226b04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.12.5 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.5.5
|
Security for vkaudiotoken 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.