diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e8e072f79..7af07b011e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Build develop branch on: workflow_run: - workflows: [ "Python Packaging" ] + workflows: [Python Packaging] branches: | - develop type: diff --git a/sickchill/oldbeard/notifiers/nmj.py b/sickchill/oldbeard/notifiers/nmj.py index 42bc1d435a..46694f2ac9 100644 --- a/sickchill/oldbeard/notifiers/nmj.py +++ b/sickchill/oldbeard/notifiers/nmj.py @@ -1,5 +1,10 @@ import re -import telnetlib + +try: + import telnetlib +except (ImportError, ModuleNotFoundError): + telnetlib = None + import urllib.parse import urllib.request from xml.etree import ElementTree @@ -19,6 +24,9 @@ def notify_settings(host): """ # establish a terminal session to the PC + + if telnetlib is None: + logger.info("telnetlib was removed in python 3.13, use python 3.12, disable nmj, or update this script to use a new library") try: terminal = telnetlib.Telnet(host) except Exception: diff --git a/sickchill/oldbeard/providers/abnormal.py b/sickchill/oldbeard/providers/abnormal.py index d058481fbe..4b5123a930 100644 --- a/sickchill/oldbeard/providers/abnormal.py +++ b/sickchill/oldbeard/providers/abnormal.py @@ -58,7 +58,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/alpharatio.py b/sickchill/oldbeard/providers/alpharatio.py index c55752a8e8..3235f75f30 100644 --- a/sickchill/oldbeard/providers/alpharatio.py +++ b/sickchill/oldbeard/providers/alpharatio.py @@ -58,7 +58,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/archetorrent.py b/sickchill/oldbeard/providers/archetorrent.py index 604443829c..92e0c48c9a 100644 --- a/sickchill/oldbeard/providers/archetorrent.py +++ b/sickchill/oldbeard/providers/archetorrent.py @@ -59,7 +59,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/bitcannon.py b/sickchill/oldbeard/providers/bitcannon.py index 8f9b1a89b9..c029c8825c 100644 --- a/sickchill/oldbeard/providers/bitcannon.py +++ b/sickchill/oldbeard/providers/bitcannon.py @@ -17,7 +17,7 @@ def __init__(self): self.cache = tvcache.TVCache(self, search_params={"RSS": ["tv", "anime"]}) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] url = "http://localhost:3000/" @@ -29,7 +29,7 @@ def search(self, search_strings, episode_object=None): search_params = {} - anime = episode_object and episode_object.show and episode_object.show.anime + anime = self.show and self.show.anime or False search_params["category"] = ("tv", "anime")[bool(anime)] if self.api_key: diff --git a/sickchill/oldbeard/providers/bjshare.py b/sickchill/oldbeard/providers/bjshare.py index c4977e1dfb..c45a0dca03 100644 --- a/sickchill/oldbeard/providers/bjshare.py +++ b/sickchill/oldbeard/providers/bjshare.py @@ -54,12 +54,11 @@ def __init__(self): # until they or the source from where they get that info fix it... self.absolute_numbering = ["One Piece", "Boruto: Naruto Next Generations"] - def search(self, search_strings, episode_object=None): + def search(self, search_strings): """ Search a provider and parse the results. :param search_strings: A dict with mode (key) and the search value (value) - :param episode_object: Information about the episode being searched (when not RSS) :returns: A list of search results (structure) """ @@ -67,9 +66,7 @@ def search(self, search_strings, episode_object=None): if not self.login(): return results - anime = False - if episode_object and episode_object.show: - anime = episode_object.show.anime == 1 + anime = self.show and self.show.anime == 1 or False search_params = {"order_by": "time", "order_way": "desc", "group_results": 0, "action": "basic", "searchsubmit": 1} diff --git a/sickchill/oldbeard/providers/btn.py b/sickchill/oldbeard/providers/btn.py index fce5af32f8..47cdb0a6af 100644 --- a/sickchill/oldbeard/providers/btn.py +++ b/sickchill/oldbeard/providers/btn.py @@ -47,7 +47,7 @@ def _check_auth_from_data(self, data): return True - def search(self, search_params, episode_object=None): + def search(self, search_params): self._check_auth() results = [] @@ -183,7 +183,7 @@ def get_season_search_strings(self, episode_object): search_params = {"category": "Season"} # Search for entire seasons: no need to do special things for air by date or sports shows - if episode_object.show.air_by_date or episode_object.show.sports: + if self.show.air_by_date or self.show.sports: # Search for the year of the air by date show search_params["name"] = str(episode_object.airdate).split("-")[0] else: @@ -199,7 +199,7 @@ def get_episode_search_strings(self, episode_object, add_string=""): search_params = {"category": "Episode"} # episode - if episode_object.show.air_by_date or episode_object.show.sports: + if self.show.air_by_date or self.show.sports: date_str = str(episode_object.airdate) # BTN uses dots in dates, we just search for the date since that diff --git a/sickchill/oldbeard/providers/cpasbien.py b/sickchill/oldbeard/providers/cpasbien.py index 2a4ec46bf6..e71a51eca8 100644 --- a/sickchill/oldbeard/providers/cpasbien.py +++ b/sickchill/oldbeard/providers/cpasbien.py @@ -10,7 +10,7 @@ class Provider(FrenchTorrentProvider): def __init__(self): super().__init__("Cpasbien", "https://www.cpasbien.ch") - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] for mode in search_strings: items = [] diff --git a/sickchill/oldbeard/providers/danishbits.py b/sickchill/oldbeard/providers/danishbits.py index b4f3c67ca6..998cd7df03 100644 --- a/sickchill/oldbeard/providers/danishbits.py +++ b/sickchill/oldbeard/providers/danishbits.py @@ -32,7 +32,7 @@ def __init__(self): # Cache self.cache = tvcache.TVCache(self, min_time=10) # Only poll Danishbits every 10 minutes max - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/demonoid.py b/sickchill/oldbeard/providers/demonoid.py index d1c54bccad..4cd9154869 100644 --- a/sickchill/oldbeard/providers/demonoid.py +++ b/sickchill/oldbeard/providers/demonoid.py @@ -30,7 +30,7 @@ def __init__(self): self.cache = DemonoidCache(self) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] # https://demonoid.is/files/?category=12&quality=58&seeded=0&external=2&sort=seeders&order=desc&query=SEARCH_STRING search_params = { diff --git a/sickchill/oldbeard/providers/elitetorrent.py b/sickchill/oldbeard/providers/elitetorrent.py index 000cb722a5..5629f8f761 100644 --- a/sickchill/oldbeard/providers/elitetorrent.py +++ b/sickchill/oldbeard/providers/elitetorrent.py @@ -23,9 +23,9 @@ def __init__(self): self.url = self.urls["base_url"] - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] - lang_info = "" if not episode_object or not episode_object.show else episode_object.show.lang + lang_info = self.show and self.show.lang or "" """ Search query: diff --git a/sickchill/oldbeard/providers/eztv.py b/sickchill/oldbeard/providers/eztv.py index 36458edfad..87f09ab93d 100644 --- a/sickchill/oldbeard/providers/eztv.py +++ b/sickchill/oldbeard/providers/eztv.py @@ -25,7 +25,7 @@ def __init__(self): # Cache self.cache = tvcache.TVCache(self, min_time=30) # only poll ThePirateBay every 30 minutes max - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] search_params = {"imdb_id": None, "page": 1, "limit": 100} @@ -35,11 +35,11 @@ def search(self, search_strings, episode_object=None): logger.debug(_("Search Mode: {mode}").format(mode=mode)) if mode != "RSS": - if not (episode_object and episode_object.show and episode_object.show.imdb_id): + if not (self.show and self.show.imdb_id): continue - search_params["imdb_id"] = episode_object.show.imdb_id.strip("tt") - logger.debug("Search string: {}".format(episode_object.show.imdb_id)) + search_params["imdb_id"] = self.show.imdb_id.strip("tt") + logger.debug("Search string: {}".format(self.show.imdb_id)) else: search_params.pop("imdb_id") diff --git a/sickchill/oldbeard/providers/filelist.py b/sickchill/oldbeard/providers/filelist.py index 8daebdd9aa..38639e4f01 100644 --- a/sickchill/oldbeard/providers/filelist.py +++ b/sickchill/oldbeard/providers/filelist.py @@ -53,7 +53,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/gimmepeers.py b/sickchill/oldbeard/providers/gimmepeers.py index 92cc580f84..1a2eba22a8 100644 --- a/sickchill/oldbeard/providers/gimmepeers.py +++ b/sickchill/oldbeard/providers/gimmepeers.py @@ -65,7 +65,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/hd4free.py b/sickchill/oldbeard/providers/hd4free.py index 4a75edd941..5a2717ccee 100644 --- a/sickchill/oldbeard/providers/hd4free.py +++ b/sickchill/oldbeard/providers/hd4free.py @@ -28,7 +28,7 @@ def _check_auth(self): logger.warning("Your authentication credentials for {0} are missing, check your config.".format(self.name)) return False - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self._check_auth: return results diff --git a/sickchill/oldbeard/providers/hdbits.py b/sickchill/oldbeard/providers/hdbits.py index be5f2caeef..2026baadd9 100644 --- a/sickchill/oldbeard/providers/hdbits.py +++ b/sickchill/oldbeard/providers/hdbits.py @@ -36,11 +36,11 @@ def _check_auth_from_data(parsed_json): return True def get_season_search_strings(self, episode_object): - season_search_string = [self.make_post_data_JSON(show=episode_object.show, season=episode_object)] + season_search_string = [self.make_post_data_JSON(show=self.show, season=episode_object)] return season_search_string def get_episode_search_strings(self, episode_object, add_string=""): - episode_search_string = [self.make_post_data_JSON(show=episode_object.show, episode=episode_object)] + episode_search_string = [self.make_post_data_JSON(show=self.show, episode=episode_object)] return episode_search_string def _get_title_and_url(self, item): @@ -49,11 +49,10 @@ def _get_title_and_url(self, item): return title, url - def search(self, search_params, episode_object=None): - # FIXME + def search(self, search_params): results = [] - logger.debug("Search string: {0}".format(search_params)) + logger.debug(f"Search string: {search_params}") self._check_auth() diff --git a/sickchill/oldbeard/providers/hdspace.py b/sickchill/oldbeard/providers/hdspace.py index f7401953b6..d4678aeb10 100644 --- a/sickchill/oldbeard/providers/hdspace.py +++ b/sickchill/oldbeard/providers/hdspace.py @@ -63,7 +63,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/hdtorrents.py b/sickchill/oldbeard/providers/hdtorrents.py index 74fe6ec8c0..d03523edbd 100644 --- a/sickchill/oldbeard/providers/hdtorrents.py +++ b/sickchill/oldbeard/providers/hdtorrents.py @@ -58,7 +58,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/hdtorrents_it.py b/sickchill/oldbeard/providers/hdtorrents_it.py index 0fe7694aac..6ea7c5ff68 100644 --- a/sickchill/oldbeard/providers/hdtorrents_it.py +++ b/sickchill/oldbeard/providers/hdtorrents_it.py @@ -58,7 +58,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/horriblesubs.py b/sickchill/oldbeard/providers/horriblesubs.py index 7c62b4c421..4d82b8e1be 100644 --- a/sickchill/oldbeard/providers/horriblesubs.py +++ b/sickchill/oldbeard/providers/horriblesubs.py @@ -24,7 +24,7 @@ def __init__(self): self.cache = tvcache.TVCache(self, min_time=15) # only poll HorribleSubs every 15 minutes max - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if self.show and not self.show.is_anime: return results diff --git a/sickchill/oldbeard/providers/hounddawgs.py b/sickchill/oldbeard/providers/hounddawgs.py index 2f33f520e7..507f863b42 100644 --- a/sickchill/oldbeard/providers/hounddawgs.py +++ b/sickchill/oldbeard/providers/hounddawgs.py @@ -65,7 +65,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/ilcorsaronero.py b/sickchill/oldbeard/providers/ilcorsaronero.py index 771811a395..f891f431ea 100644 --- a/sickchill/oldbeard/providers/ilcorsaronero.py +++ b/sickchill/oldbeard/providers/ilcorsaronero.py @@ -173,13 +173,13 @@ def _magnet_from_result(info_hash, title): hash=info_hash, title=quote_plus(title), trackers="http://tracker.tntvillage.scambioetico.org:2710/announce" ) - def search(self, search_params, episode_object=None): + def search(self, search_strings): results = [] - for mode in search_params: + for mode in search_strings: items = [] logger.debug(_("Search Mode: {mode}").format(mode=mode)) - for search_string in search_params[mode]: + for search_string in search_strings[mode]: if search_string == "": continue diff --git a/sickchill/oldbeard/providers/immortalseed.py b/sickchill/oldbeard/providers/immortalseed.py index b206ef1ec2..9adb4ff3bd 100644 --- a/sickchill/oldbeard/providers/immortalseed.py +++ b/sickchill/oldbeard/providers/immortalseed.py @@ -72,7 +72,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/iptorrents.py b/sickchill/oldbeard/providers/iptorrents.py index 66ec6d71e5..2a91e59e09 100644 --- a/sickchill/oldbeard/providers/iptorrents.py +++ b/sickchill/oldbeard/providers/iptorrents.py @@ -87,17 +87,17 @@ def login(self): return True - def search(self, search_params, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results freeleech = "&free=on" if self.freeleech else "" - for mode in search_params: + for mode in search_strings: items = [] logger.debug(_("Search Mode: {mode}").format(mode=mode)) - for search_string in search_params[mode]: + for search_string in search_strings[mode]: if mode != "RSS": logger.debug(_("Search String: {search_string}").format(search_string=search_string)) diff --git a/sickchill/oldbeard/providers/kat.py b/sickchill/oldbeard/providers/kat.py index 86ed40336f..d70ff7356d 100644 --- a/sickchill/oldbeard/providers/kat.py +++ b/sickchill/oldbeard/providers/kat.py @@ -37,14 +37,14 @@ def __init__(self): self.rows_selector = dict(class_=re.compile(r"even|odd"), id=re.compile(r"torrent_.*_torrents")) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not (self.url and self.urls): self.find_domain() if not (self.url and self.urls): return results - anime = (self.show and self.show.anime) or (episode_object and episode_object.show and episode_object.show.anime) or False + anime = self.show and self.show.anime or False search_params = OrderedDict(field="seeders", sorder="desc", category=("tv", "anime")[anime]) for mode in search_strings: @@ -81,7 +81,7 @@ def search(self, search_strings, episode_object=None): return results # This will recurse a few times until all of the mirrors are exhausted if none of them work. - return self.search(search_strings, episode_object) + return self.search(search_strings) with BS4Parser(data) as html: labels = [cell.get_text() for cell in html.find(class_="firstr")("th")] diff --git a/sickchill/oldbeard/providers/limetorrents.py b/sickchill/oldbeard/providers/limetorrents.py index 28494da5ba..5e0dde6aa3 100644 --- a/sickchill/oldbeard/providers/limetorrents.py +++ b/sickchill/oldbeard/providers/limetorrents.py @@ -28,7 +28,7 @@ def __init__(self): self.cache = tvcache.TVCache(self, search_params={"RSS": ["rss"]}) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] for mode in search_strings: items = [] diff --git a/sickchill/oldbeard/providers/magnetdl.py b/sickchill/oldbeard/providers/magnetdl.py index 7232d91c12..ce847b078b 100644 --- a/sickchill/oldbeard/providers/magnetdl.py +++ b/sickchill/oldbeard/providers/magnetdl.py @@ -24,7 +24,7 @@ def __init__(self): self.cache = tvcache.TVCache(self) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] for mode in search_strings: diff --git a/sickchill/oldbeard/providers/morethantv.py b/sickchill/oldbeard/providers/morethantv.py index 9e0a429205..fc934f0ca0 100644 --- a/sickchill/oldbeard/providers/morethantv.py +++ b/sickchill/oldbeard/providers/morethantv.py @@ -69,7 +69,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/ncore.py b/sickchill/oldbeard/providers/ncore.py index 540113483f..5e942966db 100644 --- a/sickchill/oldbeard/providers/ncore.py +++ b/sickchill/oldbeard/providers/ncore.py @@ -48,7 +48,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/nebulance.py b/sickchill/oldbeard/providers/nebulance.py index 3e24ea477c..da79ea2365 100644 --- a/sickchill/oldbeard/providers/nebulance.py +++ b/sickchill/oldbeard/providers/nebulance.py @@ -61,7 +61,7 @@ def login(self): return True - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results diff --git a/sickchill/oldbeard/providers/newpct.py b/sickchill/oldbeard/providers/newpct.py index 75fc344095..831ac9487b 100644 --- a/sickchill/oldbeard/providers/newpct.py +++ b/sickchill/oldbeard/providers/newpct.py @@ -19,7 +19,7 @@ def __init__(self): self.cache = tvcache.TVCache(self, min_time=20) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): """ Search query: http://www.newpct.com/index.php?l=doSearch&q=fringe&category_=All&idioma_=1&bus_de_=All @@ -31,7 +31,7 @@ def search(self, search_strings, episode_object=None): results = [] # Only search if user conditions are true - lang_info = "" if not episode_object or not episode_object.show else episode_object.show.lang + lang_info = self.show and self.show.lang or "" search_params = {"l": "doSearch", "q": "", "category_": "All", "idioma_": 1, "bus_de_": "All"} diff --git a/sickchill/oldbeard/providers/newznab.py b/sickchill/oldbeard/providers/newznab.py index 04fe62e59e..9f3f7eab16 100644 --- a/sickchill/oldbeard/providers/newznab.py +++ b/sickchill/oldbeard/providers/newznab.py @@ -135,8 +135,7 @@ def get_newznab_categories(self, just_caps=False): """ Uses the newznab provider url and apikey to get the capabilities. Makes use of the default newznab caps param. e.a. http://yournewznab/api?t=caps&apikey=skdfiw7823sdkdsfjsfk - Returns a tuple with (succes or not, array with dicts [{'id': '5070', 'name': 'Anime'}, - {'id': '5080', 'name': 'Documentary'}, {'id': '5020', 'name': 'Foreign'}...etc}], error message) + Returns a tuple with (success or not, array with dicts [{'id': '5070', 'name': 'Anime'}], error message) """ return_categories = [] @@ -258,7 +257,7 @@ def _make_provider(config): return new_provider - def search(self, search_strings, episode_object=None): + def search(self, search_strings): """ Searches indexer using the params in search_strings, either for latest releases, or a string/id search Returns: list of results in dict form @@ -289,18 +288,15 @@ def search(self, search_strings, episode_object=None): if mode != "RSS": if self.use_tv_search: if "tvdbid" in str(self.cap_tv_search): - search_params["tvdbid"] = episode_object.show.indexerid - - if episode_object.show.air_by_date or episode_object.show.sports: - # date_str = str(episode_object.airdate) - # search_params['season'] = date_str.partition('-')[0] - # search_params['ep'] = date_str.partition('-')[2].replace('-', '/') - search_params["q"] = str(episode_object.airdate) - elif episode_object.show.is_anime: - search_params["ep"] = episode_object.absolute_number + search_params["tvdbid"] = self.show.indexerid + + if self.show.air_by_date or self.show.sports: + search_params["q"] = str(self.current_episode_object.airdate) + elif self.show.is_anime: + search_params["ep"] = self.current_episode_object.absolute_number else: - search_params["season"] = episode_object.scene_season - search_params["ep"] = episode_object.scene_episode + search_params["season"] = self.current_episode_object.scene_season + search_params["ep"] = self.current_episode_object.scene_episode if mode == "Season": search_params.pop("ep", "") diff --git a/sickchill/oldbeard/providers/norbits.py b/sickchill/oldbeard/providers/norbits.py index a6e2672f9f..6f629dd2d6 100644 --- a/sickchill/oldbeard/providers/norbits.py +++ b/sickchill/oldbeard/providers/norbits.py @@ -40,16 +40,16 @@ def _check_auth_from_data(parsed_json): return True - def search(self, search_params, episode_object=None): + def search(self, search_strings): """Do the actual searching and JSON parsing""" results = [] - for mode in search_params: + for mode in search_strings: items = [] logger.debug(_("Search Mode: {mode}").format(mode=mode)) - for search_string in search_params[mode]: + for search_string in search_strings[mode]: if mode != "RSS": logger.debug(_("Search String: {search_string}").format(search_string=search_string)) diff --git a/sickchill/oldbeard/providers/nyaa.py b/sickchill/oldbeard/providers/nyaa.py index 081b9267c3..bf9b873766 100644 --- a/sickchill/oldbeard/providers/nyaa.py +++ b/sickchill/oldbeard/providers/nyaa.py @@ -24,7 +24,7 @@ def __init__(self): self.size_units = ["BYTES", "KIB", "MIB", "GIB", "TIB", "PIB"] self.cache = tvcache.TVCache(self, min_time=20) # only poll Nyaa every 20 minutes max - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if self.show and not self.show.is_anime: return results diff --git a/sickchill/oldbeard/providers/omgwtfnzbs.py b/sickchill/oldbeard/providers/omgwtfnzbs.py index 3d2ef7ff2f..4bdb7d9c67 100644 --- a/sickchill/oldbeard/providers/omgwtfnzbs.py +++ b/sickchill/oldbeard/providers/omgwtfnzbs.py @@ -49,7 +49,7 @@ def _get_title_and_url(self, item): def _get_size(self, item): return try_int(item["sizebytes"], -1) - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self._check_auth(): return results diff --git a/sickchill/oldbeard/providers/pretome.py b/sickchill/oldbeard/providers/pretome.py index 539d5bfcfd..9f00dd5ec1 100644 --- a/sickchill/oldbeard/providers/pretome.py +++ b/sickchill/oldbeard/providers/pretome.py @@ -60,15 +60,15 @@ def login(self): return True - def search(self, search_params, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results - for mode in search_params: + for mode in search_strings: items = [] logger.debug(_("Search Mode: {mode}").format(mode=mode)) - for search_string in search_params[mode]: + for search_string in search_strings[mode]: if mode != "RSS": logger.debug(_("Search String: {search_string}").format(search_string=search_string)) diff --git a/sickchill/oldbeard/providers/rarbg.py b/sickchill/oldbeard/providers/rarbg.py index b4aaa24406..ebc4fadd73 100644 --- a/sickchill/oldbeard/providers/rarbg.py +++ b/sickchill/oldbeard/providers/rarbg.py @@ -45,7 +45,7 @@ def login(self): self.token_expires = datetime.datetime.now() + datetime.timedelta(minutes=14) if self.token else None return self.token is not None - def search(self, search_strings, episode_object=None): + def search(self, search_strings): results = [] if not self.login(): return results @@ -60,9 +60,9 @@ def search(self, search_strings, episode_object=None): "token": self.token, } - if episode_object is not None: - ep_indexerid = episode_object.show.indexerid - ep_indexer = episode_object.idxr.slug + if self.show: + ep_indexerid = self.show.indexerid + ep_indexer = self.show.idxr.slug else: ep_indexerid = None ep_indexer = None diff --git a/sickchill/oldbeard/providers/scc.py b/sickchill/oldbeard/providers/scc.py index 349edac879..fad58eba92 100644 --- a/sickchill/oldbeard/providers/scc.py +++ b/sickchill/oldbeard/providers/scc.py @@ -61,7 +61,7 @@ def _isSection(section, text): title = r"