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

Can't connect to the reddit #75

Open
GwynbleiddI opened this issue May 23, 2024 · 5 comments
Open

Can't connect to the reddit #75

GwynbleiddI opened this issue May 23, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@GwynbleiddI
Copy link

2024-05-23 20:41:40|ArchiSteamFarm-22808|DEBUG|ASF|InternalRequest() Forbidden <- GET https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:40|ArchiSteamFarm-22808|WARN|ASF|UrlGetToStream() Запрос окончился неудачей после 1 попыток!
2024-05-23 20:41:40|ArchiSteamFarm-22808|DEBUG|ASF|UrlGetToStream() Запрос не удался: https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:41|ArchiSteamFarm-22808|DEBUG|ASF|InternalRequest() Forbidden <- GET https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:41|ArchiSteamFarm-22808|WARN|ASF|UrlGetToStream() Запрос окончился неудачей после 1 попыток!
2024-05-23 20:41:41|ArchiSteamFarm-22808|DEBUG|ASF|UrlGetToStream() Запрос не удался: https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:42|ArchiSteamFarm-22808|DEBUG|ASF|InternalRequest() Forbidden <- GET https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:42|ArchiSteamFarm-22808|WARN|ASF|UrlGetToStream() Запрос окончился неудачей после 1 попыток!
2024-05-23 20:41:42|ArchiSteamFarm-22808|DEBUG|ASF|UrlGetToStream() Запрос не удался: https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:44|ArchiSteamFarm-22808|DEBUG|ASF|InternalRequest() Forbidden <- GET https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:44|ArchiSteamFarm-22808|WARN|ASF|UrlGetToStream() Запрос окончился неудачей после 1 попыток!
2024-05-23 20:41:44|ArchiSteamFarm-22808|DEBUG|ASF|UrlGetToStream() Запрос не удался: https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:47|ArchiSteamFarm-22808|DEBUG|ASF|InternalRequest() Forbidden <- GET https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:47|ArchiSteamFarm-22808|WARN|ASF|UrlGetToStream() Запрос окончился неудачей после 1 попыток!
2024-05-23 20:41:47|ArchiSteamFarm-22808|DEBUG|ASF|UrlGetToStream() Запрос не удался: https://www.reddit.com/user/ASFinfo.json?sort=new
2024-05-23 20:41:47|ArchiSteamFarm-22808|ERROR|ASF|CollectGames() Unable to load json from reddit RedditServerException: content is null

ASF:

ASF: v6.0.2.6
Plugin: v1.5.3

@maxisoft
Copy link
Owner

Hello @GwynbleiddI,

Thank you for reporting this issue. After reviewing the logs, it's seems that the requests to Reddit are being denied, resulting in a Forbidden status. This could be attributed to a few potential causes:

  • Reddit’s Rate Limiting: Applications may be subject to rate limits based on IP addresses or other identifying factors, even without OAuth.
  • IP Ban: An IP address associated with a VPN, proxy, Tor, or flagged by Reddit could be blocked from accessing certain endpoints.
  • Temporary Restrictions: Reddit may enforce temporary restrictions on accounts or IPs in response to suspicious activity.

To assist us in resolving this issue, could you please confirm if you can access the following URL from your regular browser: https://www.reddit.com/user/ASFinfo.json?sort=new

I will keep this issue open to collect more information and determine if this is affecting other users as well.

Best regards,
maxisoft

@GwynbleiddI
Copy link
Author

Really the problem was address blocking. My AFS is located on remote servers in the Netherlands. Connecting to a VPN solved the problem.

@kaiserdj
Copy link

First of all, thank you very much for the excellent work on this plugin.

I'd like to suggest a new feature that I think could benefit many users: the option to use a proxy for Reddit requests. Currently, some of us are looking at ASF on VPS whose IP is blocked by Reddit, preventing the plugin from working properly.

Adding an option to configure a proxy will allow you to bypass these restrictions and improve the accessibility of the plugin from different hosting environments.

I appreciate your attention and consideration for this request.

@C4illin
Copy link

C4illin commented Jun 1, 2024

Hello, I am the developer of the bot you are parsing https://github.com/C4illin/ASFinfo

Maybe you could use https://gist.github.com/C4illin/77a4bcb9a9a7a95e5f291badc93ec6cd instead, it's the same data as posted on reddit.

@maxisoft
Copy link
Owner

maxisoft commented Jun 3, 2024

Hey guys,

Thanks for your comments!

@kaiserdj - You're welcome.
Adding proxy support is a fantastic suggestion, and I'll definitely aim to incorporate that into the next version.
The main challenge right now is ensuring compatibility with ASF's trimmed version to avoid further MissingMethodException issues.

@C4illin - Thanks for reaching out and offering your work! I trully appreciate you maintaining the ASFinfo bot.
While I can't directly swap the Reddit API call for your Gist due to needing the free-to-play or is a dlc data (which isn't included in the gist), it's a fantastic resource to have as a backup in case Reddit is not reachable.
That being said, there's always the possibility of GitHub blocking those same VPN/VPS IPs too.

Additional Ideas

  • Explore utilizing redlib instances as an alternative to Reddit Json api.
  • Implement a GitHub Actions workflow to pre-parse data on a schedule, eliminating the need for on-plugin parsing.

In summary:

  • Proxy support for Reddit requests is being targeted for the next plugin update.
  • C4illin's Gist will be considered as a backup data source.

I'll keep this issue updated as I make progress.

@maxisoft maxisoft added the bug Something isn't working label Jun 3, 2024
maxisoft added a commit that referenced this issue Jun 6, 2024
This commit introduces proxy support for Reddit requests within the ASFFreeGames plugin, addressing issues #75 #76.

Users can now configure proxies for both general and Reddit-specific connections through the Proxy and RedditProxy settings in ASFFreeGamesOptions.cs.

Key changes:

- ASFFreeGamesOptions.cs: Added properties Proxy and RedditProxy to support proxy configuration for general and Reddit connections respectively.
- ASFFreeGamesOptionsLoader.cs: Updated to load proxy settings from configuration and environment variables.
- FreeGamesCommand.cs: Modified GetGames to utilize SimpleHttpClientFactory and its CreateForReddit method, enabling the use of the configured Reddit proxy.
- RedditHelper.cs: Replaced WebBrowser usage with SimpleHttpClient for Reddit communication, allowing proxy support.

These improvements enhance the plugin's flexibility by allowing users to leverage proxy servers for Reddit interactions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants