is a Python library that provides a simple interface for interacting with the VKontakte (VK) music service API. The library allows developers to easily perform operations related to music and other functionalities available through the VK API.
To get started with VKpyMusic, you will need a valid VK access token and user agent, which provides access to the VK music service API. But if you don't have them, it's okay - we have our own class to get it.
Example usage of VKpyMusic for receive token and user agent: ΠΡΠΈΠΌΠ΅Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ VKpyMusic Π΄Π»Ρ ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΈΡ ΡΠΎΠΊΠ΅Π½Π° ΠΈ ΡΠ·Π΅Ρ-Π°Π³Π΅Π½ΡΠ°:
Python:
from vkpymusic import TokenReceiver
login = input(" Enter login: ")
password = input("Enter password: ")
tokenReceiver = TokenReceiver(login, password)
if tokenReceiver.auth():
tokenReceiver.get_token()
tokenReceiver.save_to_config()
Result:
Enter login: +...........
Enter password: .........
SMS with a confirmation code has been sent to your phone! The code is valid for a few minutes!
Code: 277765
Token was received!
Token was saved!
Create an Service instance with your access token and user agent: Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ ΡΠΊΠ·Π΅ΠΌΠΏΠ»ΡΡ Service Ρ Π²Π°ΡΠΈΠΌ ΡΠΎΠΊΠ΅Π½ΠΎΠΌ ΠΈ ΡΠ·Π΅Ρ-Π°Π³Π΅Π½ΡΠΎΠΌ:
Python:
from vkpymusic import Service
service = Service.parse_config()
Or you can do like this: ΠΠ»ΠΈ ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΡΠ΄Π΅Π»Π°ΡΡ ΡΠ°ΠΊ:
Python:
service = Service("<your_token>", "<your_client>")
Get information about the current user ΠΠΎΠ»ΡΡΠΈΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΠΏΠ΅ΡΠ½ΡΡ ΡΠ΅ΠΊΡΡΠ΅Π³ΠΎ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ
Python:
user_songs = service.get_songs_by_userid(5, 10)
Search for tracks by query ΠΠΎΠΈΡΠΊ ΡΡΠ΅ΠΊΠΎΠ² ΠΏΠΎ Π·Π°ΠΏΡΠΎΡΡ
If you have any suggestions for improving VKpyMusic or if you find any issues, please create a new issue on the GitHub project page. We welcome your pull requests and are here to assist you with any problems you encounter.
License
VKpyMusic is distributed under the MIT license. For detailed information about the license, see the LICENSE file.
Authors
VKpyMusic is developed by the @issamansur or/and 'EDEXADE, inc.' development team.
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.