cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
610 stars 198 forks source link

HTTP 403 for all leagues #547

Open benwolbransky opened 3 months ago

benwolbransky commented 3 months ago

Sport

Football

Summary

I'm running my script which was worked previous times in the past, but now I'm getting HTTP 403 when trying to access my public league. Even when trying to access the test instance, I get this same error (league_id = 123, season 2018). For the baseball test, the same thing happens ( leauge_id = 81134470, season= 2021).

I'm not sure if I'm doing something incorrectly, but hoping someone can validate that this is not working as intended.

Logs/Data

No response

dtcarls commented 3 months ago

Are you using the latest version? It was semi-recently fixed. https://github.com/cwendt94/espn-api/issues/539

tkauffman42 commented 3 months ago

Upgraded to version 0.36.0 and I am also running into this issue.

HTTPSConnectionPool(host='lm-api-reads.fantasy.espn.com', port=443): Max retries exceeded with url: /apis/v3/games/ffl/seasons/2023/segments/0/leagues/[LEAGUEID]?view=mTeam&view=mRoster&view=mMatchup&view=mSettings&view=mStandings (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))

It is happening to all scripts that I created last year. I also got the latest espn_s2 cookie for a private league

tkauffman42 commented 3 months ago

I did just try on another computer, it did work......

DesiPilla commented 1 month ago

Make sure that the leagues have been re-activated. That could also be a cause of the error.

bs0l commented 1 month ago

Upgraded to version 0.36.0 and I am also running into this issue.

HTTPSConnectionPool(host='lm-api-reads.fantasy.espn.com', port=443): Max retries exceeded with url: /apis/v3/games/ffl/seasons/2023/segments/0/leagues/[LEAGUEID]?view=mTeam&view=mRoster&view=mMatchup&view=mSettings&view=mStandings (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))

It is happening to all scripts that I created last year. I also got the latest espn_s2 cookie for a private league

Did you ever end up getting this working? I am having the same issue. Confirmed that I was running 0.36 but still encountering the 403 forbidden issue.

tkauffman42 commented 1 month ago

I cannot get this to work on my work computer. I am not sure if that is the root cause, or if it is because I have multiple versions of Python install.

On my personal Mac, I can get it to run with no issues

cwendt94 commented 1 month ago

What python version are you seeing this error? That might be causing it.

bs0l commented 1 month ago

From what I can tell I just have one version of python installed, which is 3.9.9

Edit: I sorted it out. After viewing the logs for my docker container I noticed that despite me building a new container some old versions of the API were laying around. wiped all of that and started over, now it is up and running without any 403 errors

tkauffman42 commented 4 weeks ago

Finally sat down and spent time trying to figure out what is going on

The same as bs0l, I had launcher paths in the Environment Variables that were pointing to wrong versions. I went through Program Files, AppData/Roaming and AppData/Local and removed all references of Python folder, then uninstalled Python and re-installed in a customized location that I wanted it in

loupalladino commented 2 weeks ago

For what it's worth - I had been using python 3.8 with version 0.33 all last year with no issue, but hit the 403 with this year's football league. After updating to the latest version of the API (0.38.1), it resolved the 403.