All Projects → michabirklbauer → instagram_json_viewer

michabirklbauer / instagram_json_viewer

Licence: MIT license
Transforms Instagram's *.json / backup data - that you get via the Data Download Tool - to a readable format!

Programming Languages

python
139335 projects - #7 most used programming language
r
7636 projects

Projects that are alternatives of or similar to instagram json viewer

downstagram
Command line tool to download and backup all your Instagram photos
Stars: ✭ 32 (-21.95%)
Mutual labels:  instagram, backup
Pyinstalive
Python script to download Instagram livestreams and replays.
Stars: ✭ 336 (+719.51%)
Mutual labels:  instagram, download
Timeliner
In general, Timeliner obtains items from data sources and stores them in a timeline.
Stars: ✭ 2,911 (+7000%)
Mutual labels:  instagram, backup
Flickrsync
A command line tool to synchronise, upload, download, pictures between the local file system and Flickr. Image hash signature of the picture is used to uniquely identify the image.
Stars: ✭ 14 (-65.85%)
Mutual labels:  backup, download
ngDownloader
📹 🎥 Now Download videos from any website including YouTube, Facebook, Udemy etc without ads.
Stars: ✭ 47 (+14.63%)
Mutual labels:  instagram, download
Pyinstastories
Python script to download Instagram stories from Instagram users.
Stars: ✭ 260 (+534.15%)
Mutual labels:  instagram, download
Zuck.js
A javascript library that lets you add stories EVERYWHERE.
Stars: ✭ 3,396 (+8182.93%)
Mutual labels:  instagram, viewer
CTR-tools
Crash Team Racing (PS1) tools - a C# framework by DCxDemo and a set of tools to parse files found in the original kart racing game by Naughty Dog.
Stars: ✭ 93 (+126.83%)
Mutual labels:  converter, viewer
GameExtractor
Reads and writes thousands of different archive and image formats used in games.
Stars: ✭ 25 (-39.02%)
Mutual labels:  converter, viewer
cyan
Cyan Color Converter
Stars: ✭ 68 (+65.85%)
Mutual labels:  converter, viewer
BlocksConverter
A PocketMine-MP plugin allows you to convert Minecraft PC maps to MCPE/Bedrock maps or vice-versa.
Stars: ✭ 47 (+14.63%)
Mutual labels:  converter, backup
Instatrack
Convert Instagram user ID to username & vice versa
Stars: ✭ 70 (+70.73%)
Mutual labels:  converter, instagram
ceiba-dl
NTU CEIBA 資料下載工具
Stars: ✭ 80 (+95.12%)
Mutual labels:  backup, download
zap
Maintain and replicate ZFS snapshots
Stars: ✭ 48 (+17.07%)
Mutual labels:  backup
anghamify
Anghami Downloader | Download Anghami songs with full meta-tags.
Stars: ✭ 22 (-46.34%)
Mutual labels:  download
luke
Please use the luke bundled with lucene! This repo is archived and frozen now.
Stars: ✭ 101 (+146.34%)
Mutual labels:  viewer
Nallagram
Nallagram is an open source social networking platform where users can share their views on various topics and interact among people in which they create, share, and/or exchange information and ideas in virtual communities and networks.
Stars: ✭ 30 (-26.83%)
Mutual labels:  instagram
Gm1KonverterCrossPlatform
A tool to convert strongholds gm1 and tgx files to png.
Stars: ✭ 20 (-51.22%)
Mutual labels:  converter
doppelganger
A tool to mirror GitHub repositories.
Stars: ✭ 14 (-65.85%)
Mutual labels:  backup
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (+126.83%)
Mutual labels:  download

instaview.py

Instagram JSON / Backup Viewer

This script transforms Instagram's data - that you get via the Data Download Tool - to a readable format!

Important Information

Instagram now let's you download your data in HTML format - which is basically what this script does!
I would therefore recommend using their feature since it is obviously a lot better than my implementation!

If you want to convert older backups, you can still do that with these scripts:

Screenshots

HTML1 HTML2

