ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.28k stars 263 forks source link

feat: reddit sync imgur client id and client secrets key swap #682

Closed Rihcus closed 3 months ago

Rihcus commented 1 year ago

Application

Reddit Sync

Issue

Allow uploading to imgur after June 30th and fix current issues with viewing imgur albums in app

Patch

Ability to swap client id and client secret in reddit sync app

Motivation

Preserver imgur functionality in the long run

Acknowledgements

Doc-4 commented 1 year ago

I would also like this to be available, as well as the effective functionality as documented in the attached image to effectively make sync act as if it's the official app, and preserve API access to subreddits marked as NSFW API

oSumAtrIX commented 1 year ago

@Rihcus Why should uploading to imgur not work?

@Doc-4 I don't see how changing the secrets grants access to NSFW posts. The authorization method is still OAuth. The official client does not use OAuth as far as I am concerned.

Rihcus commented 1 year ago

@Rihcus Why should uploading to imgur not work?

@Doc-4 I don't see how changing the secrets grants access to NSFW posts. The authorization method is still OAuth. The official client does not use OAuth as far as I am concerned.

I'm not sure if this is the case with reddit sync but in apollo the dev was paying for the imgur api (about $100 a month). I'm not sure the scale reddit sync is working with but I assumed (maybe wrongly) that sync might be paying for a commercial plan to handle the large volume of imgur requests. After June 30th since sync would be discontinued I thought the dev may either delete the key or atleast downgrade it back to free plan at which users would either be faced with rate limits or failure to upload.

Edit: Apollo was paying approximately $166 a month for imgur api

https://www.pcmag.com/news/developer-says-access-to-reddits-api-would-cost-him-20m-per-year#:~:text=In%20his%20post%2C%20Selig%20also,a%20month%20for%20API%20access.

Doc-4 commented 1 year ago

@Rihcus Why should uploading to imgur not work?

@Doc-4 I don't see how changing the secrets grants access to NSFW posts. The authorization method is still OAuth. The official client does not use OAuth as far as I am concerned.

These are the keys and headers used by the official app, likely a combination effect. Regardless if it's not, any amount of complexity can be figured out by logging network traffic and decompiling the official app, but it seems that's what was done to get this.

Rihcus commented 1 year ago

@Rihcus Why should uploading to imgur not work? @Doc-4 I don't see how changing the secrets grants access to NSFW posts. The authorization method is still OAuth. The official client does not use OAuth as far as I am concerned.

I'm not sure if this is the case with reddit sync but in apollo the dev was paying for the imgur api (about $100 a month). I'm not sure the scale reddit sync is working with but I assumed (maybe wrongly) that sync might be paying for a commercial plan to handle the large volume of imgur requests. After June 30th since sync would be discontinued I thought the dev may either delete the key or atleast downgrade it back to free plan at which users would either be faced with rate limits or failure to upload.

Edit: Apollo was paying approximately $166 a month for imgur api

https://www.pcmag.com/news/developer-says-access-to-reddits-api-would-cost-him-20m-per-year#:~:text=In%20his%20post%2C%20Selig%20also,a%20month%20for%20API%20access.

So a bit of a snag with this reddit sync (as well as other apps like apollo) use imgur rapid api instead of the stock api since they are commercial apps. Problem with that is if you try swapping out the rapid api key you would need a paid imgur rapid api account at $500 a month (unpractical).

SCR-20230701-ibzf

The end point would need to be changed from: https://imgur-apiv3.p.rapidapi.com/ to https://api.imgur.com/

image

Rihcus commented 1 year ago

@Rihcus Why should uploading to imgur not work?

@Doc-4 I don't see how changing the secrets grants access to NSFW posts. The authorization method is still OAuth. The official client does not use OAuth as far as I am concerned.

Imgur uploads are officially disabled

https://github.com/revanced/revanced-patches/assets/30292597/3f69ce2c-2a85-4c2f-bafd-7c4b408bc774

oSumAtrIX commented 3 months ago

I think this is resolved now.