althonos / InstaLooter

Another API-less Instagram pictures and videos downloader.
GNU General Public License v3.0
2k stars 259 forks source link

[Feature request] Download Instagram Stories #36

Open verafide opened 7 years ago

verafide commented 7 years ago

There's something called ChromeIGStory that lets you view/download Stories in the browser so I'm curious if it'd be possible for InstaLooter to ever be able to just download stories.

althonos commented 7 years ago

Hi there, I'm sorry I cannot test that, I have no Instagram account to play with. I'll set up one for development some day but until then I cannot mess with.

Also, since I am no JS coder, I have no idea how ChromeIGStory does work, and if it requires an API call or not.

I'll be leaving this feat request open and maybe at some point I'll try to see what I can do, although I don't get much free time currently.

Lambik commented 7 years ago

Pretty sure this is relevant:

// fetch a particular user's story
function getStory(userId, callback) {
  return fetch(`${FEED_API}user/${userId}/reel_media/`, {
    accept: 'application/json',
    credentials: 'include'
  }).then(checkStatus)

and

// fetch the requesting user's story tray for their friends' stories
function getFriendStories(callback) {
  return fetch(`${FEED_API}reels_tray/`, {
    accept: 'application/json',
    credentials: 'include'
  }).then(checkStatus)

with the variables:

export const API_BASE = "https://i.instagram.com/api/v1/";
export const FEED_API = API_BASE + "feed/";

found on https://github.com/CaliAlec/ChromeIGStory/blob/master/utils/InstagramApi.js

I would interpret this as "an account is needed", and that it returns json.

Lambik commented 7 years ago

I gave it a little try yesterday, but failed, because the rest of instaLooter is not based around the json structures in the API, but rather those of the site. It was a huge hassle to get it in the structure of the current code, so I gave up :(

althonos commented 7 years ago

@Lambik : indeed, instaLooter was designed not to use the official IG API, and I think ChromeIGStory uses the official API, so CaliAlec's work cannot be reused here.

verafide commented 7 years ago

@Lambik or anyone else it may concern. I've just discovered this instastories-backup script. I wasn't able to get it running and unfortunately I think it uses the IG API so the code couldn't be added into instaLooter, but it's a possible alternative to ChromeIGStory for downloading stories. Hoping someone who knows more than me can test it out and report back if it works.

I got instastories-backup running by removing part of my cookie s_network="";

kcayut commented 7 years ago

Hello, I found a project called 'instagram-scraper' by rarcega. And it can download the stories with user login id and password. Maybe the code could help. Thank you very much.

althonos commented 7 years ago

@verafide, @kcayut : Both solutions are actually using the API, instagram-scraper does much of the work without the official API but uses it for stories. But rarcega made a really smart program, too ! ;)

JoaoVitorMaia commented 6 years ago

Yes, for view stories an account is needed.

caffeinum commented 6 years ago

https://github.com/mgp25/Instagram-API

This library has access to stories endpoint, though I not figured out yet how to download them

ilovelinux commented 6 years ago

I think that the only way to see (and download) a story is using APIs because it's needed for Instagram to know who sees the stories and Instagram can't know that is you don't login and they are the best solution in terms of performances However, why don't you just use APIs? What's the problem?

caffeinum commented 6 years ago

An update to my previous comment: I did figured out how to download them. My script is here: https://github.com/caffeinum/load-stories/blob/master/load_stories.php. It downloads all stories from users' feed.

althonos commented 6 years ago

@ilovelinux : the whole point of this project was to provide a download tool that works without the Instagram API, as the original InstaRaider did. There are plenty of feature-rich tools that use the API, where was the fun in copying one of them ? :wink: