To fetch instagram user img, content, avatar data.
go get -v -a -u github.com/toomore/xig
xig [options] {username}
Options:
-a Get all data
-c int
concurrency nums (default cpuNums*20)
-d int
Delay to start, in seconds
-f Find deleted
-i Quick look recently data
-t Show httptrace info
-u Login someone to see private data
To fetch recently img(12), avatar and content
xig {username}
To fetch ALL images data (if user uploaded more, may slow)
xig -a {username}
Print recently data
xig -i {username}
+----------------------------------------------------+
Code: https://www.instagram.com/p/{code}
Date: {date} IsVideo: {true|false}
Caption: {caption}
DisplaySrc: {url}
To find some deleted content
xig -f {username}
Some users turn to private account, using -u
to login user account for fetch
private data. (required setting environment variables in IGUSER
, IGPASS
, and
cookies file will save as cookies.gob
)
xig -u {username}
./{username}
βββ profile
βΒ Β βββ {username}_{hash}.txt // user profile, biography
βββ avatar
βΒ Β βββ {username}_{hash}.jpg // user avatar image
βΒ Β βββ (...).jpg // and more ... if put `xig` into cron jobs
βββ content
βΒ Β βββ {date}_{code}_{id}.json // json files, for some day `xig` reuse
βΒ Β βββ {date}_{code}_{id}.txt // for human readable content
βββ img
Β Β βββ {code}_{hash}.jpg // user uploaded images
βββ (...).jpg // and more ...
- All images will try to fetch original size.
- Private user need setting
IGUSER
,IGPASS
and using-u
. Cookies file will save ascookies.gob
- Content's readable date is in
RFC3339
format. - instagram won't to ban ip, may CDN doesn't check.
xig
's code base are not pretty, I will make it pretty :)
For crontab, every 1m to fetch
*/1 * * * * cd ~/{some folder}; ({$go_bin_path}/xig {username} 2>&1) >> ./{username}.log
For crontab, using -d
for delay fetch.
*/1 * * * * cd ~/{some folder}; ({$go_bin_path}/xig -d 30 {username} 2>&1) >> ./{username}.log