espn-api icon indicating copy to clipboard operation
espn-api copied to clipboard

HTTP 403 for all leagues

Open benwolbransky opened this issue 1 year ago • 11 comments

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

benwolbransky avatar Jun 07 '24 14:06 benwolbransky

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

dtcarls avatar Jun 07 '24 18:06 dtcarls

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 avatar Jun 19 '24 15:06 tkauffman42

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

tkauffman42 avatar Jun 19 '24 17:06 tkauffman42

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

DesiPilla avatar Aug 04 '24 13:08 DesiPilla

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.

bs0l avatar Aug 21 '24 23:08 bs0l

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

tkauffman42 avatar Aug 22 '24 12:08 tkauffman42

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

cwendt94 avatar Aug 22 '24 13:08 cwendt94

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

bs0l avatar Aug 23 '24 21:08 bs0l

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

tkauffman42 avatar Sep 04 '24 13:09 tkauffman42

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.

loupalladino avatar Sep 13 '24 19:09 loupalladino