📜 ⬆️ ⬇️

vmd - console application for downloading music from vk.com

Do you have any favorite music bands or friends with whom your musical tastes match at vk.com? I have yes. And I wanted to have an up-to-date local copy of the music of these groups and friends, in order to listen to it, for example in a car, phone, player or anywhere else. So the idea was born to create a console open source vmd application (vkontakte music downloader), which I promised to put on github here in this post . The multiplatform program works under linux, windows and mac os x. Download binary builds for these OS can be downloaded on the project home page . Under habrakat it is told how to use vmd and some technical details.

How to use vmd?


To use the program you need to get api_id by clicking on the link: http://vk.com/apps.php?act=add . If you have api_id of an existing application, you can use it.

After that, you need to create a file with the session.
Use the following command to generate it:

$ vmd --login < email   > --password < > --api_id <ID > 

')
vmd does not store your password on the hard disk, using the session file for authorization. This command must be executed only once!

Now you can download music.

Downloading music from users

If the user’s page is vk.com/genaev or vk.com/id2302071 , then in order to download his music you need to run:

  $ vmd --uid genaev $ vmd --uid 2302071 

Downloading music from groups

If the group page vk.com/teamfly , then you need to run
  $ vmd --gid teamfly 


Download music occurs in the current directory. It makes sense to copy vmd somewhere in PATH .

Synchronization takes place automatically by the file name, if the track is already downloaded, the second time it will not be downloaded. The file names correspond to the template: performer-name_track-id_track.mp3 . Often in vk.com files are called as horrible, including in the name all sorts of emoticons, hearts and other garbage. To remove it, the clean_name () function was written.

ToDo


I am glad that the program and the VK :: App module turned out to be useful not only to me. Already drawn up is not a large ToDo sheet.



I will be glad to any fitbekam!

UPDs
The new version of vmd fixed a bug with incorrect coding of some tracks.

Recommendation mode (option available from version 0.03):
This mode allows you to download in a sense, the "intersection" of your friends' audio recordings. In fact, our friends are likely to have musical tastes similar to us. You can get a dump of audio recordings of all friends and download only those that are found in at least 2 or 3 friends. By changing the ratio, you can get different sets. Example. If we want to download all mp3s that intersect at least 5 times:
 $ vmd --rec 5 
Thanks to the hafrouseur spiff for the idea!

Mac OS version available for download

Source: https://habr.com/ru/post/146889/


All Articles