A lightweight CLI music downloader for VK.com.
- Java >= 8.0;
- FFmpeg;
- Linux or macOS;
Docker image of this app has everything out of box. I recommend you to use it.
Notice! Windows is not supporting.
vkmd-cli [OPTIONS] <URL>
--ffmpeg <arg> Path to the FFmpeg bin. By default will search
automatically.
-h,--help Show help of application.
--save-dir <arg> Path to the saving directory where we will put
downloaded audio files.
--vk-cookies <arg> Path to the file contains VK.com cookies. Format
file is: cookie_key1=cookie_value1;
cookie_key2=cookie_value2;
cookie_key3=cookie_value3 ... (and so on).
Cookies has to be from https://m.vk.com .
--vk-uid <arg> VK.com user ID.
First of all, create ~/vkmd-cli
directory and copy VK.com cookies from site into file ~/vkmd-cli/vk-cookies.txt
.
Using JRE:
Download compiled application:
Where
x.x.x
is the latest available version.
wget -O ./vkmd-cli.jar https://github.com/bupy7/vkmd-cli/releases/download/x.x.x/vkmd-cli-x.x.x-uber.jar
Run jar file using Java:
java -jar ./vkmd-cli.jar https://vk.com/retrowavetouch \
--vk-cookies=~/vkmd-cli/vk-cookies.txt \
--vk-uid=100200300 \
--save-dir=~/vkmd-cli
- --vk-cookies - Path to the file of VK.com cookies;
- --vk-uid - VK.com user ID;
- --save-dir - Path to save downloaded audios;
- https://vk.com/retrowavetouch - URL of page with audios (mobile or desktop URL, never mind).
Using Docker:
Clone repository:
git clone https://github.com/bupy7/vkmd-cli.git
cd vkmd-cli
git checkout 1.0.0
Build Docker image:
docker build -t bupy7/vkmd-cli .
Run Docker container:
docker run --rm -it -v ~/vkmd-cli:/vkmd-cli bupy7/vkmd-cli https://vk.com/retrowavetouch \
--vk-cookies=/vkmd-cli/vk-cookies.txt \
--vk-uid=100200300 \
--save-dir=/vkmd-cli
You have to extract VK.com cookies from first request of any page. You may do that using Developer Tools in Chrome, Safari, Mozilla and other browsers.
Notice! Extracting cookies using
document.cookie
is not correctly, due to there are non HTTP cookies only.
Notice! You have to copy cookies from mobile version of VK.com (https://m.vk.com).
Instruction for Chrome and any Chromium like browsers:
- Open https://m.vk.com and log in.
- Open "Developer tools" (macOS: Command + Shift + I; PC: Ctrl + Shift + I).
- Refresh current page.
- Choose "Network" tab in "Developer tools" panel.
- Filter results in the tab using "Doc" request type.
- Choose first request and choose "Header" tab in the right section.
- Go to "Request Headers", in the right section, and find "cookie:" header.
- Right-click on the "cookie:", and choose "Copy value".
- Paste this text into
~/vkmd-cli/vk-cookies.txt
file and save.
Distribution:
./gradlew clean build
Uber JAR:
./gradlew clean uberJar
vkmd-cli is released under the BSD-3-Clause License. See the bundled LICENSE.txt for details.