KhoalaS / Infinity-For-Reddit

A Reddit client for Android
https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit
GNU Affero General Public License v3.0
310 stars 13 forks source link

Bypass rate limit when not logged in #12

Closed krlvm closed 1 year ago

krlvm commented 1 year ago

Requests coming from unauthorized users now also partially mimic the official application (we get an OAuth access token based on a random UUID / Device ID), which bypasses the rate limit of 10 requests per minute.

krlvm commented 1 year ago

Are you sure you are testing with the correct addresses? I found them while inspecting the network activity of the official Reddit client, so I don't think it's necessary to change the scope and endpoints.

I've been using the version with these changes for several days now, everything works.

Here's the Insomnia collection: Insomnia_2023-08-31.zip

krlvm commented 1 year ago

I have to say that I have inspected a rather old version of the Reddit client released a few years ago, maybe the latest versions use a different endpoints, but these also work, I don't get the 403 error.

KhoalaS commented 1 year ago

Got it to work thank you. The newer versions of the app dont use that endpoint anymore. I would prefer using the new endpoint, since it could be kinda suspicious that the newest app version is hitting old endpoints.

krlvm commented 1 year ago

Got it to work thank you. The newer versions of the app dont use that endpoint anymore. I would prefer using the new endpoint, since it could be kinda suspicious that the newest app version is hitting old endpoints.

Good point, I'll check the latest versions endpoints later. In general, they cannot simply disable old endpoints, since this will break clients of old versions, which they are unlikely to do (although it depends on fragmentation of versions distribution).

I also found a way to fix video/GIF playback from some services that report "Bad request signature", just change the User-Agent RedditVideo to just Reddit.

KhoalaS commented 1 year ago

I pulled the PR into a local branch and changed the API and everything works fine.

I also found a way to fix video/GIF playback from some services that report "Bad request signature", just change the User-Agent RedditVideo to just Reddit.

What domain exactly did that happen?

I am pushing the PR and some changes to anonymous mode to the main branch. External Videos should load fine now when viewing a subreddit. As for the home feed, it is loading redgifs through v.reddit now and i changed the User-Agent for Streamable videos.