TypeError when trying to subscribeUserPosts() #4
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: KaKi87/scraper-instagram-v1#4
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I get these errors when i'm trying to subscribe with the function subscribeUserPosts().
When I start the program I get this error once:
And then I get this when the account that i want to subscribe to has posted something:
I don't really know what's happening
At
index.js:437
:The error :
As the documentation stipulates :
And :
Conclusion : the subscribed profile is private and either you are not logged in to your Instagram account or you are not following the subscribed profile.
Yes, thank you for responding so quick.
But I checked before if I was logged in and if I followed the account I wanted to "subrscribe" to. In fact even logged in, I can't use
subscribeUserPosts()
for any private account. Even though I am logged in.I can see my profile with the this: ...but the error is still the same
I checked everything and the error didn't change.
I also discovered two other things:
When I try to "subscribe" to a public account it seems to work at first, but then when a new post is detected, I just get
undefined
in the console instead of the post information.The shortcodes for private accounts are not supported in the
getPost()
function. I i try, I one of the errors I got yesterday:Thanks for the time and help!
Alright, investigating now.
Regarding subscribing public profiles though, I have a Discord bot running 24/7 which is simultaneously subscribed to 3 profiles and reposting their posts on a public community server, and it's been working fine for months now.
Although I can't reproduce the public profile issue, I can reproduce the
getPost()
issue with private profiles.Working on it.
So, I actually forgot a very small detail xD (
44b34d59
)Accessing post from followed private profiles is now working.
Ok I just found out why I couldn't get the posts. It was dumb from me: In the documentation and in my code, for
subscribeUserPosts()
, there was:but ther is no
shortcode
inpost
, sopost.shortcode === undefined
is always truebut there is
post.link
Okay, feel free to close this issue if everything is fixed. :)
Then, I'll make an NPM release.
I just have another issue, but it's not critical for me. I tried using the functions
subscribeUserPosts()
for a private user but it does not work. The functiongetProfile()
showslastPosts: null
for a private user I should be following.Maybe I am doing things wrong.
Anyways thanks!
Did you try with the latest commit ?
Oh, you mean no access while logged in?
That's very weird.
Can you show me the code?
it prints
I used the last commit
Are you coding JS for the first time ?
The issue is that all your requests are executed at the same time without waiting for each other.
Here you go :
Yeah thank you very much!
I'm pretty new to programming in general and I try to learn everything alone(no ones teaches me how to do it).
Now seeing your answer it seems logical. Does it have something to do with async functions? I think I need to learn the syntax :)
Yes, the async/await syntax is also useful.
But you need to learn about promises first.
Thanks!