Инструкция и описание на русском языке
A set of Python scripts to extract and download data from a VK archive without requiring any authentication data or API tokens. These scripts process locally downloaded HTML files from your exported VK archive.
This repository includes:
- VK Message Attachments Downloader (
download_messages.py
): Downloads image attachments from your VK messages. - VK Photo Albums Downloader (
download_albums.py
): Downloads all images from your VK photo albums.
- No Authentication Required: No API keys, tokens, or login credentials needed.
- Custom User-Agent: Mimics a modern browser to avoid detection.
- Retry Logic: Retries downloads in case of temporary issues.
- Validation: Skips invalid URLs, unsupported MIME types, and files that already exist (unless forced).
- Processes message attachments and organizes them by contact name.
- Handles paginated message files and skips non-image links.
- Extracts and downloads all images from VK photo albums.
- Organizes images by album name.
Follow these steps to download your VK data:
- Request your archive:
- Go to Settings → Privacy → Download your data (Direct Link).
- Select the data types to include (e.g., messages, photos).
- Confirm the request.
- Wait for the archive to be prepared:
- This may take a few days, depending on the amount of data requested.
- Download your archive:
- Follow the link provided in your VK messages.
- Save and extract the
.zip
file to your computer.
-
Clone this repository:
git clone https://github.com/desuex/vk-downloader.git cd vk-downloader
-
Install dependencies:
pip install -r requirements.txt
python download_messages.py --root-dir <PATH_TO_MESSAGES> --download-dir <PATH_TO_OUTPUT> [--force]
--root-dir
: Path to themessages
directory in your VK archive.--download-dir
: Directory where message attachments will be saved.--force
: (Optional) Force re-download of existing files.
python download_messages.py --root-dir "./VK Archive/messages" --download-dir "./downloads/messages"
python download_albums.py --root-dir <PATH_TO_ALBUMS> --download-dir <PATH_TO_OUTPUT>
--root-dir
: Path to thephoto-albums
directory in your VK archive.--download-dir
: Directory where album images will be saved.
python download_albums.py --root-dir "./VK Archive/photos/photo-albums" --download-dir "./downloads/albums"
- Python 3.9+
- Dependencies listed in
requirements.txt
:requests bs4 beautifulsoup4 charset-normalizer
This project is licensed under the MIT License. See the LICENSE
file for details.