Features

  • Transforms profile information, media and messages into a more readable html format!
  • Creates separate html pages for each chat!
  • Easy to use: Just execute the script in json-directory.
  • Functions can be imported and tuned to your needs!
  • Message statistics can be extracted to see your most frequent contacts!

Requirements

  • Python (version 3.7 and above)

Data Download

Here you can download your data: Instagram

Basic Usage

Tutorial Video: https://www.youtube.com/watch?v=0CUbTkrK62M

  • Back up your instagram data before you run anything!
  • If your instagram data is split into multiple files, you have to extract and merge them first (e.g. by copy-pasting the content into a single folder, and/or merging json-files).
  • Put "instaview.py" into the data directory (e.g. where the all json-files are!)
    E.g. my downloaded zip-archive was named "micha_birklbauer_20200316.zip", extracted the directory looked like this:
    """
    +---- micha_birklbauer_20200316
    + direct
    + photos
    + profile
    + stories
    + videos
    | account_history.json
    | autofill.json
    | checkout.json
    | comments.json
    | connections.json
    | contacts.json
    | likes.json
    | media.json
    | messages.json
    | profile.json
    | saved.json
    | searches.json
    | settings.json
    | stories_activities.json
    | instaview.py (PYTHON SCRIPT GOES HERE!)
    """
  • Run "instaview.py" via commandline (recommended) or doubleclick!
  • Alternatively you can run the "instaview.exe" if you have Windows and do not have python installed (steps are the same).
  • Check "instaview_report.html" in the browser of your choice!

Manually setting Profile Pictures

If you run into any http errors of kind 429 (not displayed past version v2020.12.23) - meaning the Instagram API denied your request - or simply if your chats all show the default profile picture, you can manually set profile pictures in the folder chat/icons by creating a *.jpg file with the name of the corresponding user. The picture should roughly resemble the dimensions of a real Instagram profile picture to ensure the generated html still looks nice!

Advanced Usage

from instaview import *

instaview()

