Repository: pymedusa/Medusa

Issue:
AttributeError: 'NoneType' object has no attribute 'indexer'
@p0psicles 

@ratoaq2 I only saw this issue in log, didn't got any traceback. know why?

```
2016-12-02 19:05:00 INFO     FINDPROPERS :: [Rarbg] :: [1d6c65b] Searching for any new PROPER releases from Rarbg
2016-12-02 19:05:01 DEBUG    FINDPROPERS :: [Rarbg] :: [1d6c65b] GET URL: http://torrentapi.org/pubapi_v2.php?get_token=get_token&app_id=medusa&format=json [Status: 200]
2016-12-02 19:05:01 DEBUG    FINDPROPERS :: [Rarbg] :: [1d6c65b] Search mode: Episode
2016-12-02 19:05:01 DEBUG    FINDPROPERS :: [Rarbg] :: [1d6c65b] Unknown exception while searching for propers in Rarbg, skipping: 'NoneType' object has no attribute 'indexer'
2016-12-02 19:05:01 DEBUG    FINDPROPERS :: [Rarbg] :: [1d6c65b] Traceback (most recent call last):
  File "C:/Users/Fernando/Documents/Medusa\medusa\search\proper.py", line 137, in _get_proper_results
    cur_propers = cur_provider.find_propers(recently_aired)
  File "C:/Users/Fernando/Documents/Medusa\medusa\providers\generic_provider.py", line 148, in find_propers
    for item in self.search(search_strings[0], ep_obj=episode_obj):
  File "C:/Users/Fernando/Documents/Medusa\medusa\providers\torrent\json\rarbg.py", line 99, in search
    search_params['search_tvdb'] = self._get_tvdb_id()
  File "C:/Users/Fernando/Documents/Medusa\medusa\providers\generic_provider.py", line 486, in _get_tvdb_id
    return self.show.indexerid if self.show.indexer == INDEXER_TVDBV2 else self.show.externals.get('tvdb_id')
AttributeError: 'NoneType' object has no attribute 'indexer'
```


Discussion:
Aaah yes, that was the proper issue. Forgot about that one!
when debugging, in rarbg.py, the self is the show and self.show.indexer = 1

but when it go to generic_provider, show is none:
![image](https://cloud.githubusercontent.com/assets/2620870/20850624/40f60488-b8c3-11e6-9963-b7366a14b9dd.png)

how come BTN works and uses the same code?
Good question. Dunno. Will look at it tomorrow.
is this related?

https://github.com/pymedusa/Medusa/commit/83c0a76058afb1da32d9f5868ea77c46307c49ae#diff-8f50bd624d67da320df146adc0eec690R37

 ping @ratoaq2 as he asked to change that.

Not related. i just tested.
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.4.38-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.5`
**Commit**: pymedusa/Medusa@d8dee4e20b9df4dfb6ae940942970b97518a2d79
**Link to Log**: https://gist.github.com/06e0f9d25650190268e794694cbcbcb5
### ERROR
<pre>
2017-03-01 11:04:43 ERROR    SEARCHQUEUE-BACKLOG-256115 :: [d8dee4e] Checking AniDB scene exceptions update failed for Tatort. Error: 'NoneType' object has no attribute 'findall'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/medusa/scene_exceptions.py#L409">medusa/scene_exceptions.py</a>", line 409, in _get_anidb_exceptions
    autoCorrectName=True
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/lib/adba/aniDBAbstracter.py#L131">lib/adba/aniDBAbstracter.py</a>", line 131, in __init__
    self.aid = self.tvDBMap.get_anidb_for_tvdb(self.tvdb_id)
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/lib/adba/aniDBtvDBmaper.py#L38">lib/adba/aniDBtvDBmaper.py</a>", line 38, in get_anidb_for_tvdb
    return self._get_x_for_y(tvdb_id,"tvdbid","anidbid")
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/lib/adba/aniDBtvDBmaper.py#L44">lib/adba/aniDBtvDBmaper.py</a>", line 44, in _get_x_for_y
    for anime in self.xmlMap.findall("anime"):
AttributeError: 'NoneType' object has no attribute 'findall'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.4.38-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.5`
**Commit**: pymedusa/Medusa@d8dee4e20b9df4dfb6ae940942970b97518a2d79
**Link to Log**: https://gist.github.com/9b7383c251d858be85f414b810edab42
### ERROR
<pre>
2017-03-01 11:04:42 ERROR    SEARCHQUEUE-BACKLOG-256115 :: [d8dee4e] Checking AniDB scene exceptions update failed for Billboard Music Awards. Error: 'NoneType' object has no attribute 'findall'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/medusa/scene_exceptions.py#L409">medusa/scene_exceptions.py</a>", line 409, in _get_anidb_exceptions
    autoCorrectName=True
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/lib/adba/aniDBAbstracter.py#L131">lib/adba/aniDBAbstracter.py</a>", line 131, in __init__
    self.aid = self.tvDBMap.get_anidb_for_tvdb(self.tvdb_id)
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/lib/adba/aniDBtvDBmaper.py#L38">lib/adba/aniDBtvDBmaper.py</a>", line 38, in get_anidb_for_tvdb
    return self._get_x_for_y(tvdb_id,"tvdbid","anidbid")
  File "/home/pi/Medusa/<a href="../blob/d8dee4e20b9df4dfb6ae940942970b97518a2d79/lib/adba/aniDBtvDBmaper.py#L44">lib/adba/aniDBtvDBmaper.py</a>", line 44, in _get_x_for_y
    for anime in self.xmlMap.findall("anime"):
AttributeError: 'NoneType' object has no attribute 'findall'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
@p0psicles need a fix in adba lib right?
More like a refactor
yeah but for now we can check `self.xmlMap` before call findall right?
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.4.38-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@ebdacab6f3da657d4069f9e4a391ad00595087f6
**Link to Log**: https://gist.github.com/a3364df9e152e0695760ba9a87ec732b
### ERROR
<pre>
2017-05-23 03:48:19 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [LimeTorrents] :: [ebdacab] Failed parsing publishing date.
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/ebdacab6f3da657d4069f9e4a391ad00595087f6/medusa/providers/generic_provider.py#L499">medusa/providers/generic_provider.py</a>", line 499, in parse_pubdate
    seconds = parse(match.group('time'))
AttributeError: 'NoneType' object has no attribute 'group'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
That's by design. @medariox maybe we should also log the date that it's trying to parse?
Yes, the plan was to have an exception so that it can be fixed. I will include the date to the traceback.
### INFO
**Python Version**: `2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]`
**Operating System**: `Windows-10-10.0.15063`
**Locale**: `cp1252`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@a47fc33aeee33f6f1cf76c2c76b36e16407e1c93
**Link to Log**: https://gist.github.com/b117254331cacfee323854febaf72740
### ERROR
<pre>
2017-06-22 09:47:28 ERROR    SEARCHQUEUE-MANUAL-325623 :: [Zooqle] :: [a47fc33] Failed parsing publishing date: yesterday
Traceback (most recent call last):
  File "C:\Medusa\medusa\providers\generic_provider.py", line 516, in parse_pubdate
    seconds = parse(match.group('time'))
AttributeError: 'NoneType' object has no attribute 'group'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.9.28-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@125263e6d8800e27061514e2e43289f3170b5db8
**Link to Log**: https://gist.github.com/fdfb38cfbdb45b872edcdbc4975c9c36
### ERROR
<pre>
2017-07-15 23:04:16 ERROR    SNATCHQUEUE-MANUALSNATCH-308576 :: [125263e] Unknown exception while downloading file /home/pi/torrents/Supercar.Megabuild.S02E08.Lamborghini.Transporter.1080P.HDTV.x264-skorpion.mp4.torrent from URL: https://asnet.pw/download/DA54AE193163BE699B248138B423E01F43E60896/. Error: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/125263e6d8800e27061514e2e43289f3170b5db8/medusa/helpers/__init__.py#L1315">medusa/helpers/__init__.py</a>", line 1315, in download_file
    return False
  File "/home/pi/Medusa/<a href="../blob/125263e6d8800e27061514e2e43289f3170b5db8/lib/contextlib2.py#L179">lib/contextlib2.py</a>", line 179, in __exit__
    self.thing.close()
AttributeError: 'NoneType' object has no attribute 'close'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
Aah this is a sneaky one. The 

```python
        with closing(session.get(url, allow_redirects=True, stream=True,
                                 verify=verify, headers=headers, cookies=cookies,
                                 hooks=hooks, proxies=proxies)) as resp:
```
expects a session to close. But the session is passed on from the providers session. Which is a save session. In case of an exception, it will return None in stead of the session object, and there is nothing left to close.
Any ideas on how to handle this? I'm not particular a fan of the context handler here. And passing the session is also not something I would have chosen for myself.
Don't return None on exception and catch the exception instead.
Can't do that, as it's getting the MedusaSafeSession passed from the providers. And that returns None, if it doesn't have a response object.
### INFO
**Python Version**: `2.7.13 (default, Jul 13 2017, 01:16:59) [GCC 4.2.1 Compatible FreeBSD Clang 3.8.0 (tags/RELEASE_380/final 262564)]`
**Operating System**: `FreeBSD-11.0-STABLE-amd64-64bit-ELF`
**Locale**: `None`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@6b7e935af14dc51e213d7c3449048bc40126292d
**Link to Log**: https://gist.github.com/75417185955b3fb48c1205934949c6bf
### ERROR
<pre>
2017-07-17 15:43:35 ERROR    SHOWQUEUE-REFRESH :: [6b7e935] 31917: Error while refreshing show Pretty Little Liars. Error: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/show_queue.py#L629">medusa/show_queue.py</a>", line 629, in run
    self.show.refresh_dir()
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L1725">medusa/tv/series.py</a>", line 1725, in refresh_dir
    self.load_episodes_from_dir()
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L919">medusa/tv/series.py</a>", line 919, in load_episodes_from_dir
    cur_episode = self.make_ep_from_file(os.path.join(self.location, media_file))
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L1345">medusa/tv/series.py</a>", line 1345, in make_ep_from_file
    filepath)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L1214">medusa/tv/series.py</a>", line 1214, in should_refresh_file
    new_quality = Quality.name_quality(filepath, anime)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/common.py#L302">medusa/common.py</a>", line 302, in name_quality
    return Quality._extend_quality(name)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/common.py#L401">medusa/common.py</a>", line 401, in _extend_quality
    quality = Quality.quality_from_file_meta(file_path)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/common.py#L422">medusa/common.py</a>", line 422, in quality_from_file_meta
    knowledge = knowit.know(file_path)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/api.py#L49">lib/knowit/api.py</a>", line 49, in know
    return provider.describe(video_path, context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/providers/mediainfo.py#L350">lib/knowit/providers/mediainfo.py</a>", line 350, in describe
    video_tracks, audio_tracks, subtitle_tracks, context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/provider.py#L35">lib/knowit/provider.py</a>", line 35, in _describe_tracks
    props = self._describe_track(general_track, 'general', context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/provider.py#L72">lib/knowit/provider.py</a>", line 72, in _describe_track
    value = prop.extract_value(track, context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/property.py#L33">lib/knowit/property.py</a>", line 33, in extract_value
    value = track.get(names[0], {}).get(names[1]) if len(names) == 2 else track.get(self.name)
AttributeError: 'NoneType' object has no attribute 'get'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.13 (default, Jul 13 2017, 01:16:59) [GCC 4.2.1 Compatible FreeBSD Clang 3.8.0 (tags/RELEASE_380/final 262564)]`
**Operating System**: `FreeBSD-11.0-STABLE-amd64-64bit-ELF`
**Locale**: `None`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@6b7e935af14dc51e213d7c3449048bc40126292d
**Link to Log**: https://gist.github.com/b0ec24a07cb258c80395bb01767cf6d2
### ERROR
<pre>
2017-07-17 15:41:48 ERROR    SHOWQUEUE-ADD :: [6b7e935] Error searching dir for episodes: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/show_queue.py#L562">medusa/show_queue.py</a>", line 562, in run
    self.show.load_episodes_from_dir()
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L919">medusa/tv/series.py</a>", line 919, in load_episodes_from_dir
    cur_episode = self.make_ep_from_file(os.path.join(self.location, media_file))
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L1345">medusa/tv/series.py</a>", line 1345, in make_ep_from_file
    filepath)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/tv/series.py#L1214">medusa/tv/series.py</a>", line 1214, in should_refresh_file
    new_quality = Quality.name_quality(filepath, anime)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/common.py#L302">medusa/common.py</a>", line 302, in name_quality
    return Quality._extend_quality(name)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/common.py#L401">medusa/common.py</a>", line 401, in _extend_quality
    quality = Quality.quality_from_file_meta(file_path)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/medusa/common.py#L422">medusa/common.py</a>", line 422, in quality_from_file_meta
    knowledge = knowit.know(file_path)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/api.py#L49">lib/knowit/api.py</a>", line 49, in know
    return provider.describe(video_path, context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/providers/mediainfo.py#L350">lib/knowit/providers/mediainfo.py</a>", line 350, in describe
    video_tracks, audio_tracks, subtitle_tracks, context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/provider.py#L35">lib/knowit/provider.py</a>", line 35, in _describe_tracks
    props = self._describe_track(general_track, 'general', context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/provider.py#L72">lib/knowit/provider.py</a>", line 72, in _describe_track
    value = prop.extract_value(track, context)
  File "/usr/local/share/www/Medusa/<a href="../blob/6b7e935af14dc51e213d7c3449048bc40126292d/lib/knowit/property.py#L33">lib/knowit/property.py</a>", line 33, in extract_value
    value = track.get(names[0], {}).get(names[1]) if len(names) == 2 else track.get(self.name)
AttributeError: 'NoneType' object has no attribute 'get'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
Ping @ratoaq2 ^ (different issue, related to knowit)
Better to report it separately so it won't be missed 
### INFO
**Python Version**: `2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)]`
**Operating System**: `Windows-10-10.0.15063`
**Locale**: `cp1252`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@647d47d571787862d056e80432757d1e026a0198
**Link to Log**: https://gist.github.com/6c11971edc24684ec3dfbefeb8b06246
### ERROR
<pre>
2017-08-06 17:27:43 ERROR    SHOWQUEUE-ADD :: [647d47d] Error loading IMDb info: 'NoneType' object has no attribute 'year'
Traceback (most recent call last):
  File "C:\Medusa\medusa\show_queue.py", line 533, in run
    self.show.load_imdb_info()
  File "C:\Medusa\medusa\tv\series.py", line 1552, in load_imdb_info
    if not imdb_obj.year:
AttributeError: 'NoneType' object has no attribute 'year'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
@medariox last report was fixed? If yes I will rename the issue title to avoid adding stuff here
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.9.35-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@75951e66ac8af38bad7f545095bf61c34c9e65d3
**Link to Log**: https://gist.github.com/3077a2a730cbe70900aaf110a047d601
### ERROR
<pre>
2017-10-24 13:00:41 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [Torrenting] :: [75951e6] DailySearchQueueItem Exception, error: 'NoneType' object has no attribute 'text'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/search/queue.py#L262">medusa/search/queue.py</a>", line 262, in run
    found_results = search_for_needed_episodes(force=self.force)
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/search/core.py#L444">medusa/search/core.py</a>", line 444, in search_for_needed_episodes
    cur_provider.cache.update_cache()
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/tv/cache.py#L196">medusa/tv/cache.py</a>", line 196, in update_cache
    data = self._get_rss_data()
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/tv/cache.py#L179">medusa/tv/cache.py</a>", line 179, in _get_rss_data
    return {'entries': self.provider.search(self.search_params)}
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/providers/torrent/html/torrenting.py#L63">medusa/providers/torrent/html/torrenting.py</a>", line 63, in search
    if not self.login():
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/providers/torrent/html/torrenting.py#L162">medusa/providers/torrent/html/torrenting.py</a>", line 162, in login
    return self.cookie_login('sign in')
  File "/home/pi/Medusa/<a href="../blob/75951e66ac8af38bad7f545095bf61c34c9e65d3/medusa/providers/generic_provider.py#L846">medusa/providers/generic_provider.py</a>", line 846, in cookie_login
    not (response.text and response.status_code == 200),
AttributeError: 'NoneType' object has no attribute 'text'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.9.35-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@2d62c0bd58de30c81c61599cbf2a74d72dc34e48
**Link to Log**: https://gist.github.com/ecfcb82396ab37d016b4ac4618a0769b
### ERROR
<pre>
2017-11-07 01:43:26 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [2d62c0b] DailySearchQueueItem Exception, error: 'NoneType' object has no attribute 'json'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/2d62c0bd58de30c81c61599cbf2a74d72dc34e48/medusa/search/queue.py#L288">medusa/search/queue.py</a>", line 288, in run
    self.success = snatch_episode(result)
  File "/home/pi/Medusa/<a href="../blob/2d62c0bd58de30c81c61599cbf2a74d72dc34e48/medusa/search/core.py#L134">medusa/search/core.py</a>", line 134, in snatch_episode
    result_downloaded = sab.send_nzb(result)
  File "/home/pi/Medusa/<a href="../blob/2d62c0bd58de30c81c61599cbf2a74d72dc34e48/medusa/clients/nzb/sab.py#L65">medusa/clients/nzb/sab.py</a>", line 65, in send_nzb
    data = response.json()
AttributeError: 'NoneType' object has no attribute 'json'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.13 (default, Dec 19 2016, 02:32:04) [GCC 4.7.3 20130102 (prerelease)]`
**Operating System**: `Linux-3.10.102-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/8ac0c519d593a27cd2ea2a6e717dea46
### ERROR
<pre>
2017-11-09 12:18:02 ERROR    Thread-18 :: [Torrent9] :: [b16e0e5] Exception generated: 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/server/web/core/base.py#L258">SickBeard/medusa/server/web/core/base.py</a>", line 258, in async_call
    result = function(**kwargs)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/server/web/home/handler.py#L1154">SickBeard/medusa/server/web/home/handler.py</a>", line 1154, in snatchSelection
    show_all_results=show_all_results, **search_show)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/search/manual.py#L282">SickBeard/medusa/search/manual.py</a>", line 282, in get_provider_cache_results
    i['proper_tags'] = i['proper_tags'].replace('|', ', ')
AttributeError: 'NoneType' object has no attribute 'replace'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.13 (default, Dec 19 2016, 02:32:04) [GCC 4.7.3 20130102 (prerelease)]`
**Operating System**: `Linux-3.10.102-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/dea2914b8e9adcd0feb6fc9788f08c56
### ERROR
<pre>
2017-11-09 12:17:56 ERROR    Thread-16 :: [Torrent9] :: [Torrent9] :: [b16e0e5] Exception generated: 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/server/web/core/base.py#L258">SickBeard/medusa/server/web/core/base.py</a>", line 258, in async_call
    result = function(**kwargs)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/server/web/home/handler.py#L1154">SickBeard/medusa/server/web/home/handler.py</a>", line 1154, in snatchSelection
    show_all_results=show_all_results, **search_show)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/search/manual.py#L282">SickBeard/medusa/search/manual.py</a>", line 282, in get_provider_cache_results
    i['proper_tags'] = i['proper_tags'].replace('|', ', ')
AttributeError: 'NoneType' object has no attribute 'replace'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
@medariox it shouldn't be None right? should be an empty string
### INFO
**Python Version**: `2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]`
**Operating System**: `Linux-4.13.0-16-generic-x86_64-with-Ubuntu-17.10-artful`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `43.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/697b8b9a21c23ab71bf456af90f56403
### ERROR
<pre>
2017-11-18 18:33:23 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [EliteTracker] :: [b16e0e5] Failed parsing provider. Traceback: 'Traceback (most recent call last):\n  File "/home/jo/medusa_fr/medusa/providers/torrent/html/elitetracker.py", line 138, in parse\n    title = torrent.find(class_=\'tooltip-content\').div.get_text(strip=True)\nAttributeError: \'NoneType\' object has no attribute \'div\'\n'
Traceback (most recent call last):
  File "/home/jo/medusa_fr/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/medusa/providers/torrent/html/elitetracker.py#L138">medusa/providers/torrent/html/elitetracker.py</a>", line 138, in parse
    title = torrent.find(class_='tooltip-content').div.get_text(strip=True)
AttributeError: 'NoneType' object has no attribute 'div'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
Aah elitetracker needs maintenance. 

### INFO
**Python Version**: `2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]`
**Operating System**: `Linux-3.14.32-xxxx-grs-ipv6-64-x86_64-with-Debian-8`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@7b9111eef5836a6846499ef257ffff3f1f35df8f
**Link to Log**: https://gist.github.com/bc48d07e9db60e54466b5419558cb669
### ERROR
<pre>
2018-01-05 14:21:14 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [EliteTracker] :: [7b9111e] Failed parsing provider. Traceback: 'Traceback (most recent call last):\n  File "/home/**********/medusa/medusa/providers/torrent/html/elitetracker.py", line 139, in parse\n    title = torrent.find(class_=\'tooltip-content\').div.get_text(strip=True)\nAttributeError: \'NoneType\' object has no attribute \'div\'\n'
Traceback (most recent call last):
  File "/home/**********/medusa/medusa/providers/torrent/html/elitetracker.py", line 139, in parse
    title = torrent.find(class_='tooltip-content').div.get_text(strip=True)
AttributeError: 'NoneType' object has no attribute 'div'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


### INFO
**Python Version**: `2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]`
**Operating System**: `Windows-10-10.0.14393`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@ccbc0ce9a2d3977a71bde03e29be503464ebe3cd
**Link to Log**: https://gist.github.com/20a8533b47c9d69006055eabf53a6f2c
### ERROR
<pre>
2018-02-17 18:26:29 ERROR    SHOWQUEUE-ADD :: [ccbc0ce] 76171 Error while loading information from indexer TVDBv2. Error: "'NoneType' object has no attribute 'indexer'"
Traceback (most recent call last):
  File "C:\GitHub\Medusa\medusa\show_queue.py", line 423, in run
    check_existing_shows(s, self.indexer)
  File "C:\GitHub\Medusa\medusa\helpers\externals.py", line 133, in check_existing_shows
    new_show_externals = get_externals(indexer=indexer, indexed_show=indexed_show)
  File "C:\GitHub\Medusa\medusa\helpers\externals.py", line 112, in get_externals
    {'name': indexerApi(show.indexer).name, 'reason': error.message})
AttributeError: 'NoneType' object has no attribute 'indexer'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


### INFO
**Python Version**: `2.7.14 (default, Nov 22 2017, 10:33:34) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]`
**Operating System**: `Darwin-14.5.0-x86_64-i386-64bit`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe
**Link to Log**: https://gist.github.com/1ca681b1575b741bc82f9220a13cd725
### ERROR
<pre>
2018-03-05 01:24:57 ERROR    SEARCHQUEUE-BACKLOG-244701 :: [ArcheTorrent] :: [d6eb72d] Failed parsing provider.
Traceback (most recent call last):
  File "/Users/Admin/Medusa/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/medusa/providers/torrent/html/archetorrent.py#L160">medusa/providers/torrent/html/archetorrent.py</a>", line 160, in parse
    pubdate = self.parse_pubdate(pubdate_raw.group(1), dayfirst=True)
AttributeError: 'NoneType' object has no attribute 'group'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


### INFO
**Python Version**: `2.7.13 (default, Dec 19 2016, 02:32:04) [GCC 4.7.3 20130102 (prerelease)]`
**Operating System**: `Linux-3.10.35-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe
**Link to Log**: https://gist.github.com/67eec306c70c08d37b49e2ddf90f0498
### ERROR
<pre>
2018-03-12 08:54:43 ERROR    Thread-16 :: [d6eb72d] Exception generated: 'NoneType' object has no attribute 'library'
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/SickBeard/medusa/server/web/core/base.py#L283">SickBeard/medusa/server/web/core/base.py</a>", line 283, in async_call
    result = function(**kwargs)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/SickBeard/medusa/server/web/home/handler.py#L2287">SickBeard/medusa/server/web/home/handler.py</a>", line 2287, in manual_search_subtitles
    found_subtitles = subtitles.list_subtitles(tv_episode=ep_obj, video_path=video_path)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/SickBeard/medusa/subtitles.py#L331">SickBeard/medusa/subtitles.py</a>", line 331, in list_subtitles
    cache.set(subtitle_key.format(id=subtitle.id).encode('utf-8'), subtitle)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/SickBeard/ext/dogpile/cache/region.py#L984">SickBeard/ext/dogpile/cache/region.py</a>", line 984, in set
    self.backend.set(key, self._value(value))
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/SickBeard/ext/dogpile/cache/backends/file.py#L237">SickBeard/ext/dogpile/cache/backends/file.py</a>", line 237, in set
    with self._dbm_file(True) as dbm:
  File "/usr/local/python/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/SickBeard/ext/dogpile/cache/backends/file.py#L215">SickBeard/ext/dogpile/cache/backends/file.py</a>", line 215, in _dbm_file
    "w" if write else "r")
  File "/usr/local/python/lib/python2.7/anydbm.py", line 71, in open
    result=whichdb(file)
  File "/usr/local/python/lib/python2.7/whichdb.py", line 35, in whichdb
    if not (dbm.library == "GNU gdbm" and sys.platform == "os2emx"):
AttributeError: 'NoneType' object has no attribute 'library'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


### INFO
**Python Version**: `2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2]`
**Operating System**: `Linux-4.9.35-v7+-armv7l-with-debian-8.0`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@0da7d0a5b457a7acf6686949361aa1a1c2fcf93d
**Link to Log**: https://gist.github.com/7fcfeb76a4aff736ef210c188e3a23b4
### ERROR
<pre>
2018-04-04 22:36:40 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [NUTECH] :: [0da7d0a] DailySearchQueueItem Exception, error: 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/search/queue.py#L263">medusa/search/queue.py</a>", line 263, in run
    found_results = search_for_needed_episodes(force=self.force)
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/search/core.py#L460">medusa/search/core.py</a>", line 460, in search_for_needed_episodes
    cur_provider.cache.update_cache()
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/tv/cache.py#L202">medusa/tv/cache.py</a>", line 202, in update_cache
    data = self._get_rss_data()
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/tv/cache.py#L185">medusa/tv/cache.py</a>", line 185, in _get_rss_data
    return {'entries': self.provider.search(self.search_params)}
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/providers/nzb/newznab.py#L111">medusa/providers/nzb/newznab.py</a>", line 111, in search
    self.get_capabilities(just_params=True)
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/providers/nzb/newznab.py#L509">medusa/providers/nzb/newznab.py</a>", line 509, in get_capabilities
    self.set_caps(html.find('searching'))
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/providers/nzb/newznab.py#L470">medusa/providers/nzb/newznab.py</a>", line 470, in set_caps
    self.cap_tv_search = _parse_cap('tv-search')
  File "/home/pi/Medusa/<a href="../blob/0da7d0a5b457a7acf6686949361aa1a1c2fcf93d/medusa/providers/nzb/newznab.py#L468">medusa/providers/nzb/newznab.py</a>", line 468, in _parse_cap
    return elm.get('supportedparams').split(',') if elm and elm.get('available') == 'yes' else []
AttributeError: 'NoneType' object has no attribute 'split'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


### INFO
**Python Version**: `2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]`
**Operating System**: `Windows-10-10.0.16299`
**Locale**: `cp1252`
**Branch**: [develop](../tree/develop)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@0da7d0a5b457a7acf6686949361aa1a1c2fcf93d
**Link to Log**: https://gist.github.com/4a27d96992cd8308df228d87d166b59d
### ERROR
<pre>
2018-04-04 19:08:38 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [nzbplanet] :: [0da7d0a] DailySearchQueueItem Exception, error: 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\search\queue.py", line 263, in run
    found_results = search_for_needed_episodes(force=self.force)
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\search\core.py", line 460, in search_for_needed_episodes
    cur_provider.cache.update_cache()
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\tv\cache.py", line 202, in update_cache
    data = self._get_rss_data()
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\tv\cache.py", line 185, in _get_rss_data
    return {'entries': self.provider.search(self.search_params)}
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\providers\nzb\newznab.py", line 111, in search
    self.get_capabilities(just_params=True)
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\providers\nzb\newznab.py", line 509, in get_capabilities
    self.set_caps(html.find('searching'))
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\providers\nzb\newznab.py", line 470, in set_caps
    self.cap_tv_search = _parse_cap('tv-search')
  File "C:\Users\Mat\Documents\Medusa-0.2.1\medusa\providers\nzb\newznab.py", line 468, in _parse_cap
    return elm.get('supportedparams').split(',') if elm and elm.get('available') == 'yes' else []
AttributeError: 'NoneType' object has no attribute 'split'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


Resolving patch:
diff --git a/medusa/providers/nzb/newznab.py b/medusa/providers/nzb/newznab.py
--- a/medusa/providers/nzb/newznab.py
+++ b/medusa/providers/nzb/newznab.py
@@ -76,7 +76,7 @@ def __init__(self, name, url='', api_key='0', cat_ids=None, default=False, searc
         self.torznab = False
 
         self.params = False
-        self.cap_tv_search = None
+        self.cap_tv_search = []
         self.providers_without_caps = ['gingadaddy', '6box']
 
         # For now apply the additional season search string for all newznab providers.
@@ -465,15 +465,13 @@ def set_caps(self, data):
 
         def _parse_cap(tag):
             elm = data.find(tag)
-            return elm.get('supportedparams').split(',') if elm and elm.get('available') == 'yes' else []
+            is_supported = elm and all([elm.get('supportedparams'), elm.get('available') == 'yes'])
+            return elm['supportedparams'].split(',') if is_supported else []
 
         self.cap_tv_search = _parse_cap('tv-search')
         # self.cap_search = _parse_cap('search')
-        # self.cap_movie_search = _parse_cap('movie-search')
-        # self.cap_audio_search = _parse_cap('audio-search')
 
-        # self.params = any([self.cap_tv_search, self.cap_search, self.cap_movie_search, self.cap_audio_search])
-        self.params = any([self.cap_tv_search])
+        self.params = any(self.cap_tv_search)
 
     def get_capabilities(self, just_params=False):
         """
diff --git a/medusa/providers/torrent/torznab/torznab.py b/medusa/providers/torrent/torznab/torznab.py
--- a/medusa/providers/torrent/torznab/torznab.py
+++ b/medusa/providers/torrent/torznab/torznab.py
@@ -281,7 +281,8 @@ def set_caps(self, data):
 
         def _parse_cap(tag):
             elm = data.find(tag)
-            return elm.get('supportedparams').split(',') if elm and elm.get('available') == 'yes' else []
+            is_supported = elm and all([elm.get('supportedparams'), elm.get('available') == 'yes'])
+            return elm['supportedparams'].split(',') if is_supported else []
 
         self.cap_tv_search = _parse_cap('tv-search')
 


Test patch: