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

Resolving patch:
diff --git a/medusa/providers/torrent/html/zooqle.py b/medusa/providers/torrent/html/zooqle.py
--- a/medusa/providers/torrent/html/zooqle.py
+++ b/medusa/providers/torrent/html/zooqle.py
@@ -142,7 +142,7 @@ def parse(self, data, mode):
                     torrent_size = cells[3].get_text().replace(',', '')
                     size = convert_size(torrent_size) or -1
 
-                    pubdate_raw = cells[4].get_text()
+                    pubdate_raw = cells[4].get_text().replace('yesterday', '24 hours')
                     # "long ago" can't be translated to a date
                     if pubdate_raw == 'long ago':
                         pubdate_raw = None


Test patch: