pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.8k stars 276 forks source link

Search for show returns no results #9910

Closed Tailslide closed 3 years ago

Tailslide commented 3 years ago

Describe the bug Searching for any show returns no results

To Reproduce Steps to reproduce the behavior:

  1. Go to 'add new show'
  2. Search for trek
  3. See the message 'No results found, try a different search.'

Expected behavior Finds results

Screenshots image

Medusa (please complete the following information):

Debug logs (at least 50 lines): General > Advanced Settings > Enable debug

``` 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] Searching for show trek 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] Searching for show with search term(s): ['trek'] on indexer: tvmaze 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] Using custom UI: 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] GET URL: https://api.thetvdb.com/search/series?name=trek [Status: 200] 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] Searching for show: trek 2021-09-26 01:48:27 DEBUG APIv2-Thread :: [9b23c72] Searching for show with search term(s): ['trek'] on indexer: tvdb 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] Using custom UI: 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] GET URL: https://api.themoviedb.org/3/search/tv?query=trek&language=en&page=2&api_key=edc5f123313769de83a71e157758030b [Status: 200] 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] GET URL: https://api.themoviedb.org/3/search/tv?query=trek&language=en&page=1&api_key=edc5f123313769de83a71e157758030b [Status: 200] 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] Searching for show: trek 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] Searching for show with search term(s): ['trek'] on indexer: tmdb 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] GET URL: https://api.themoviedb.org/3/configuration?api_key=edc5f123313769de83a71e157758030b [Status: 200] 2021-09-26 01:46:00 ERROR APIv2-Thread-8 :: [9b23c72] Internal Error searching for show. term(s): ['trek'] indexer: tvmaze error: 'NoneType' object has no attribute 'status_code' Traceback (most recent call last): File "/app/medusa/medusa/server/api/v2/internal.py", line 233, in resource_search_indexers_for_show_name indexer_results = indexer_api[search_term] File "/app/medusa/medusa/indexers/base.py", line 403, in __getitem__ selected_series = self._get_series(key) File "/app/medusa/medusa/indexers/base.py", line 157, in _get_series all_series = self.search(series) File "/app/medusa/medusa/indexers/tvmaze/api.py", line 190, in search results = self._show_search(series, request_language=self.config['language']) File "/app/medusa/medusa/indexers/tvmaze/api.py", line 164, in _show_search results = self.tvmaze_api.get_show_list(show) File "/app/medusa/lib/pytvmaze/tvmaze.py", line 968, in get_show_list shows = self.show_search(show_name) File "/app/medusa/lib/pytvmaze/tvmaze.py", line 985, in show_search q = self._endpoint_standard_get(url) File "/app/medusa/lib/pytvmaze/tvmaze.py", line 542, in _endpoint_standard_get if r.status_code in [404, 422]: AttributeError: 'NoneType' object has no attribute 'status_code' 2021-09-26 01:46:00 DEBUG APIv2-Thread-8 :: [9b23c72] Error requesting url http://api.tvmaze.com/search/shows?q=trek Error: HTTPConnectionPool(host='api.tvmaze.com', port=80): Max retries exceeded with url: /search/shows?q=trek (Caused by ConnectTimeoutError(, 'Connection to api.tvmaze.com timed out. (connect timeout=30)')) 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] Using custom UI: 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] GET URL: https://api.themoviedb.org/3/search/tv?query=trek&language=en&page=2&api_key=edc5f123313769de83a71e157758030b [Status: 200] 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] GET URL: https://api.themoviedb.org/3/search/tv?query=trek&language=en&page=1&api_key=edc5f123313769de83a71e157758030b [Status: 200] 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] Searching for show: trek 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] Searching for show with search term(s): ['trek'] on indexer: tmdb 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] User-Agent: Medusa/0.5.18 (Linux; 4.4.59+; dbbea6d4-1e9c-11ec-a0dd-0242ac130003) 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] GET URL: https://api.themoviedb.org/3/configuration?api_key=edc5f123313769de83a71e157758030b [Status: 200] 2021-09-26 01:44:01 ERROR APIv2-Thread-10 :: [9b23c72] Internal Error searching for show. term(s): ['trek'] indexer: tvmaze error: 'NoneType' object has no attribute 'status_code' Traceback (most recent call last): File "/app/medusa/medusa/server/api/v2/internal.py", line 233, in resource_search_indexers_for_show_name indexer_results = indexer_api[search_term] File "/app/medusa/medusa/indexers/base.py", line 403, in __getitem__ selected_series = self._get_series(key) File "/app/medusa/medusa/indexers/base.py", line 157, in _get_series all_series = self.search(series) File "/app/medusa/medusa/indexers/tvmaze/api.py", line 190, in search results = self._show_search(series, request_language=self.config['language']) File "/app/medusa/medusa/indexers/tvmaze/api.py", line 164, in _show_search results = self.tvmaze_api.get_show_list(show) File "/app/medusa/lib/pytvmaze/tvmaze.py", line 968, in get_show_list shows = self.show_search(show_name) File "/app/medusa/lib/pytvmaze/tvmaze.py", line 985, in show_search q = self._endpoint_standard_get(url) File "/app/medusa/lib/pytvmaze/tvmaze.py", line 542, in _endpoint_standard_get if r.status_code in [404, 422]: AttributeError: 'NoneType' object has no attribute 'status_code' 2021-09-26 01:44:01 DEBUG APIv2-Thread-10 :: [9b23c72] Error requesting url http://api.tvmaze.com/search/shows?q=trek Error: HTTPConnectionPool(host='api.tvmaze.com', port=80): Max retries exceeded with url: /search/shows?q=trek (Caused by ConnectTimeoutError(, 'Connection to api.tvmaze.com timed out. (connect timeout=30)')) ```

Additional context Switching from indexer 'all indexers' to TVDBv2 causes search results to appear but shows still fail to add.

medariox commented 3 years ago

Works fine here. You have problems connecting to TVmaze - maybe you are rate limited. Check your connectivity and try again later.

Tailslide commented 3 years ago

Weird.. the thing is it looks OK if I hit it directly here: http://api.tvmaze.com/search/shows?q=trek

However if I hit this URL I get {"Error":"Not authorized"} https://api.thetvdb.com/search/series?name=trek

Does it fall back to the one that is working? Or does everything fail if any indexer is unavailable? I'll wait another day and give it a try again.

Tailslide commented 3 years ago

Nevermind.. it was an overly restricted firewall rule.. thanks for your help!