Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: TypeError: 'NoneType' object has no attribute '__getitem__'
### INFO
**Python Version**: `2.7.12 (default, Sep 29 2017, 12:24:30) [GCC 4.9.3 20150311 (prerelease)]`
**Operating System**: `Linux-3.10.105-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [fix-rtorrent-0.9.6](../tree/fix-rtorrent-0.9.6)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@7978df5eb142a954ee658e9919006777843b1f53
**Link to Log**: https://gist.github.com/8926b799dd9b0265cdb050745bb30129
### ERROR
<pre>
2017-11-18 14:58:18 ERROR    SEARCHQUEUE-MANUAL-295685 :: [Yggtorrent] :: [7978df5] Failed parsing provider.
Traceback (most recent call last):
  File "/volume2/Medusa/<a href="../blob/7978df5eb142a954ee658e9919006777843b1f53/medusa/providers/torrent/html/yggtorrent.py#L127">medusa/providers/torrent/html/yggtorrent.py</a>", line 127, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


Discussion:
That issue was already fixed [here](https://github.com/pymedusa/Medusa/pull/3281) and will be available in the next release.
### 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/2e2775bf4fcbe6876c2cc94bbfcb50bb
### ERROR
<pre>
2017-11-20 10:27:21 ERROR    SEARCHQUEUE-BACKLOG-153021 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/providers/torrent/html/yggtorrent.py#L125">SickBeard/medusa/providers/torrent/html/yggtorrent.py</a>", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.13 (default, Dec 19 2016, 01:28:10) [GCC 4.6.3]`
**Operating System**: `Linux-3.2.40-i686-with-glibc2.0`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/989ee27f82def65803b237af6896d5ea
### ERROR
<pre>
2017-11-20 18:36:59 ERROR    SEARCHQUEUE-MANUAL-328686 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/providers/torrent/html/yggtorrent.py#L125">SickBeard/medusa/providers/torrent/html/yggtorrent.py</a>", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]`
**Operating System**: `Linux-3.16.0-4-amd64-x86_64-with-debian-8.9`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/220519d48b1388b3b2c815fb167b6885
### ERROR
<pre>
2017-11-22 08:36:52 ERROR    SEARCHQUEUE-FORCED-289909 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "/srv/medusa/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/medusa/providers/torrent/html/yggtorrent.py#L125">medusa/providers/torrent/html/yggtorrent.py</a>", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</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.15063`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/abb9de20deee0caa8a1fb647fedce79a
### ERROR
<pre>
2017-11-24 09:27:23 ERROR    SEARCHQUEUE-FORCED-332159 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\providers\torrent\html\yggtorrent.py", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</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.15063`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/e2fdc75990df983b3bdc249c8d7fcc96
### ERROR
<pre>
2017-11-24 09:37:10 ERROR    SEARCHQUEUE-FORCED-332159 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\providers\torrent\html\yggtorrent.py", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</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.15063`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/8b24008ed4022c7d0bb89ee95379ed0b
### ERROR
<pre>
2017-11-24 09:48:59 ERROR    SEARCHQUEUE-FORCED-332159 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\providers\torrent\html\yggtorrent.py", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.13 (default, Dec 19 2016, 01:28:10) [GCC 4.6.3]`
**Operating System**: `Linux-3.2.40-i686-with-glibc2.0`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/15abe52d1c27fd0b01a18ec95a90973e
### ERROR
<pre>
2017-11-24 09:20:14 ERROR    SEARCHQUEUE-BACKLOG-63913 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/providers/torrent/html/yggtorrent.py#L125">SickBeard/medusa/providers/torrent/html/yggtorrent.py</a>", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</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.15063`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/f421dfe272636e3e2daf034db623e832
### ERROR
<pre>
2017-11-24 10:19:11 ERROR    SEARCHQUEUE-FORCED-332159 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\providers\torrent\html\yggtorrent.py", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
### INFO
**Python Version**: `2.7.13 (default, Dec 19 2016, 01:28:10) [GCC 4.6.3]`
**Operating System**: `Linux-3.2.40-i686-with-glibc2.0`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/ad95b069df541ea0a00a0fcb666ba3ad
### ERROR
<pre>
2017-11-24 21:16:08 ERROR    SEARCHQUEUE-BACKLOG-63913 :: [Yggtorrent] :: [b16e0e5] Failed parsing provider.
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/SickBeard/medusa/providers/torrent/html/yggtorrent.py#L125">SickBeard/medusa/providers/torrent/html/yggtorrent.py</a>", line 125, in parse
    download_url = urljoin(self.url, cells[0].find('a', target='_blank')['href'])
TypeError: 'NoneType' object has no attribute '__getitem__'
</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@b1f53562945fde160a987187836387d93510c2f9
**Link to Log**: https://gist.github.com/0ac9685de6253302280d39b5d994b92e
### ERROR
<pre>
2018-04-17 02:22:24 ERROR    SHOWQUEUE-REFRESH :: [b1f5356] 71446: Error while refreshing show Money Heist. Error: 'bool' object has no attribute '__getitem__'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/show_queue.py#L637">medusa/show_queue.py</a>", line 637, in run
    self.show.refresh_dir()
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/tv/series.py#L1754">medusa/tv/series.py</a>", line 1754, in refresh_dir
    self.load_episodes_from_dir()
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/tv/series.py#L932">medusa/tv/series.py</a>", line 932, in load_episodes_from_dir
    cur_episode = self.make_ep_from_file(os.path.join(self.location, media_file))
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/tv/series.py#L1398">medusa/tv/series.py</a>", line 1398, in make_ep_from_file
    **********_ep.create_meta_files()
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/tv/episode.py#L1111">medusa/tv/episode.py</a>", line 1111, in create_meta_files
    self.__create_thumbnail(metadata_provider)
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/tv/episode.py#L1134">medusa/tv/episode.py</a>", line 1134, in __create_thumbnail
    result = metadata_provider.create_episode_thumb(self) or result
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/metadata/generic.py#L331">medusa/metadata/generic.py</a>", line 331, in create_episode_thumb
    return self.save_thumbnail(ep_obj)
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/metadata/generic.py#L497">medusa/metadata/generic.py</a>", line 497, in save_thumbnail
    thumb_data = self._retrieve_show_image(u'thumbnail', ep_obj.series, ep_obj)
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/metadata/generic.py#L744">medusa/metadata/generic.py</a>", line 744, in _retrieve_show_image
    image_url = self._get_episode_thumb_url(indexer_show_obj, episode)
  File "/home/pi/Medusa/<a href="../blob/b1f53562945fde160a987187836387d93510c2f9/medusa/metadata/generic.py#L390">medusa/metadata/generic.py</a>", line 390, in _get_episode_thumb_url
    indexer_episode = indexer_series[ep.season][ep.episode]
TypeError: 'bool' object has no attribute '__getitem__'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators

@p0psicles 

Resolving patch:
diff --git a/medusa/metadata/generic.py b/medusa/metadata/generic.py
--- a/medusa/metadata/generic.py
+++ b/medusa/metadata/generic.py
@@ -736,6 +736,8 @@ def _retrieve_show_image(self, image_type, show_obj, episode=None, which=None):
         image_url = None
 
         indexer_show_obj = self._get_show_data(show_obj)
+        if not indexer_show_obj:
+            return None
 
         if image_type not in (u'fanart', u'poster', u'banner', u'thumbnail', u'poster_thumb', u'banner_thumb'):
             log.error(


Test patch: