Download the PHP package vodka2/vk-audio-token without Composer
On this page you can find all versions of the php package vodka2/vk-audio-token. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package vk-audio-token
Library that obtains VK tokens that work for VK audio API
Read this in russian.
Python port of this library: vodka2/vkaudiotoken-python
This library obtains VK token, that works for VK audio API, so you can search artists, songs, albums, query audio URIs, add audios to "My audios" etc. The library supports Kate Mobile, Boom and VK Official clients. (Thanks to YTKABOBR for reversing the Boom client)
Actually there two versions of VK API, one for Kate Mobile and one for the official client. Boom client uses VK API somewhat similar to Kate one, but it has some limitations, not all methods are supported. Moreover it requires messages
permission (do they scan our messages?) and sometimes returns 500 errors. On the other hand it supports another API in addition to VK API and may be used as a fallback.
Installation
... or simply copy the cloned repository somewhere and include src/autoloader.php
. The library requires no dependencies.
Getting tokens
The simplest example:
More advanced examples are in the examples
directory. Start with example_simple.php
.
Using tokens
The simplest example:
More examples that show how to use obtained VK tokens with different API methods are in the usage
subdirectory. More detailed VK API description is available at https://vodka2.github.io/vk-audio-token/ (Currently in progress)
CLI tool
There is also more advanced CLI tool, that emulates Kate Mobile:
Docker
2FA
Two factor authorization with SMS is supported for Kate and VK Official clients, however VK server sometimes does not send an SMS. If you don't receive it, you can use TwoFAHelper
class to force resending. See example_twofahelper.php
For the Boom client the library uses implicit flow authorization and makes requests to the VK website. VK server may make a call, send an SMS or send private message to your VK account. You can also authenticate the client yourself and only pass the token and user id.
It is also possible to create separate passwords in VK account settings and use them instead of your account password.
GMS Credentials
GMS credentials are also obtained while obtaining tokens. There are two ways to obtain GMS credentials.
The first way is to get them from a rooted Android device. The token is in /data/data/com.google.android.gsf/shared_prefs/CheckinService.xml
file and ID is in /data/data/com.google.android.gms/shared_prefs/Checkin.xml
file. You can install GMS Credentials application to see them.
The second way is to perform Android Checkin yourself. Class AndroidCheckin
is designed for this task. This class provides two options: checkin with droidguard string and checkin as in microG project. Note that the obtained credentials may expire.
For the first option you need a string that is generated by com.google.ccc.abuse.droidguard
(the.apk). One such string is in example_droidguard_str.php
file, it may expire. When using the second option one extra request is made and PHP needs to have sockets enabled.
It is also possible to intercept Android Checkin request (it is made on first boot) and see the returned GMS ID and token.
Buy me some healthy Russian drinks!
WMR — P778046516389
WMZ — Z828082159527