Skip to content

Latest commit

 

History

History
111 lines (98 loc) · 6.18 KB

README.eng.md

File metadata and controls

111 lines (98 loc) · 6.18 KB

VK Music Downloader

The project is intended for use in russian social network VKontakte.
Must to be read disclaimer.

Features:

  1. Download audios from user's audio list or some open playlist by using only browser.
  2. 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.
  3. Download audios from this text file by python3 script. You need installed python3 interpretator.

Instruction

1. Installation

If you only want to download audios using browser (2.1) or save audios to text file (2.2), you can skip this installation.

  1. 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
  2. Check you have interpretator python3.6 (maybe some 3.x version can be used too) and it is available from command line:
    # linux
    which python3
    python3 --version
    
    # windows
    where python3
    python3 --version
    Then install virtual environment:
    # 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

2. Usage

2.1 Download audios using browser

  1. Open content of vk-audio-downloader.js file: link. Select all text (Ctrl+A) and copy.
  2. Go to page audio page.
  3. Go to bottom of the page. (all audios would be preloaded) (press PageDown button)
  4. Open browser console. (F12 -> Console or Ctrl+Shift+J)
  5. Paste code.
  6. 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;. Replace 0 to desired integer. For example: var VK_DOWNLOADER_DOWNLOAD_LATEST = 50;, then only first 50 audios would be downloaded.
  7. Press Enter. Download begins...
  8. Browser can ask for permission to download files, you shuld accept it.
  9. Leave browser tab open for a while. It's desirable for tab to be focused.

2.2 Download list of audios as text file.

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.

2.3 Download audios from text file using python.

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

License

MIT License

Gratitude

@abler for original script.
@fizvlad for fork of original script, from which was made vk-audio-downloader.js.

Disclaimer

  1. 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.
  2. Source code is open and free; information is presented for familiarization.
  3. Access to resource and source code, usage of code is provided only by yours discretion with no warranty.
  4. Author(s) do not bear any responsibility for the usage, distribution and other activities.
  5. 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.
  6. All text is created using random text generation. Truth

Ave, Caesar, morituri te salutant

durov