Skip to content

npo_watchlist grid-favourite can be missing, spawns an error #1941

@mfonville

Description

@mfonville

If using npo.nl with e.g. max_episode_age_days set it can easily occur that no recent favourites are shown in the mijn.npo.nl list.

This spawns an error, because on line 241 (but also 245 and 249) silently assume that the div with grid-favourite-episodes-today will exist, even though it does not always do. We need to do more checking if episodes is not None before staring the parsing (are make the parsing safe for None-types)

Log:

2017-08-13 20:48 CRITICAL task          Series-NPO      BUG: Unhandled error in plugin npo_watchlist: 'NoneType' object has no attribute 'findAll'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flexget/task.py", line 486, in __run_plugin
    return method(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flexget/event.py", line 23, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/input/npo_watchlist.py", line 262, in on_task_input
    entries += self._get_favorites_entries(task, config, page)
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/input/npo_watchlist.py", line 225, in _get_favorites_entries
    return self._get_recent_entries(task, config, page)
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/input/npo_watchlist.py", line 242, in _get_recent_entries
    entries = self._parse_tiles(task, config, episodes)
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/input/npo_watchlist.py", line 168, in _parse_tiles
    for list_item in tiles.findAll('div', class_='npo-asset-tile-container'):
AttributeError: 'NoneType' object has no attribute 'findAll'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions