Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error fetching NHL games **SOLUTION ADDED** #46

Open
macray76 opened this issue Sep 2, 2020 · 1 comment
Open

Error fetching NHL games **SOLUTION ADDED** #46

macray76 opened this issue Sep 2, 2020 · 1 comment

Comments

@macray76
Copy link

macray76 commented Sep 2, 2020

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
Copy link
Author

macray76 commented Sep 3, 2020

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 macray76 changed the title Error fetching NHL games Error fetching NHL games **SOLUTION ADDED** Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant