www_instaloader.md 2.6 KB

Documentation

https://github.com/instaloader/instaloader
https://instaloader.github.io/installation.html

Installation

linux

$ pip3 install instaloader

OpenBSD

$ doas pkg_add python py3-pip
$ python3.xx /usr/local/bin/pip3.xx install instaloader

Upgrade

Linux

$ pip3 install --upgrade instaloader

OpenBSD

$ python3.xx /usr/local/bin/pip3.xx install --upgrade instaloader

Usage

Download specific post with post id

$ instaloader --no-video-thumbnails --no-compress-json --sanitize-paths --filename-pattern={profile}_{date_utc}_UTC --dirname-pattern={profile} --comments --quiet -- -[POST_ID]

Download all posts from profile(s)

$ instaloader PROFILE_NAME [PROFILE_NAME...] --filename-pattern={profile}_{date_utc}_UTC --post-metadata-txt={caption} --storyitem-metadata-txt={caption} --comments --no-video-thumbnails --no-compress-json --sanitize-paths --no-iphone --quiet

Update local copy of that profiles

$ instaloader --fast-update PROFILE_NAME [PROFILE_NAME...] --filename-pattern={profile}_{date_utc}_UTC --post-metadata-txt={caption} --storyitem-metadata-txt={caption} --comments --no-video-thumbnails --no-compress-json --sanitize-paths --no-iphone --quiet

or

$ instaloader --latest-stamps PROFILE_NAME [PROFILE_NAME...] --filename-pattern={profile}_{date_utc}_UTC --post-metadata-txt={caption} --storyitem-metadata-txt={caption} --comments --no-video-thumbnails --no-compress-json --sanitize-paths --no-iphone --quiet

Rename already downloaded files with default settings

$ for FILE in *.mp4; do basename_file="$(basename $FILE .mp4)" && json_file="$(echo ${basename_file} | sed 's/UTC_[0-9]*$/UTC/').json" && username=$(cat $json_file | jq ".node.owner.username" | tr -d '"') && mv $FILE ${username}-$FILE; done
$ for FILE in *.jpg; do basename_file="$(basename $FILE .jpg)" && json_file="$(echo ${basename_file} | sed 's/UTC_[0-9]*$/UTC/').json" && username=$(cat $json_file | jq ".node.owner.username" | tr -d '"') && mv $FILE ${username}-$FILE; done
$ for FILE in *.txt; do basename_file="$(basename $FILE .txt)" && json_file="$(echo ${basename_file} | sed 's/UTC_[0-9]*$/UTC/').json" && username=$(cat $json_file | jq ".node.owner.username" | tr -d '"') && mv $FILE ${username}-$FILE; done
$ for FILE in *.json; do basename_file="$(basename $FILE .json)" && json_file="$(echo ${basename_file} | sed 's/UTC_[0-9]*$/UTC/').json" && username=$(cat $json_file | jq ".node.owner.username" | tr -d '"') && mv $FILE ${username}-$FILE; done

Uncompress already downloaded json compressed files

$ for FILE in *.xz; do xz -d $FILE; done