Sorting tracks in a VK playlist

Disclaimer: I started writing this script when the fun news hadn't arrived yet.
I will be brief.
- What does it do?
- Reorders the tracks in your playlist on VK so that with minimal intervention it looks neater.
- Where to get?
- On the github . Download now .
- How to use?
- You will need the Python 2.7.x . Download, install. You take a file
vk_music_organizer.pyfrom the archive, open it in a notebook, at the very beginning, write in linesemail = '...'andpassword = '...'your username and password, respectively. Save. If you have Python installed correctly, then after that just start this file with a double click.
- You will need the Python 2.7.x . Download, install. You take a file
- How does it work?
- The sorting algorithm is as follows:
- Break all the tracks into albums, if the user has one, drop all the tracks without the specified album into one unnamed album. All albums sorted alphabetically, nameless put first.
- Go through all the tracks inside each album and combine the chains of tracks in a row with one artist into clusters.
- Inside each album, for all artists met, find the largest cluster with them. From the same size, select the first one in the list.
- Drag and drop all the tracks that are not in the largest cluster of your artist into this cluster.
- Combine all the clusters inside each album in a row. Combine all albums.
In addition to sorting, there is nothing particularly meaningful there. I use the authorizer and API call code from this article. Apart from sorting, the operation of the program is limited to one request toaudio.get, one toaudio.getAlbumsand a bunch of toaudio.reorder. Free bonus: all tracks that fall under the harsh hand of copyright are sent to the basement.
- The sorting algorithm is as follows:
The script is provided as is, with all the bugs and flaws. Use at your own risk. Enjoy!