-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Initial InstagramBridge private feed - Include CSRF #1894
Conversation
I followed the instructions and it didn't work |
It is possible to mark any PR as draft, to deny merging it accidentally. |
I've been experimenting with this and I still am so I'm not sure if I've found a good solution or how long it will last, but it at least seems to be working. Surprisingly providing the CSRF token doesn't seem to do anything. The only thing that seems to work, at least for me, is the sessionid cookie. Similar to what you've done, I added a constant with my sessionid near the top, added this within getInstagramJSON:
and added $header to the getContents function call:
I'm not sure how this affects 429 errors but it at least allows me to view profiles I follow that are not public so it appears to be doing so using my credentials as if I've logged in. |
Hi, @JimDog546 ! Is your solution with session id is still working? |
I mean do you meet 429 errors on your private RSS-Bridge instance? |
@em92 Yes, the session id is still working for me. No more 429 errors, but I did run into one similar issue that I've worked around with caching. My feed reader (Inoreader) doesn't allow me to specify the update interval and I'm using it against 300+ profiles. After a few days of its very frequent queries, Instagram sent me an e-mail saying they thought my account was compromised and they eventually temporarily blocked my IP address. I shut everything down for a few days to let that clear up and experimented with caching to try to cut down on the amount of requests that actually get sent to Instagram. Surprisingly I was able to make things work simply by adding a CACHE_TIMEOUT to InstagramBridge.php:
12 hours works for me and my needs so I haven't experimented with any lower values for more frequent updates. I've been running this way (with the session ID cookie and CACHE_TIMEOUT) for at least a month with no issues. |
Thanks for the report @JimDog546! |
@Fmstrat Any progress here? We need a maintainer for the Instagram bridge. Can you step up? |
[HOLD PR]
A bit more research needs to be done to store the full cookie data. Since the
urlgen
cookie variable is tied to IP, this is not as straight forward as first appeared. The 429 block may have expired during my testing causing false positives with the CSRF tokenPurpose
While integration with the new configuration PR (#1343) is required, this takes the first steps to enabling private feeds in the Instagram Bridge.
Caveats
I cannot fully validate this without wider user testing for 429 errors, however in my brief testing it has worked well.
Usage
Until the above integration occurs, users will need to edit the
CSRF_TOKEN
variable (see here) to match a token they get from Instagram. To get a token, users can view any page on Instagram while logged in and look at the network inspector for any call to a/graphql
URL: