streamglob icon indicating copy to clipboard operation
streamglob copied to clipboard

Error fetching NHL games **SOLUTION ADDED**

Open macray76 opened this issue 4 years ago • 1 comments

Hi. Trying to fetch yesterday's NHL game for NY Islanders (although same error appears for any other team) and it is coming up with the following error (I'm running the latest unstable branch):

$ streamglob download://nhl/$(date -d yesterday +%Y-%m-%d).nyi
couldn't find command for feh
couldn't find command for mpv
couldn't find command for vlc
2020-09-02 14:25:46 [            base:182 ] [ warning] couldn't initialize configuration for instagram
2020-09-02 14:25:46 [            base:182 ] [ warning] couldn't initialize configuration for nhl
Traceback (most recent call last):
  File "/home/macray76/.local/bin/streamglob", line 8, in <module>
    sys.exit(main())
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/__main__.py", line 683, in main
    action, provider, selection, opts = providers.parse_spec(options.spec)
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/providers/__init__.py", line 56, in parse_spec
    selection, identifier_opts = p.parse_identifier(identifier)
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/providers/bam.py", line 2027, in parse_identifier
    self.filters["date"].value = game_date
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/providers/filters.py", line 36, in value
    changed = (self.widget.value != value)
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/providers/filters.py", line 81, in widget
    *self.widget_args, **self.widget_kwargs
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/providers/bam.py", line 1364, in widget_kwargs
    return {"initial_date": self.provider.start_date}
  File "<string>", line 2, in start_date
  File "/usr/local/lib/python3.7/dist-packages/pony/orm/core.py", line 528, in new_func
    result = func(*args, **kwargs)
  File "/home/macray76/.local/lib/python3.7/site-packages/streamglob/providers/nhl.py", line 448, in start_date
    start = dateutil.parser.parse(j["seasons"][0]["regularSeasonStartDate"])
IndexError: list index out of range

Anyone else getting the same issue or is it just me?

Thanks in advance!

macray76 avatar Sep 02 '20 13:09 macray76

I've diagnosed the issue and fixed it in my copy so at least it works for the remainder of this (unique) season.

One change required in the nhl.py file...

Line 428 was: season_year = (now - relativedelta(months=8)).year Now: season_year = (now - relativedelta(months=9)).year

Beforehand it was trying to parse the URL https://statsapi.web.nhl.com/api/v1/seasons/20202021 and we're not quite there yet!!!

macray76 avatar Sep 03 '20 12:09 macray76