ChunkedEncodingError("Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)) #269
Unanswered
noahantoun
asked this question in
ESPN API
Replies: 1 comment 1 reply
-
I think ESPN will close/reject calls if you call them too many times in a short period |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Curious if anyone else has had this error. From what I can tell, its an error on their side.
I know I am requesting a lot and wonder if it ESPN doesn't like it and are kicking me off.
TeamWeekID = []
Week = []
TeamID = []
Roster = []
YearID = []
SlotPosition = []
Projected = []
Year = [2019]
for y in Year:
from espn_api.football import League
league = League(league_id= LID, year= y, espn_s2 =ES2, swid=swid)
for w in range (0,len(league.teams[1].schedule)):
for m in range(0,len(league.box_scores(week = w))):
for r in range (0,len(league.box_scores(week = w)[m].home_lineup)):
YearID.append(y)
TeamWeekID.append(str(league.box_scores(week = w)[m].home_team) + "-" + str(w))
Week.append(w+1)
TeamID.append(league.box_scores(week = w)[m].home_team)
Roster.append(league.box_scores(week = w)[m].home_lineup[r].playerId)
Projected.append(league.box_scores(week = w)[m].home_lineup[r].projected_points)
SlotPosition.append(league.box_scores(week = w)[m].home_lineup[r].slot_position)
rosterweek = {'TeamWeekID':TeamWeekID, 'Year':YearID, 'Week':Week, 'Team ID':TeamID, 'Roster':Roster, 'Projected Points':Projected, 'Slot Position':SlotPosition}
rosterweekdf = pd.DataFrame(teamweek,columns=['TeamWeekID', 'Year', 'Week', 'Team ID', 'Roster', 'Projected Points', 'Slot Position'])
rosterweekdf.set_index('TeamWeekID', inplace=True)
Beta Was this translation helpful? Give feedback.
All reactions