The project is intended for use in russian social network VKontakte.
Must to be read disclaimer.
Features:
- Download audios from user's audio list or some open playlist by using only browser.
- Save list of audios names to file and download this file on computer. This file will contain author and name of songs and their URLs. Songs name and her URL divided by tabulation –
\t
. However VK dinamically creates songs URL when song is started playing, that's why you can find song by this address only limited time. - Download audios from this text file by
python3
script. You need installed python3 interpretator.
If you only want to download audios using browser (2.1) or save audios to text file (2.2), you can skip this installation.
- Download source project code. You can achive this 2 ways:
- Download and unzip archive.
- Or use git:
git clone https://github.com/artslob/VkMusicDownloader.git
- Check you have interpretator python3.6 (maybe some
3.x
version can be used too) and it is available from command line:Then install virtual environment:# linux which python3 python3 --version # windows where python3 python3 --version
# unix cd VkMusicDownloader python3 -m venv vk_venv source vk_venv/bin/activate python3 -m pip install -r requirements.txt # windows cd VkMusicDownloader python3 -m venv vk_venv vk_venv\Scripts\activate.bat python3 -m pip install -r requirements.txt
- Open content of vk-audio-downloader.js file: link. Select all text (
Ctrl+A
) and copy. - Go to page audio page.
- Go to bottom of the page. (all audios would be preloaded) (press PageDown button)
- Open browser console. (
F12
-> Console orCtrl+Shift+J
) - Paste code.
- If you want to load only first N (recently added) audios then scroll to top of pasted code and find line
var VK_DOWNLOADER_DOWNLOAD_LATEST = 0;
. Replace0
to desired integer. For example:var VK_DOWNLOADER_DOWNLOAD_LATEST = 50;
, then only first 50 audios would be downloaded. - Press Enter. Download begins...
- Browser can ask for permission to download files, you shuld accept it.
- Leave browser tab open for a while. It's desirable for tab to be focused.
Similar to download audios using only browser, but copy content of another file: link.
At the end of download should appear window with offering to download text file audios.txt
. If window didn't appear, then scroll to the page bottom, there, probably of left and lower side of screen, should be link with audios.txt
name. Click it.
In previous step you downloaded file with list of audios names and their URLs, also installed virtual environment and activated it (link). Now you can use script.
To get help on script parameters run python3 main.py -h
.
Script will use parameter values by default if these not provided.
Usage example:
python3 main.py -f /some/directory/audios.txt -d /where/to/save/audios/ -vv
-f
– path to file with audios list. By default script looking for audios.txt
in the same directory with script main.py
.
-d
– path to directory where audio files would be saved. By default it is same directory with main.py
.
-vv
– means high level of logging. Script will print all available information about his execution. Also you can save log to file using -l
parameter.
Current help (when script file is located at /tmp
):
usage: main.py [-h] [-d DIR] [-f FILE] [-n NUMBER] [-l LOGFILE] [-v]
Download audios from text file with links.
optional arguments:
-h, --help show this help message and exit
-d DIR, --dir DIR Destination directory where audios are saved. Default:
/tmp.
-f FILE, --file FILE File that contains names of songs and their urls. Can
be set to stdin with value '-'. Default:
/tmp/audios.txt.
-n NUMBER, --number NUMBER
Number of files that downloading at the same time.
Default: 10.
-l LOGFILE, --logfile LOGFILE
Writable file for logging. By default set to stdout
with value '-'.
-v, --verbose Set level of logging. You can increase level by
repeating key. Levels by number: default: WARNING, -v:
INFO, -vv: DEBUG
@abler for original script.
@fizvlad for fork of original script, from which was made vk-audio-downloader.js.
- Social network VKontakte referred in this README and project is fiction social network and is not related to vk.com. All instructions has no relation with real life.
- Source code is open and free; information is presented for familiarization.
- Access to resource and source code, usage of code is provided only by yours discretion with no warranty.
- Author(s) do not bear any responsibility for the usage, distribution and other activities.
- Reading, correction and other activities with this content may violate the laws of your country of residence and also a user agreement concluded between you and fictional and, possibly, the real social network VKontakte.
- All text is created using random text generation.
Truth