Repository: Flexget/Flexget

Issue:
Discover from iptorrents: 'NoneType' object has no attribute 'findAll'
The `iptorrents` plugin is unable to find and produce entries from searches.
### Expected behaviour:

Expected search plugin `iptorrents` to produce entries when used with `discover`.
### Actual behaviour:

Critical error was returned, see below:

```
2016-08-25 02:59 VERBOSE  discover      search_movies   Searching for `The Dark Knight Rises (2012)` with plugin `iptorrents` (1 of 1)
2016-08-25 02:59 CRITICAL task          search_movies   BUG: Unhandled error in plugin discover: 'NoneType' object has no attribute 'findAll'
Traceback (most recent call last):
  File "/usr/local/python/lib/python2.7/site-packages/flexget/task.py", line 472, in __run_plugin
    return method(*args, **kwargs)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/event.py", line 23, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugins/input/discover.py", line 290, in on_task_input
    return self.execute_searches(config, entries, task)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugins/input/discover.py", line 155, in execute_searches
    search_results = search.search(task=task, entry=entry, config=plugin_config)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugin.py", line 118, in wrapped_func
    return func(*args, **kwargs)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugins/sites/iptorrents.py", line 146, in search
    for torrent in torrents.findAll('a', href=re.compile('\.torrent$')):
AttributeError: 'NoneType' object has no attribute 'findAll'
```
#### Config:

```
...
  search_movies:
    discover:
      what:
        - movie_list: movies
      from:
        - iptorrents:
            rss_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            uid: xxxxxxx
            password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            category:
              - Movie-HD-Bluray
...    
```
### Additional information:
- Flexget Version: 2.3.5
- Python Version: 2.7.12

Discover from iptorrents: 'NoneType' object has no attribute 'findAll'
The `iptorrents` plugin is unable to find and produce entries from searches.
### Expected behaviour:

Expected search plugin `iptorrents` to produce entries when used with `discover`.
### Actual behaviour:

Critical error was returned, see below:

```
2016-08-25 02:59 VERBOSE  discover      search_movies   Searching for `The Dark Knight Rises (2012)` with plugin `iptorrents` (1 of 1)
2016-08-25 02:59 CRITICAL task          search_movies   BUG: Unhandled error in plugin discover: 'NoneType' object has no attribute 'findAll'
Traceback (most recent call last):
  File "/usr/local/python/lib/python2.7/site-packages/flexget/task.py", line 472, in __run_plugin
    return method(*args, **kwargs)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/event.py", line 23, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugins/input/discover.py", line 290, in on_task_input
    return self.execute_searches(config, entries, task)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugins/input/discover.py", line 155, in execute_searches
    search_results = search.search(task=task, entry=entry, config=plugin_config)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugin.py", line 118, in wrapped_func
    return func(*args, **kwargs)
  File "/usr/local/python/lib/python2.7/site-packages/flexget/plugins/sites/iptorrents.py", line 146, in search
    for torrent in torrents.findAll('a', href=re.compile('\.torrent$')):
AttributeError: 'NoneType' object has no attribute 'findAll'
```
#### Config:

```
...
  search_movies:
    discover:
      what:
        - movie_list: movies
      from:
        - iptorrents:
            rss_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            uid: xxxxxxx
            password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            category:
              - Movie-HD-Bluray
...    
```
### Additional information:
- Flexget Version: 2.3.5
- Python Version: 2.7.12



Discussion:

Resolving patch:
diff --git a/flexget/plugins/sites/iptorrents.py b/flexget/plugins/sites/iptorrents.py
--- a/flexget/plugins/sites/iptorrents.py
+++ b/flexget/plugins/sites/iptorrents.py
@@ -141,7 +141,7 @@ def search(self, task, entry, config=None):
                 raise plugin.PluginError("Invalid cookies (user not logged in)...")
 
             soup = get_soup(req.content, parser="html.parser")
-            torrents = soup.find('table', {'class': 'torrents'})
+            torrents = soup.find('table', {'id': 'torrents'})
 
             for torrent in torrents.findAll('a', href=re.compile('\.torrent$')):
                 entry = Entry()


Test patch: