Skip to content

📄 All photos, wall, friends and other data from VK page in JSON file

License

Notifications You must be signed in to change notification settings

graythze/VKExport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VKExport 📄

RUS // ENG

RUS

📄 Что это?

VKExport позволяет экспортировать данные в файл JSON с личной страницы ВК или другого человека.

✅ Экспорт доступен для

⚙️ Использование

  1. Скачайте скрипт
  2. Установите пакеты, используя команду pip install -r requirements.txt
  3. Запустите скрипт, используя команду python collector.py VK_TOKEN durov -api 5.82 -c wall,photos,notes -sf -v

Команда python collector.py -h показана ниже

usage: collector.py [-h] [-c CUSTOM | -b | -e | -f] [-a API] [-sf] [-v]
                    token id

usage: collector.py VK_TOKEN durov -api 5.82 -c wall,photos,notes -sf -v       

positional arguments:
  token                 VK API token
  id                    Page ID or user domain

options:
  -h, --help            show this help message and exit
  -c CUSTOM, --custom CUSTOM
                        Parse custom methods
  -b, --base            Parse basic info
  -e, --extra           Parse basic + extra info
  -f, --full            Parse full info
  -a API, --api API     API version
  -sf, --singlefile     Save result in single file
  -v, --verbose         Increase output verbosity

📍 Аргументы

token - Токен VK API

id — идентификатор или домен страницы (например, 1, id1 или durov)

-a, --apiver — версия API VK, например 5.82. Default: 5.82

-sf, --singlefile - Сохранение результата в одном файле. По умолчанию, каждый метод сохраняется в отдельный файл

-b, --base — Базовый уровень парсера. Парсинг всех методов, кроме messages.getById и users.getFollowers

-e, --extra — Средний уровень парсера. Парсинг всех методов, кроме messages.getById

-f, --full — Полный уровень парсера. Парсинг всех представленных методов

-v, --verbose — Показать подробности

-c, --custom — Выбрать собственные методы. Например, при photos,wall будет использован парсинг только photos.get и wall.get

🔌 Получение API токена

⚡ Использование готовых решений

Сервис vkhost.github.io позволяет в автоматическом режиме собрать URL и получить токен

  1. Откройте vkhost.github.io
  2. Выберите приложение. Например, можно выбрать Kate Mobile или VFeed
  3. Нажмите на выбранное приложение
  4. Нажмите на "Продолжить как" или "Разрешить"
  5. Скопируйте часть URL начиная с access_token= и заканчивая &expires_in
  6. Вставьте токен в скрипт

Также можно использовать другие приложения или службы для получения токена.

⚠️⚠️⚠️

После использования скрипта, в целях безпопасности КРАЙНЕ рекомендуется удалить API токен. Это можно сделать двумя способами: отозвать права на используемое приложения для токена, либо сменить пароль

💪 Собственная сборка URL

Получить ключ доступа пользователя можно одним из этих способов:

  • Implicit Flow: для работы с API от имени пользователя в Javascript-приложениях и Standalone-клиентах (десктопных или мобильных).

  • Authorization Code Flow: для работы с API от имени пользователя с серверной стороны вашего сайта.

Дополнительную информацию можно найти в Общих сведениях

ПРИМЕЧАНИЕ: Если JSON файл слишком большой, есть вероятность получить ошибку MemoryError. Чтобы исправить это, установите x64 версию Python

ENG

📄 What is it?

VKExport allows you to export data in JSON file from personal or other VK pages

Export available for

⚙️ Usage

  1. Download script
  2. Install packages using pip install -r requirements.txt
  3. Run script using python collector.py VK_TOKEN durov -api 5.82 -c wall,photos,notes -sf -v

The command python collector.py -h is shown below

usage: collector.py [-h] [-c CUSTOM | -b | -e | -f] [-a API] [-sf] [-v]
                    token id

usage: collector.py VK_TOKEN durov -api 5.82 -c wall,photos,notes -sf -v       

positional arguments:
  token                 VK API token
  id                    Page ID or user domain

options:
  -h, --help            show this help message and exit
  -c CUSTOM, --custom CUSTOM
                        Parse custom methods
  -b, --base            Parse basic info
  -e, --extra           Parse basic + extra info
  -f, --full            Parse full info
  -a API, --api API     API version
  -sf, --singlefile     Save result in single file
  -v, --verbose         Increase output verbosity

📍 Arguments

token - VK API Token

id - ID or Page domain (e.g. 1, id1 or durov)

api APIVER, --apiver APIVER - VK API Version, eg 5.82

-sf, --singlefile - Save result in single file. Each file for method by default.

-m [{1,2,3}], --mode [{1,2,3}] - Parser complexity. 1 parses all except messages and followers, 2 parses all except messages, 3 parses all methods

-b, --base — Base parser complexity, instead messages.getById and users.getFollowers

-e, --extra — Extra parser complexity, instead messages.getById

-f, --full — Full parser complexity. Parsing all methods

-v, --verbose — Показать подробности

-v, --verbose - Increase output verbosity

-c, --custom - Set custom methods, e.g. photos,wall will parse photos.get and wall.get

🔌 Getting VK API token

⚡ Third party services

Service vkhost.github.io helps automatically bulid URL and get token

  1. Visit vkhost.github.io
  2. Choose app. It's better to use token from Kate Mobile or VFeed apps
  3. Click on app
  4. Click on "Continue as" or "Allow"
  5. Copy part of URL from access_token= to &expires_in
  6. Paste token to CLI

You can use other apps or services to get token.

⚠️⚠️⚠️

After using the script for security reasons, it is HIGHLY recommended to remove the API token. It is possible to do in two ways: revoke app authorization which was used to obtain token, or change the password

💪 Self-building URL

To get api token you can use one of them ways:

  • Implicit Flow: to work with API on behalf of the user in Javascript applications and Standalone clients (desktop or mobile).

  • Authorization Code Flow: to work with API on behalf of the user from the server side of your site.

You can find extra information at General information

NOTE: If result JSON file is too large, you can get MemoryError error. To avoid it, install x64 Python version

About

📄 All photos, wall, friends and other data from VK page in JSON file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages