Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: AttributeError: 'NavigableString' object has no attribute 'span'
### 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@38e6cbf13d9cede5de23106b656dbbb90df2dd38
**Link to Log**: https://gist.github.com/39feec6e67c967a5e2fdec7f7bc2b69f
### ERROR
<pre>
2017-08-13 22:44:17 ERROR    SEARCHQUEUE-FORCED-175001 :: [LimeTorrents] :: [38e6cbf] Unknown exception while searching LimeTorrents. Error: "'NavigableString' object has no attribute 'span'"
Traceback (most recent call last):
  File "C:\Medusa\medusa\search\core.py", line 555, in search_providers
    down_cur_quality, manual_search, manual_search_type)
  File "C:\Medusa\medusa\providers\generic_provider.py", line 226, in find_search_results
    items_list += self.search(search_string, ep_obj=episode)
  File "C:\Medusa\medusa\providers\torrent\html\limetorrents.py", line 97, in search
    results += self.parse(response.text, mode)
  File "C:\Medusa\medusa\providers\torrent\html\limetorrents.py", line 124, in parse
    labels = [process_column_header(label) for label in torrent_rows[0]]
  File "C:\Medusa\medusa\providers\torrent\html\limetorrents.py", line 113, in process_column_header
    return th.span.get_text() if th.span else th.get_text()
  File "C:\Medusa\lib\bs4\element.py", line 713, in __getattr__
    self.__class__.__name__, attr))
AttributeError: 'NavigableString' object has no attribute 'span'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


Discussion:
### INFO
**Python Version**: `2.7.13 (default, Dec 18 2016, 22:44:40) [GCC 4.9.3 20150311 (prerelease)]`
**Operating System**: `Linux-3.10.77-armv7l-with-glibc2.4`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@49e9fc38856200768d41a74139807886acefa054
**Link to Log**: https://gist.github.com/de35356625a68f75bd0488d6e6cb74d0
### ERROR
<pre>
2017-08-14 13:00:31 ERROR    SEARCHQUEUE-BACKLOG-281470 :: [LimeTorrents] :: [49e9fc3] Unknown exception while searching LimeTorrents. Error: "'NavigableString' object has no attribute 'span'"
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/49e9fc38856200768d41a74139807886acefa054/SickBeard/medusa/search/core.py#L555">SickBeard/medusa/search/core.py</a>", line 555, in search_providers
    down_cur_quality, manual_search, manual_search_type)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/49e9fc38856200768d41a74139807886acefa054/SickBeard/medusa/providers/generic_provider.py#L215">SickBeard/medusa/providers/generic_provider.py</a>", line 215, in find_search_results
    items_list += self.search(search_string, ep_obj=episode)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/49e9fc38856200768d41a74139807886acefa054/SickBeard/medusa/providers/torrent/html/limetorrents.py#L97">SickBeard/medusa/providers/torrent/html/limetorrents.py</a>", line 97, in search
    results += self.parse(response.text, mode)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/49e9fc38856200768d41a74139807886acefa054/SickBeard/medusa/providers/torrent/html/limetorrents.py#L124">SickBeard/medusa/providers/torrent/html/limetorrents.py</a>", line 124, in parse
    labels = [process_column_header(label) for label in torrent_rows[0]]
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/49e9fc38856200768d41a74139807886acefa054/SickBeard/medusa/providers/torrent/html/limetorrents.py#L113">SickBeard/medusa/providers/torrent/html/limetorrents.py</a>", line 113, in process_column_header
    return th.span.get_text() if th.span else th.get_text()
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/49e9fc38856200768d41a74139807886acefa054/SickBeard/lib/bs4/element.py#L713">SickBeard/lib/bs4/element.py</a>", line 713, in __getattr__
    self.__class__.__name__, attr))
AttributeError: 'NavigableString' object has no attribute 'span'
</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**: [develop](../tree/develop)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@2a6b60f936f5c314d85b2cd6d99252fe5c9d6c85
**Link to Log**: https://gist.github.com/eedd5462741943a37d8aea9b114cdb9e
### ERROR
<pre>
2017-08-15 08:45:48 ERROR    SEARCHQUEUE-FORCED-295837 :: [LimeTorrents] :: [2a6b60f] Unknown exception while searching LimeTorrents. Error: "'NavigableString' object has no attribute 'span'"
Traceback (most recent call last):
  File "C:\Medusa\medusa\search\core.py", line 555, in search_providers
    down_cur_quality, manual_search, manual_search_type)
  File "C:\Medusa\medusa\providers\generic_provider.py", line 226, in find_search_results
    items_list += self.search(search_string, ep_obj=episode)
  File "C:\Medusa\medusa\providers\torrent\html\limetorrents.py", line 97, in search
    results += self.parse(response.text, mode)
  File "C:\Medusa\medusa\providers\torrent\html\limetorrents.py", line 124, in parse
    labels = [process_column_header(label) for label in torrent_rows[0]]
  File "C:\Medusa\medusa\providers\torrent\html\limetorrents.py", line 113, in process_column_header
    return th.span.get_text() if th.span else th.get_text()
  File "C:\Medusa\lib\bs4\element.py", line 713, in __getattr__
    self.__class__.__name__, attr))
AttributeError: 'NavigableString' object has no attribute 'span'
</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**: [feature/add-cookies-bithdtv](../tree/feature/add-cookies-bithdtv)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@439625730de384948079e87aa606772ae06ac15f
**Link to Log**: https://gist.github.com/5a3f5621bd45ef3c885ebe4915b304ad
### ERROR
<pre>
2017-08-15 16:03:08 ERROR    SEARCHQUEUE-MANUAL-247808 :: [LimeTorrents] :: [4396257] Unknown exception while searching LimeTorrents. Error: "'NavigableString' object has no attribute 'span'"
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/439625730de384948079e87aa606772ae06ac15f/medusa/search/core.py#L555">medusa/search/core.py</a>", line 555, in search_providers
    down_cur_quality, manual_search, manual_search_type)
  File "/home/pi/Medusa/<a href="../blob/439625730de384948079e87aa606772ae06ac15f/medusa/providers/generic_provider.py#L226">medusa/providers/generic_provider.py</a>", line 226, in find_search_results
    items_list += self.search(search_string, ep_obj=episode)
  File "/home/pi/Medusa/<a href="../blob/439625730de384948079e87aa606772ae06ac15f/medusa/providers/torrent/html/limetorrents.py#L97">medusa/providers/torrent/html/limetorrents.py</a>", line 97, in search
    results += self.parse(response.text, mode)
  File "/home/pi/Medusa/<a href="../blob/439625730de384948079e87aa606772ae06ac15f/medusa/providers/torrent/html/limetorrents.py#L124">medusa/providers/torrent/html/limetorrents.py</a>", line 124, in parse
    labels = [process_column_header(label) for label in torrent_rows[0]]
  File "/home/pi/Medusa/<a href="../blob/439625730de384948079e87aa606772ae06ac15f/medusa/providers/torrent/html/limetorrents.py#L113">medusa/providers/torrent/html/limetorrents.py</a>", line 113, in process_column_header
    return th.span.get_text() if th.span else th.get_text()
  File "/home/pi/Medusa/<a href="../blob/439625730de384948079e87aa606772ae06ac15f/lib/bs4/element.py#L713">lib/bs4/element.py</a>", line 713, in __getattr__
    self.__class__.__name__, attr))
AttributeError: 'NavigableString' object has no attribute 'span'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators
@duramato what do we do with limetorrents? Does this provider needs maintenance? Or it's just down?
Maintenance

Resolving patch:
diff --git a/medusa/providers/torrent/html/limetorrents.py b/medusa/providers/torrent/html/limetorrents.py
--- a/medusa/providers/torrent/html/limetorrents.py
+++ b/medusa/providers/torrent/html/limetorrents.py
@@ -121,7 +121,7 @@ def process_column_header(th):
                 return items
 
             torrent_rows = torrent_table.find_all('tr')
-            labels = [process_column_header(label) for label in torrent_rows[0]]
+            labels = [process_column_header(label) for label in torrent_rows[0].find_all('th')]
 
             # Skip the first row, since it isn't a valid result
             for row in torrent_rows[1:]:


Test patch: