skadogg / personal-tv-guide

Python-based JustWatch scraper
GNU General Public License v3.0
6 stars 7 forks source link

🐛 Scrape fails when show has no runtime listed #96

Closed skadogg closed 6 months ago

skadogg commented 6 months ago

image

Twisters is coming out later this year, but there's no runtime shown yet. Without a runtime, the _runtime_tominutes function fails:

Traceback (most recent call last):
  File "c:\Users\gunner\Documents\git\personal-tv-guide\run.py", line 32, in <module>
    modules.justwatch.scrape_justwatch('Movies')
  File "c:\Users\gunner\Documents\git\personal-tv-guide\modules\justwatch.py", line 275, in scrape_justwatch
    show_runtime_minutes = Activity.runtime_to_minutes(show_runtime, round_up=False)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\gunner\Documents\git\personal-tv-guide\classes\activity.py", line 29, in runtime_to_minutes
    if 'h' in runtime_str:
       ^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

Activity.duration is stored as an int to represent minutes. Maybe upcoming shows should just be ignored.

skadogg commented 6 months ago

It does look like #98 does take care of this.

image