Functions:

  • read_profile(filename = "profile.json"):
    Reads profile information from json file and returns readable and structured html string.
    • Args:
      • filename (str): Path to json with profile information. Default: "profile.json".
    • Return (list):
      • html_string (str): json converted to html.
      • status (int): Amount of encountered errors.
      • error_log (str): Log of all encountered errors.
  • read_searches(filename = "searches.json"):
    Reads search information from json file and returns readable and structured html string.
    • Args:
      • filename (str): Path to json with search information. Default: "searches.json".
    • Return (list):
      • html_string (str): json converted to html.
      • status (int): Amount of encountered errors.
      • error_log (str): Log of all encountered errors.
  • read_connections(filename = "connections.json"):
    Reads connection information from json file and returns readable and structured html string.
    • Args:
      • filename (str): Path to json with connection information. Default: "connections.json".
    • Return (list):
      • html_string (str): json converted to html.
      • status (int): Amount of encountered errors.
      • error_log (str): Log of all encountered errors.
  • read_media(filename = "media.json"):
    Reads media information from json file and returns readable and structured html string.
    • Args:
      • filename (str): Path to json with media information. Default: "media.json".
    • Return (list):
      • html_string (str): json converted to html.
      • status (int): Amount of encountered errors.
      • error_log (str): Log of all encountered errors.
  • read_comments(filename = "comments.json"):
    Reads comment information from json file and returns readable and structured html string.
    • Args:
      • filename (str): Path to json with comment information. Default: "comments.json".
    • Return (list):
      • html_string (str): json converted to html.
      • status (int): Amount of encountered errors.
      • error_log (str): Log of all encountered errors.
  • read_messages(filename = "messages.json", profile = "profile.json", reverse_conversations = False, profile_pic = None, default_avatar = None, download_all = False, hd = False, infer_usernames = False, avatars_dict = {}, http_traceback = False):
    Reads message information from json file and creates separate html files for each chat in new "chat" directory. Links to html pages are returned as concatenated html string together with a list of chat participants.
    • Args:
      • filename (str): Path to json with message information or path to folder containing messages. Default: "messages.json".
      • profile (str): Path to json with profile information. Default: "profile.json".
      • reverse_conversations (bool): Message order in chats. Default: False (Newest to Oldest).
      • profile_pic (str): Path or link to profile picture of your own user. Default: None (will be populated by method itself).
      • default_avatar (str): Path or link to default avatar. Default: None (uses instagram.com/instagram profile picture [1]).
      • download_all (bool): If all media links should be downloaded locally. Warning: This might take a very long time! Default: False.
      • hd (bool): If high definition versions of avatars should be used or not. Default: False.
      • infer_usernames (bool): If usernames should be infered from thread information and avatars tried to be downloaded. Default: False (Default avatars for users).
      • avatars_dict (dict): A dictionary containing usernames and corresponding paths/links to profile pictures. Argument "profile_pic" overwrites user's avatar even if specified in avatars_dict. Default: empty dict (will be populated by method itself).
      • avatar_warnings (bool): Print warnings for getting avatars. Default: False (No warnings are printed).
      • http_traceback (bool): Print the full traceback for http errors or not. Default: False (Traceback will not be printed).
    • Return (list):
      • html_string (str): json converted to html (does not actually include chats, chats are written to files immediately).
      • chat_list (list of str): List of chats and their participants.
      • status (int): Amount of encountered errors.
      • error_log (str): Log of all encountered errors.
  • instaview(filenames = ["profile.json", "searches.json", "connections.json", "media.json", "comments.json", "messages.json", "devices.json"], parse = [True, True, True, True, True, True, True], title = None, show_credits = True, verbose = True, logging = True, **kwargs):
    Executes all functions and creates an html report including information from all used json files. Returns 0 if everything went correctly.
    • Args:
      • filenames (list of str): A list with paths to the specific json files in the following order:
        1. Profile information
        2. Search information
        3. Connection information
        4. Media information
        5. Comment information
        6. Message information
        7. Device information
          Default: Default filenames for every function (see above).
      • parse (list of bool): A list of which json-files should be parsed. Default: [True, True, True, True, True, True, True] (all are parsed).
      • title (valid html as str): What the title of the report should be. Default: None ("INSTAGRAM DATA + [Date]").
      • show_credits (bool): If credits should be added at the bottom of the report. Default: True.
      • verbose (bool): If progress should be printed to terminal. Default: True.
      • logging (bool): If error logs should be written to file. Default: True.
      • **kwargs: any additional arguments will be passed to "read_messages()" (see above).
    • Return (int): 0 if successfully, >0 if unsuccesfull or only partly successful.

Message Statistics

MSGSTATS

  • Generates a bar-plot with total amount of messages per conversation!
  • Execute "message_stats.py" and enter your username! Python 3 (or higher) and pandas required!
  • Execute "message_stats.R"! R 3.5 (or higher) and ggplot2 required!

Sidenote: This is currently only available for older instagram backups [pre 23. Dec 2020].

Changes to old release

  • Not reliant on R/Markdown/LaTeX anymore!
  • HTML instead of PDF!
  • PDF can still be created with browser!
  • Full emoji/unicode support!
  • Separate pages for chats!

Known Issues

  • I didn't include contacts.json since I didn't sync my contacts and therefore had no data available on that. Furthermore account_history.json, autofill.json, checkout.json, likes.json, saved.json, settings.json and stories_activities.json are also not included because I found the information in there is not really useful (e.g. likes.json/saves.json don't include post information etc.)!
  • If you have huge amounts of chats avatars might not load correctly because instagram blocks your IP after too many requests. This might also happen if you run the script several times consecutively!
  • Reading connections and comments usually yields errors because some fields are missing in newer Instagram backups. They can safely be ignored!
  • Links to pictures/videos/etc. will time out after a few days. This is because instagram's access tokens provided in the json files expire. To save any media locally you can use "instaview(download_all=True)"!
  • This is rather experimental since I only had my own data to test this with, there's no guarantee that this also works with your data!

Disclaimer

  • The current default avatar is the profile picture of the account https://instagram.com/instagram (08. July 2020) and is stored in this github repository for convenience. I do not own (the rights to) this picture!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].