We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Problem Searching for Norwegian Shows
### Before submitting your issue:

Enable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)

**Branch/Commit:master/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe
**OS:CentOS 7
**What you did: Searching for a Show (manual and auto) on Provider Norbits (Norwegian Tracker) for a Norwegian show
**What happened: No results
**What you expected: There are available files so expected results
**Logs:**
```
2018-03-10 09:35:54 INFO     SEARCHQUEUE-MANUAL-342737 :: [d6eb72d] Unable to find manual results for: Stories From Norway - S01E01 - 001 - Stupetårnet i Hamar
2018-03-10 09:35:53 INFO     SEARCHQUEUE-MANUAL-342737 :: [Norbits] :: [d6eb72d] Performing season pack search for Stories From Norway
2018-03-10 09:35:53 INFO     SEARCHQUEUE-MANUAL-342737 :: [Norbits] :: [d6eb72d] Performing episode search for Stories From Norway

```

I was wondering if there is some settings that ignores Norwegian?
I can't find any exceptions.
I know this worked in Sickrage with no problems. (coming from Sickrage)

This goes for all Norwegian shows I have

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `medusa/providers/torrent/json/norbits.py`
Content:
```
1 # coding=utf-8
2 
3 """Provider code for Norbits."""
4 
5 from __future__ import unicode_literals
6 
7 import logging
8 import traceback
9 
10 from medusa import tv
11 from medusa.helper.common import (
12     convert_size,
13     try_int,
14 )
15 from medusa.helper.exceptions import AuthException
16 from medusa.logger.adapters.style import BraceAdapter
17 from medusa.providers.torrent.torrent_provider import TorrentProvider
18 
19 from requests.compat import urlencode, urljoin
20 
21 log = BraceAdapter(logging.getLogger(__name__))
22 log.logger.addHandler(logging.NullHandler())
23 
24 
25 class NorbitsProvider(TorrentProvider):
26     """Norbits Torrent provider."""
27 
28     def __init__(self):
29         """.Initialize the class."""
30         super(NorbitsProvider, self).__init__('Norbits')
31 
32         # Credentials
33         self.username = None
34         self.passkey = None
35 
36         # URLs
37         self.url = 'https://norbits.net'
38         self.urls = {
39             'search': urljoin(self.url, 'api2.php?action=torrents'),
40             'download': urljoin(self.url, 'download.php?'),
41         }
42 
43         # Proper Strings
44 
45         # Miscellaneous Options
46 
47         # Torrent Stats
48         self.minseed = None
49         self.minleech = None
50 
51         # Cache
52         self.cache = tv.Cache(self, min_time=20)  # only poll Norbits every 15 minutes max
53 
54     def search(self, search_strings, age=0, ep_obj=None, **kwargs):
55         """
56         Search a provider and parse the results.
57 
58         :param search_strings: A dict with mode (key) and the search value (value)
59         :param age: Not used
60         :param ep_obj: Not used
61         :returns: A list of search results (structure)
62         """
63         results = []
64 
65         for mode in search_strings:
66             log.debug('Search mode: {0}', mode)
67 
68             for search_string in search_strings[mode]:
69 
70                 if mode != 'RSS':
71                     log.debug('Search string: {search}',
72                               {'search': search_string})
73 
74                 post_data = {
75                     'username': self.username,
76                     'passkey': self.passkey,
77                     'category': '2',  # TV Category
78                     'search': search_string,
79                 }
80 
81                 response = self.session.post(self.urls['search'], data=post_data)
82                 if not response or not response.content:
83                     log.debug('No data returned from provider')
84                     continue
85 
86                 try:
87                     jdata = response.json()
88                 except ValueError:
89                     log.debug('No data returned from provider')
90                     continue
91 
92                 if self._check_auth_from_data(jdata):
93                     return results
94 
95             results += self.parse(jdata, mode)
96 
97         return results
98 
99     def parse(self, data, mode):
100         """
101         Parse search results for items.
102 
103         :param data: The raw response from a search
104         :param mode: The current mode used to search, e.g. RSS
105 
106         :return: A list of items found
107         """
108         items = []
109         data.get('data', '')
110         torrent_rows = data.get('torrents', [])
111 
112         # Skip column headers
113         for row in torrent_rows:
114             try:
115                 title = row.pop('name', '')
116                 download_url = '{0}{1}'.format(
117                     self.urls['download'],
118                     urlencode({'id': row.pop('id', ''), 'passkey': self.passkey}))
119 
120                 if not all([title, download_url]):
121                     continue
122 
123                 seeders = try_int(row.pop('seeders', 0))
124                 leechers = try_int(row.pop('leechers', 0))
125 
126                 # Filter unseeded torrent
127                 if seeders < min(self.minseed, 1):
128                     if mode != 'RSS':
129                         log.debug("Discarding torrent because it doesn't meet the"
130                                   " minimum seeders: {0}. Seeders: {1}",
131                                   title, seeders)
132                     continue
133 
134                 size = convert_size(row.pop('size', -1), -1)
135 
136                 item = {
137                     'title': title,
138                     'link': download_url,
139                     'size': size,
140                     'seeders': seeders,
141                     'leechers': leechers,
142                     'pubdate': None,
143                 }
144                 if mode != 'RSS':
145                     log.debug('Found result: {0} with {1} seeders and {2} leechers',
146                               title, seeders, leechers)
147 
148                 items.append(item)
149             except (AttributeError, TypeError, KeyError, ValueError, IndexError):
150                 log.error('Failed parsing provider. Traceback: {0!r}',
151                           traceback.format_exc())
152 
153         return items
154 
155     def _check_auth(self):
156 
157         if not self.username or not self.passkey:
158             raise AuthException(('Your authentication credentials for %s are '
159                                  'missing, check your config.') % self.name)
160 
161         return True
162 
163     def _check_auth_from_data(self, parsed_json):
164         """Check that we are authenticated."""
165         if 'status' in parsed_json and 'message' in parsed_json:
166             if parsed_json.get('status') == 3:
167                 log.warning('Invalid username or password.'
168                             ' Check your settings')
169 
170         return True
171 
172 
173 provider = NorbitsProvider()
174
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/medusa/providers/torrent/json/norbits.py b/medusa/providers/torrent/json/norbits.py
--- a/medusa/providers/torrent/json/norbits.py
+++ b/medusa/providers/torrent/json/norbits.py
@@ -5,7 +5,6 @@
 from __future__ import unicode_literals
 
 import logging
-import traceback
 
 from medusa import tv
 from medusa.helper.common import (
@@ -49,7 +48,7 @@
         self.minleech = None
 
         # Cache
-        self.cache = tv.Cache(self, min_time=20)  # only poll Norbits every 15 minutes max
+        self.cache = tv.Cache(self, min_time=20)
 
     def search(self, search_strings, age=0, ep_obj=None, **kwargs):
         """
@@ -78,7 +77,7 @@
                     'search': search_string,
                 }
 
-                response = self.session.post(self.urls['search'], data=post_data)
+                response = self.session.post(self.urls['search'], json=post_data)
                 if not response or not response.content:
                     log.debug('No data returned from provider')
                     continue
@@ -89,10 +88,10 @@
                     log.debug('No data returned from provider')
                     continue
 
-                if self._check_auth_from_data(jdata):
+                if not self._check_auth_from_data(jdata):
                     return results
 
-            results += self.parse(jdata, mode)
+                results += self.parse(jdata, mode)
 
         return results
 
@@ -106,10 +105,9 @@
         :return: A list of items found
         """
         items = []
-        data.get('data', '')
-        torrent_rows = data.get('torrents', [])
+        json_data = data.get('data', {})
+        torrent_rows = json_data.get('torrents', [])
 
-        # Skip column headers
         for row in torrent_rows:
             try:
                 title = row.pop('name', '')
@@ -147,16 +145,14 @@
 
                 items.append(item)
             except (AttributeError, TypeError, KeyError, ValueError, IndexError):
-                log.error('Failed parsing provider. Traceback: {0!r}',
-                          traceback.format_exc())
+                log.exception('Failed parsing provider.')
 
         return items
 
     def _check_auth(self):
-
         if not self.username or not self.passkey:
-            raise AuthException(('Your authentication credentials for %s are '
-                                 'missing, check your config.') % self.name)
+            raise AuthException('Your authentication credentials for {0} are missing,'
+                                ' check your config.'.format(self.name))
 
         return True
 
@@ -166,6 +162,7 @@
             if parsed_json.get('status') == 3:
                 log.warning('Invalid username or password.'
                             ' Check your settings')
+                return False
 
         return True

{"golden_diff": "diff --git a/medusa/providers/torrent/json/norbits.py b/medusa/providers/torrent/json/norbits.py\n--- a/medusa/providers/torrent/json/norbits.py\n+++ b/medusa/providers/torrent/json/norbits.py\n@@ -5,7 +5,6 @@\n from __future__ import unicode_literals\n \n import logging\n-import traceback\n \n from medusa import tv\n from medusa.helper.common import (\n@@ -49,7 +48,7 @@\n         self.minleech = None\n \n         # Cache\n-        self.cache = tv.Cache(self, min_time=20)  # only poll Norbits every 15 minutes max\n+        self.cache = tv.Cache(self, min_time=20)\n \n     def search(self, search_strings, age=0, ep_obj=None, **kwargs):\n         \"\"\"\n@@ -78,7 +77,7 @@\n                     'search': search_string,\n                 }\n \n-                response = self.session.post(self.urls['search'], data=post_data)\n+                response = self.session.post(self.urls['search'], json=post_data)\n                 if not response or not response.content:\n                     log.debug('No data returned from provider')\n                     continue\n@@ -89,10 +88,10 @@\n                     log.debug('No data returned from provider')\n                     continue\n \n-                if self._check_auth_from_data(jdata):\n+                if not self._check_auth_from_data(jdata):\n                     return results\n \n-            results += self.parse(jdata, mode)\n+                results += self.parse(jdata, mode)\n \n         return results\n \n@@ -106,10 +105,9 @@\n         :return: A list of items found\n         \"\"\"\n         items = []\n-        data.get('data', '')\n-        torrent_rows = data.get('torrents', [])\n+        json_data = data.get('data', {})\n+        torrent_rows = json_data.get('torrents', [])\n \n-        # Skip column headers\n         for row in torrent_rows:\n             try:\n                 title = row.pop('name', '')\n@@ -147,16 +145,14 @@\n \n                 items.append(item)\n             except (AttributeError, TypeError, KeyError, ValueError, IndexError):\n-                log.error('Failed parsing provider. Traceback: {0!r}',\n-                          traceback.format_exc())\n+                log.exception('Failed parsing provider.')\n \n         return items\n \n     def _check_auth(self):\n-\n         if not self.username or not self.passkey:\n-            raise AuthException(('Your authentication credentials for %s are '\n-                                 'missing, check your config.') % self.name)\n+            raise AuthException('Your authentication credentials for {0} are missing,'\n+                                ' check your config.'.format(self.name))\n \n         return True\n \n@@ -166,6 +162,7 @@\n             if parsed_json.get('status') == 3:\n                 log.warning('Invalid username or password.'\n                             ' Check your settings')\n+                return False\n \n         return True\n", "issue": "Problem Searching for Norwegian Shows\n### Before submitting your issue:\r\n\r\nEnable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)\r\n\r\n**Branch/Commit:master/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe\r\n**OS:CentOS 7\r\n**What you did: Searching for a Show (manual and auto) on Provider Norbits (Norwegian Tracker) for a Norwegian show\r\n**What happened: No results\r\n**What you expected: There are available files so expected results\r\n**Logs:**\r\n```\r\n2018-03-10 09:35:54 INFO     SEARCHQUEUE-MANUAL-342737 :: [d6eb72d] Unable to find manual results for: Stories From Norway - S01E01 - 001 - Stupet\u00e5rnet i Hamar\r\n2018-03-10 09:35:53 INFO     SEARCHQUEUE-MANUAL-342737 :: [Norbits] :: [d6eb72d] Performing season pack search for Stories From Norway\r\n2018-03-10 09:35:53 INFO     SEARCHQUEUE-MANUAL-342737 :: [Norbits] :: [d6eb72d] Performing episode search for Stories From Norway\r\n\r\n```\r\n\r\nI was wondering if there is some settings that ignores Norwegian?\r\nI can't find any exceptions.\r\nI know this worked in Sickrage with no problems. (coming from Sickrage)\r\n\r\nThis goes for all Norwegian shows I have\n", "before_files": [{"content": "# coding=utf-8\n\n\"\"\"Provider code for Norbits.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport logging\nimport traceback\n\nfrom medusa import tv\nfrom medusa.helper.common import (\n    convert_size,\n    try_int,\n)\nfrom medusa.helper.exceptions import AuthException\nfrom medusa.logger.adapters.style import BraceAdapter\nfrom medusa.providers.torrent.torrent_provider import TorrentProvider\n\nfrom requests.compat import urlencode, urljoin\n\nlog = BraceAdapter(logging.getLogger(__name__))\nlog.logger.addHandler(logging.NullHandler())\n\n\nclass NorbitsProvider(TorrentProvider):\n    \"\"\"Norbits Torrent provider.\"\"\"\n\n    def __init__(self):\n        \"\"\".Initialize the class.\"\"\"\n        super(NorbitsProvider, self).__init__('Norbits')\n\n        # Credentials\n        self.username = None\n        self.passkey = None\n\n        # URLs\n        self.url = 'https://norbits.net'\n        self.urls = {\n            'search': urljoin(self.url, 'api2.php?action=torrents'),\n            'download': urljoin(self.url, 'download.php?'),\n        }\n\n        # Proper Strings\n\n        # Miscellaneous Options\n\n        # Torrent Stats\n        self.minseed = None\n        self.minleech = None\n\n        # Cache\n        self.cache = tv.Cache(self, min_time=20)  # only poll Norbits every 15 minutes max\n\n    def search(self, search_strings, age=0, ep_obj=None, **kwargs):\n        \"\"\"\n        Search a provider and parse the results.\n\n        :param search_strings: A dict with mode (key) and the search value (value)\n        :param age: Not used\n        :param ep_obj: Not used\n        :returns: A list of search results (structure)\n        \"\"\"\n        results = []\n\n        for mode in search_strings:\n            log.debug('Search mode: {0}', mode)\n\n            for search_string in search_strings[mode]:\n\n                if mode != 'RSS':\n                    log.debug('Search string: {search}',\n                              {'search': search_string})\n\n                post_data = {\n                    'username': self.username,\n                    'passkey': self.passkey,\n                    'category': '2',  # TV Category\n                    'search': search_string,\n                }\n\n                response = self.session.post(self.urls['search'], data=post_data)\n                if not response or not response.content:\n                    log.debug('No data returned from provider')\n                    continue\n\n                try:\n                    jdata = response.json()\n                except ValueError:\n                    log.debug('No data returned from provider')\n                    continue\n\n                if self._check_auth_from_data(jdata):\n                    return results\n\n            results += self.parse(jdata, mode)\n\n        return results\n\n    def parse(self, data, mode):\n        \"\"\"\n        Parse search results for items.\n\n        :param data: The raw response from a search\n        :param mode: The current mode used to search, e.g. RSS\n\n        :return: A list of items found\n        \"\"\"\n        items = []\n        data.get('data', '')\n        torrent_rows = data.get('torrents', [])\n\n        # Skip column headers\n        for row in torrent_rows:\n            try:\n                title = row.pop('name', '')\n                download_url = '{0}{1}'.format(\n                    self.urls['download'],\n                    urlencode({'id': row.pop('id', ''), 'passkey': self.passkey}))\n\n                if not all([title, download_url]):\n                    continue\n\n                seeders = try_int(row.pop('seeders', 0))\n                leechers = try_int(row.pop('leechers', 0))\n\n                # Filter unseeded torrent\n                if seeders < min(self.minseed, 1):\n                    if mode != 'RSS':\n                        log.debug(\"Discarding torrent because it doesn't meet the\"\n                                  \" minimum seeders: {0}. Seeders: {1}\",\n                                  title, seeders)\n                    continue\n\n                size = convert_size(row.pop('size', -1), -1)\n\n                item = {\n                    'title': title,\n                    'link': download_url,\n                    'size': size,\n                    'seeders': seeders,\n                    'leechers': leechers,\n                    'pubdate': None,\n                }\n                if mode != 'RSS':\n                    log.debug('Found result: {0} with {1} seeders and {2} leechers',\n                              title, seeders, leechers)\n\n                items.append(item)\n            except (AttributeError, TypeError, KeyError, ValueError, IndexError):\n                log.error('Failed parsing provider. Traceback: {0!r}',\n                          traceback.format_exc())\n\n        return items\n\n    def _check_auth(self):\n\n        if not self.username or not self.passkey:\n            raise AuthException(('Your authentication credentials for %s are '\n                                 'missing, check your config.') % self.name)\n\n        return True\n\n    def _check_auth_from_data(self, parsed_json):\n        \"\"\"Check that we are authenticated.\"\"\"\n        if 'status' in parsed_json and 'message' in parsed_json:\n            if parsed_json.get('status') == 3:\n                log.warning('Invalid username or password.'\n                            ' Check your settings')\n\n        return True\n\n\nprovider = NorbitsProvider()\n", "path": "medusa/providers/torrent/json/norbits.py"}], "after_files": [{"content": "# coding=utf-8\n\n\"\"\"Provider code for Norbits.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport logging\n\nfrom medusa import tv\nfrom medusa.helper.common import (\n    convert_size,\n    try_int,\n)\nfrom medusa.helper.exceptions import AuthException\nfrom medusa.logger.adapters.style import BraceAdapter\nfrom medusa.providers.torrent.torrent_provider import TorrentProvider\n\nfrom requests.compat import urlencode, urljoin\n\nlog = BraceAdapter(logging.getLogger(__name__))\nlog.logger.addHandler(logging.NullHandler())\n\n\nclass NorbitsProvider(TorrentProvider):\n    \"\"\"Norbits Torrent provider.\"\"\"\n\n    def __init__(self):\n        \"\"\".Initialize the class.\"\"\"\n        super(NorbitsProvider, self).__init__('Norbits')\n\n        # Credentials\n        self.username = None\n        self.passkey = None\n\n        # URLs\n        self.url = 'https://norbits.net'\n        self.urls = {\n            'search': urljoin(self.url, 'api2.php?action=torrents'),\n            'download': urljoin(self.url, 'download.php?'),\n        }\n\n        # Proper Strings\n\n        # Miscellaneous Options\n\n        # Torrent Stats\n        self.minseed = None\n        self.minleech = None\n\n        # Cache\n        self.cache = tv.Cache(self, min_time=20)\n\n    def search(self, search_strings, age=0, ep_obj=None, **kwargs):\n        \"\"\"\n        Search a provider and parse the results.\n\n        :param search_strings: A dict with mode (key) and the search value (value)\n        :param age: Not used\n        :param ep_obj: Not used\n        :returns: A list of search results (structure)\n        \"\"\"\n        results = []\n\n        for mode in search_strings:\n            log.debug('Search mode: {0}', mode)\n\n            for search_string in search_strings[mode]:\n\n                if mode != 'RSS':\n                    log.debug('Search string: {search}',\n                              {'search': search_string})\n\n                post_data = {\n                    'username': self.username,\n                    'passkey': self.passkey,\n                    'category': '2',  # TV Category\n                    'search': search_string,\n                }\n\n                response = self.session.post(self.urls['search'], json=post_data)\n                if not response or not response.content:\n                    log.debug('No data returned from provider')\n                    continue\n\n                try:\n                    jdata = response.json()\n                except ValueError:\n                    log.debug('No data returned from provider')\n                    continue\n\n                if not self._check_auth_from_data(jdata):\n                    return results\n\n                results += self.parse(jdata, mode)\n\n        return results\n\n    def parse(self, data, mode):\n        \"\"\"\n        Parse search results for items.\n\n        :param data: The raw response from a search\n        :param mode: The current mode used to search, e.g. RSS\n\n        :return: A list of items found\n        \"\"\"\n        items = []\n        json_data = data.get('data', {})\n        torrent_rows = json_data.get('torrents', [])\n\n        for row in torrent_rows:\n            try:\n                title = row.pop('name', '')\n                download_url = '{0}{1}'.format(\n                    self.urls['download'],\n                    urlencode({'id': row.pop('id', ''), 'passkey': self.passkey}))\n\n                if not all([title, download_url]):\n                    continue\n\n                seeders = try_int(row.pop('seeders', 0))\n                leechers = try_int(row.pop('leechers', 0))\n\n                # Filter unseeded torrent\n                if seeders < min(self.minseed, 1):\n                    if mode != 'RSS':\n                        log.debug(\"Discarding torrent because it doesn't meet the\"\n                                  \" minimum seeders: {0}. Seeders: {1}\",\n                                  title, seeders)\n                    continue\n\n                size = convert_size(row.pop('size', -1), -1)\n\n                item = {\n                    'title': title,\n                    'link': download_url,\n                    'size': size,\n                    'seeders': seeders,\n                    'leechers': leechers,\n                    'pubdate': None,\n                }\n                if mode != 'RSS':\n                    log.debug('Found result: {0} with {1} seeders and {2} leechers',\n                              title, seeders, leechers)\n\n                items.append(item)\n            except (AttributeError, TypeError, KeyError, ValueError, IndexError):\n                log.exception('Failed parsing provider.')\n\n        return items\n\n    def _check_auth(self):\n        if not self.username or not self.passkey:\n            raise AuthException('Your authentication credentials for {0} are missing,'\n                                ' check your config.'.format(self.name))\n\n        return True\n\n    def _check_auth_from_data(self, parsed_json):\n        \"\"\"Check that we are authenticated.\"\"\"\n        if 'status' in parsed_json and 'message' in parsed_json:\n            if parsed_json.get('status') == 3:\n                log.warning('Invalid username or password.'\n                            ' Check your settings')\n                return False\n\n        return True\n\n\nprovider = NorbitsProvider()\n", "path": "medusa/providers/torrent/json/norbits.py"}]}