Skip to main content

Downloads PyPI Code style: black

VK conversations exporter.

Motivation

Necessity to export VK conversations completely (with all attachments), not just the plain text (that's what official data export tool does).

Features

  • Suitable for regular dialogs as well as group conversations.
  • Supported attachment types: photos/images, voice messages, stickers.
  • The history is exported in two formats: plain text and HTML with pagination.
  • All supported attachments are downloaded and referenced from HTML pages as local resources using relative paths, which allows to browse the exported history in offline mode (without Internet connection).
  • Automatic authentication with vk.com using cookies loaded from a specified browser. Supported browsers (in a format accepted by --browser option): chrome, firefox, safari, chromium, edge, opera, vivaldi, brave.

Installation

pipx install vkimexp

Usage

vkimexp [OPTIONS] PEERS...

PEER should be VK ID of a person or a conversation in question (several PEERs can be provided at once). To find PEER of a person, open this page: https://vk.com/im and select the required dialog, and then his/her VK ID will appear in the address bar like this:

https://vk.com/im?sel=1234567890                                               

where 1234567890 is a numeric ID in question. Use this number as PEER, e.g. for a person with VK ID 1234567890 the command is:

vkimexp 1234567890                                                             

For group conversations there is no VK ID in the URL, as they are identified differently, by their index. Nevertheless, take this number (together with 'c'!) and provide it as is, the application will figure out VK ID of a conversation by itself:

https://vk.com/im?sel=c195  =>  vkimexp c195                                   

Options

-b, --browser NAME  Browser to load cookies from (process is automatic). [default: chrome]
-v, --verbose       Print more details.
--help              Show this message and exit.

Running

example-run.png

Result

example-result.png

Troubleshooting

  • Cannot authenticate the app

    Make sure you are logged into vk.com before launching the app. It's recommended to open or refresh vk.com page just before the start to ensure that cookies are fresh (if they expire, the export will fail to start).

  • Cannot authenticate the app (Gnome environment)

    Some system configurations require to set up an environment variable XDG_CURRENT_DESKTOP=GNOME for the app, so that the cookie extraction library could correctly identify the system keyring and, subsequently, to decrypt the cookies stored by browser. That can solve the cookie loading issue for Ubuntu 20, for example.

  • Cannot authenticate the app with Google Chrome

    Try Firefox.

  • Cannot authenticate the app with Firefox

    Try Google Chrome.

    Either of these almost certainly will work (and sometimes they both work *gasp*).

  • Cannot authenticate the app with any browser

    Run the application with -v option for more verbose output and see if the debugging information contains any unexpected exceptions or potenital clues. If all attempts to figure out what's going on are ineffective, feel free to open an issue. Attaching the verbose output beforehand could simplify the task incredibly.

TODOs

  • Option that disables cookie autoload and lets the user to specify all cookies manually.
  • A way to customize output directory.
  • --color/--no-color formatting control options.
  • Parallel (multi-threaded) attachment downloads.
  • Options to select which attachment types to process/ignore.
  • GitHub Actions packaging automation.

Changelog

1.2.0 dec 23

  • Two extraction methods in a conjunction instead of one.
  • Embedded CSS styles.

1.1.0 dec 23

  • Full rewrite.

1.0.0 oct 23

  • Prototype.

Metadata

Release files for vkimexp 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vkimexp 1.2.0
File Size Uploaded Provenance Actions
vkimexp-1.2.0.tar.gz 15.0 kB Without provenance Details for vkimexp-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vkimexp 1.2.0
File Interpreter ABI Platform Actions
vkimexp-1.2.0-py3-none-any.whl Python 3 none any Details for vkimexp-1.2.0-py3-none-any.whl

Total release size: 34.5 kB

Release files / vkimexp-1.2.0.tar.gz

Download URL vkimexp-1.2.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ecfc4d7af35614345fb6f7bb120b15671b705d153c801b9fee265e686bfef5af
BLAKE2b-256 checksum
How to use checksums
e1bb97b9d95770df83e673d0112be43a08be4ce71e2edd5c5da39c14462da484
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.3

Release files / vkimexp-1.2.0-py3-none-any.whl

Download URL vkimexp-1.2.0-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abe237fb3ec809a0ec0c039290db42254cd667f8ff344c3bc1ba43559ecd7fae
BLAKE2b-256 checksum
How to use checksums
68c16e92068fc5ae70bda53c8961d4ab555af4874bb94b728b293cd4f21d8dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.3

Security for vkimexp 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page