uberfastman / fantasy-football-metrics-weekly-report

Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, ESPN, CBS, Sleeper, Fleaflicker
GNU General Public License v3.0
196 stars 46 forks source link

[Bug] Unable to generate FF report for CBS league #203

Closed kkiuchi closed 10 months ago

kkiuchi commented 11 months ago

Description of Issue

Unable to get report generated for CBS as I run into issues retrieving data from the CBS API. (non-auth AFAIK) Any assistance is greatly appreciated @uberfastman! (Love the reports for my yahoo league)

Steps to reproduce:

  1. Pulled the latest code from the repo
  2. Entered credentials into auth/cbs/private.json
  3. Updated config.ini with leagueID
  4. Spun up docker container and ran docker exec -it fantasy-football-metrics-weekly-report-app-1 python3 main.py
  5. Confirmed App was up to date (v.16.0.0) & Auth token was properly saved to private.json
  6. Select (y) for defaults
  7. Run into the following cascading error:

    2023-11-08 00:01:13,765 - report.builder - INFO - Generating CBS Fantasy Football report with settings: league id: leaguinglasvegas1501086490 game id: nfl week: selected/default start_week: default=1 save_data: False refresh_web_data: False playoff_prob_sims: None break_ties: False dq_ce: False offline: False test: False on Nov 08, 2023... 2023-11-08 00:01:13,766 - report.builder - INFO - Retrieving fantasy football data from CBS API... Traceback (most recent call last): File "/opt/ffmwr/main.py", line 299, in report = select_league( ^^^^^^^^^^^^^^ File "/opt/ffmwr/main.py", line 175, in select_league return FantasyFootballReport( ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/ffmwr/report/builder.py", line 105, in init self.league: BaseLeague = league_data_factory( ^^^^^^^^^^^^^^^^^^^^ File "/opt/ffmwr/utilities/app.py", line 207, in league_data_factory return cbs_league.map_data_to_base() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/ffmwr/dao/platforms/cbs.py", line 142, in map_data_to_base self.league.faab_budget = self.extract_integer( ^^^^^^^^^^^^^^^^^^^^^ File "/opt/ffmwr/dao/platforms/cbs.py", line 109, in extract_integer return int("".join(filter(str.isdigit, input_str_with_embedded_int))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'int' object is not iterable

Other steps taken

I checked auth settings, leagueID, firewall, config settings, which didn't seem to turn up any findings but I haven't debugged further at this juncture.

Fantasy Football Platform

CBS

League ID

leaguinglasvegas1501086490

Operating System

macOS Ventura 13.2 / intel i9 Python 3.9.6

Other

Attaching config.ini: config.ini.txt

uberfastman commented 10 months ago

Hi @kkiuchi, I apologize for taking so long to get to this... I was in the midst of a fairly large overhaul to how the app configuration works, and life got busy, so I wasn't able to push the fix until now. However, release v17.0.0 in 2364f0db45f8cbcf2d69c180e00ed807ff90ec97 includes a fix that should let you run this for your CBS league.

Please let me know if you run into any issues!

kkiuchi commented 10 months ago

@uberfastman amazing! Tysm!

uberfastman commented 10 months ago

No problem @kkiuchi, please let me know if you run into any other issues. I don't play in any real CBS leagues myself, so I was just using a dummy league to test the functionality. As such, I'd be surprised if there aren't a few offer little tweaks needed to get things working perfectly with CBS since all the API documentation is from nearly a decade ago.