Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update graphql query hash used for stories #872

Merged
merged 1 commit into from Nov 19, 2020
Merged

Update graphql query hash used for stories #872

merged 1 commit into from Nov 19, 2020

Conversation

Ristovski
Copy link
Contributor

This updated graphql query hash returns all fields for tappable_objects. These fields were missing/partial when using the old query hash.
This allows to get the full json metadata of a story. Fixes #871

This updated graph query hash returns all fields for `tappable_objects`. These fields were missing/partial when using the old query hash.
This allows to get the full json metadata of a story.
@aandergr aandergr linked an issue Nov 19, 2020 that may be closed by this pull request
Copy link
Member

@aandergr aandergr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice query hash, thanks!

Story-related tests still pass, and all attributes of the yielded Story and StoryItems objects are still accessible. It seems the data returned using this query hash contains all the (relevant) fields, and it includes more-complete tappable_objects information.

@aandergr aandergr merged commit e70faf5 into instaloader:master Nov 19, 2020
@Ristovski Ristovski deleted the patch-1 branch November 19, 2020 14:56
@Deleora
Copy link

Deleora commented Jan 23, 2021

So now is it possible to download the actuals posts shared in stories?

@aandergr
Copy link
Member

So now is it possible to download the actuals posts shared in stories?

Yes, there is a field tappable_objects in the JSON that is now returned for each StoryItem. So with the JSON saved, something like the following will give you an id and a shortcode of a post shared in a story:

$ xzcat 2021-01-30_05-57-43_UTC.json.xz | jq .node.tappable_objects[0].media

or download it:

$ instaloader -- -`xzcat 2021-01-30_05-57-43_UTC.json.xz | jq -r .node.tappable_objects[0].media.shortcode`

However, the tappable objects are not yet exposed in the programmatic interface of StoryItem.

@Deleora
Copy link

Deleora commented Jan 30, 2021

Ohh, that explains why I wasn't seeing any such posts getting downloaded. Anyway, Thanks for one more cool feature!!

So one question, can I download such posts using the uncompressed JSON files? If so how? because I have only uncompressed JSON files.
And I didn't understand the purpose of having those backticks(`) in the command. Is it mandatory? [I have Windows 10]

@aandergr
Copy link
Member

aandergr commented Jan 30, 2021

The backticks do what is called Command substitution, allowing the output of a command to replace the command name.

I think in Powershell and with the JSON files not compressed, the following command should do the job

instaloader -- -$(jq -r '.node.tappable_objects[0].media.shortcode' '2021-01-30_05-57-43_UTC.json')

(it requires jq to be installed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to fetch all fields in 'tappable_objects' Download post shared on story
3 participants