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

[instagram] _parse_post_api() doesn't provide some keywords #2695

Closed
bradenhilton opened this issue Jun 20, 2022 · 3 comments
Closed

[instagram] _parse_post_api() doesn't provide some keywords #2695

bradenhilton opened this issue Jun 20, 2022 · 3 comments

Comments

@bradenhilton
Copy link
Contributor

bradenhilton commented Jun 20, 2022

I'm guessing this is due to changes in the extractor and the various endpoints it uses.

Based on my manual testing on my fork, the following keywords don't appear to be working:

  • post_url: Can be built the same way it's built in _parse_post_graphql() (<root>/p/<post_shortcode>/) but it doesn't work for some story URLs (<root>/stories/<username>/<media_id>/) or reel URLs (<root>/reel/<post_shortcode>/). Is it not better to use self.url instead?
  • description: Seems like it can be gotten from post["caption"]["text"] or item["caption"]["text"].
  • tags: Can be parsed from description as in _parse_post_graphql().
  • location-*: post["location"]
  • likes: post["like_count"]

I particularly need post_url as I like to know where a file came from if I ever need to redownload it or reacquire metadata with
--no-download --no-skip.

@KonoVitoDa
Copy link

KonoVitoDa commented Jun 22, 2022

I particularly need description and sometimes tags and likes. I was going to post a new issue right now asking where they are, but I found that you've already done that, thanks.

EDIT: Is there a workaround to filter posts by WORD in description/tags/amount of likes?

@mikf
Copy link
Owner

mikf commented Jul 8, 2022

This was fixed in commit 7af4d20 in the latest release (v1.22.2 or .3)

I've left post_url as <root>/p/<post_shortcode>/ for all posts including stories since you crossed out your annotation. Hope that's OK.

EDIT: Is there a workaround to filter posts by WORD in description/tags/amount of likes?

You should be able to do this with regular expressions when searching through a string value: re.search('\\\\bWORD\\\\b', description). (Yes, all those backslashes are necessary to end up with a \b in the actual regex)

When searching through a list (or if you want to keep it simple), you can do 'WORD' in tags. That works as expected on lists, but also matches AWORDB in a string.

@bradenhilton
Copy link
Contributor Author

I've left post_url as <root>/p/<post_shortcode>/ for all posts including stories since you crossed out your annotation. Hope that's OK.

@mikf I did that as I tested it shortly after creating the issue and it appears that <root>/p/<post_shortcode>/ and <root>/reel/<post_shortcode>/ etc. are functionally the same. See reel url and p url for an example. It also doesn't really make much sense to save the url for a story as they expire.

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

No branches or pull requests

3 participants