From c264c752827fa35179c2dd2109c84c066b856459 Mon Sep 17 00:00:00 2001 From: AdeHub Date: Sat, 10 Aug 2024 11:34:30 +1200 Subject: [PATCH] Removed Waffles :anguished: --- data/interfaces/default/config.html | 22 --------- headphones/config.py | 4 -- headphones/deluge.py | 4 -- headphones/searcher.py | 71 ----------------------------- headphones/webserve.py | 7 +-- 5 files changed, 1 insertion(+), 107 deletions(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 710a804d..d88cbfdd 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -655,26 +655,6 @@ -
-
- -
-
-
- - -
-
- - -
-
- - -
-
-
-
@@ -2602,8 +2582,6 @@ initConfigCheckbox("#use_omgwtfnzbs"); initConfigCheckbox("#use_torznab"); initConfigCheckbox("#use_piratebay"); - initConfigCheckbox("#use_oldpiratebay"); - initConfigCheckbox("#use_waffles"); initConfigCheckbox("#use_rutracker"); initConfigCheckbox("#use_orpheus"); initConfigCheckbox("#use_redacted"); diff --git a/headphones/config.py b/headphones/config.py index 41b490c4..9679981f 100644 --- a/headphones/config.py +++ b/headphones/config.py @@ -305,10 +305,6 @@ _CONFIG_DEFINITIONS = { 'UTORRENT_USERNAME': (str, 'uTorrent', ''), 'VERIFY_SSL_CERT': (bool_int, 'Advanced', 1), 'WAIT_UNTIL_RELEASE_DATE': (int, 'General', 0), - 'WAFFLES': (int, 'Waffles', 0), - 'WAFFLES_PASSKEY': (str, 'Waffles', ''), - 'WAFFLES_RATIO': (str, 'Waffles', ''), - 'WAFFLES_UID': (str, 'Waffles', ''), 'REDACTED': (int, 'Redacted', 0), 'REDACTED_USERNAME': (str, 'Redacted', ''), 'REDACTED_PASSWORD': (str, 'Redacted', ''), diff --git a/headphones/deluge.py b/headphones/deluge.py index 5130fb96..01c6fbd8 100644 --- a/headphones/deluge.py +++ b/headphones/deluge.py @@ -84,7 +84,6 @@ def addTorrent(link, data=None, name=None): result = {} retid = False url_orpheus = ['https://orpheus.network/', 'http://orpheus.network/'] - url_waffles = ['https://waffles.ch/', 'http://waffles.ch/'] if link.lower().startswith('magnet:'): logger.debug('Deluge: Got a magnet link: %s' % _scrubber(link)) @@ -94,9 +93,6 @@ def addTorrent(link, data=None, name=None): elif link.lower().startswith('http://') or link.lower().startswith('https://'): logger.debug('Deluge: Got a URL: %s' % _scrubber(link)) - if link.lower().startswith(tuple(url_waffles)): - if 'rss=' not in link: - link = link + '&rss=1' if link.lower().startswith(tuple(url_orpheus)): logger.debug('Deluge: Using different User-Agent for this site') user_agent = 'Headphones' diff --git a/headphones/searcher.py b/headphones/searcher.py index 2c5e8094..a2f6e956 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -183,8 +183,6 @@ def get_seed_ratio(provider): seed_ratio = headphones.CONFIG.REDACTED_RATIO elif provider == 'The Pirate Bay': seed_ratio = headphones.CONFIG.PIRATEBAY_RATIO - elif provider == 'Waffles.ch': - seed_ratio = headphones.CONFIG.WAFFLES_RATIO elif provider.startswith("Torznab"): host = provider.split('|')[2] if host == headphones.CONFIG.TORZNAB_HOST: @@ -322,7 +320,6 @@ def do_sorted_search(album, new, losslessOnly, choose_specific_download=False): TORRENT_PROVIDERS = (headphones.CONFIG.TORZNAB or headphones.CONFIG.PIRATEBAY or - headphones.CONFIG.WAFFLES or headphones.CONFIG.RUTRACKER or headphones.CONFIG.ORPHEUS or headphones.CONFIG.REDACTED) @@ -1519,74 +1516,6 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, logger.exception( "An unknown error occurred trying to parse the feed: %s" % e) - if headphones.CONFIG.WAFFLES: - provider = "Waffles.ch" - providerurl = fix_url("https://waffles.ch/browse.php") - - bitrate = None - if headphones.CONFIG.PREFERRED_QUALITY == 3 or losslessOnly: - format = "FLAC" - bitrate = "(Lossless)" - maxsize = 10000000000 - elif headphones.CONFIG.PREFERRED_QUALITY == 1 or allow_lossless: - format = "FLAC OR MP3" - maxsize = 10000000000 - else: - format = "MP3" - maxsize = 300000000 - - if not usersearchterm: - query_items = ['artist:"%s"' % artistterm, - 'album:"%s"' % albumterm, - 'year:(%s)' % year] - else: - query_items = [usersearchterm] - - query_items.extend(['format:(%s)' % format, - 'size:[0 TO %d]' % maxsize]) - # (25/03/2017 Waffles back up after 5 months, all torrents currently have no seeders, remove for now) - # '-seeders:0']) cut out dead torrents - - if bitrate: - query_items.append('bitrate:"%s"' % bitrate) - - # Requesting content - logger.info('Parsing results from Waffles.ch') - - params = { - "uid": headphones.CONFIG.WAFFLES_UID, - "passkey": headphones.CONFIG.WAFFLES_PASSKEY, - "rss": "1", - "c0": "1", - "s": "seeders", # sort by - "d": "desc", # direction - "q": " ".join(query_items) - } - - data = request.request_feed( - url=providerurl, - params=params, - timeout=20 - ) - - # Process feed - if data: - if not len(data.entries): - logger.info("No results found from %s for %s", provider, term) - else: - for item in data.entries: - try: - title = item.title - desc_match = re.search(r"Size: (\d+)<", item.description) - size = int(desc_match.group(1)) - url = item.link - resultlist.append(Result(title, size, url, provider, 'torrent', True)) - logger.info('Found %s. Size: %s', title, bytes_to_mb(size)) - except Exception as e: - logger.error( - "An error occurred while trying to parse the response from Waffles.ch: %s", - e) - # rutracker.org if headphones.CONFIG.RUTRACKER: provider = "rutracker.org" diff --git a/headphones/webserve.py b/headphones/webserve.py index bbdad18e..8722cc38 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -1231,10 +1231,6 @@ class WebInterface(object): "use_piratebay": checked(headphones.CONFIG.PIRATEBAY), "piratebay_proxy_url": headphones.CONFIG.PIRATEBAY_PROXY_URL, "piratebay_ratio": headphones.CONFIG.PIRATEBAY_RATIO, - "use_waffles": checked(headphones.CONFIG.WAFFLES), - "waffles_uid": headphones.CONFIG.WAFFLES_UID, - "waffles_passkey": headphones.CONFIG.WAFFLES_PASSKEY, - "waffles_ratio": headphones.CONFIG.WAFFLES_RATIO, "use_rutracker": checked(headphones.CONFIG.RUTRACKER), "rutracker_user": headphones.CONFIG.RUTRACKER_USER, "rutracker_password": headphones.CONFIG.RUTRACKER_PASSWORD, @@ -1464,8 +1460,7 @@ class WebInterface(object): checked_configs = [ "launch_browser", "enable_https", "api_enabled", "use_blackhole", "headphones_indexer", "use_newznab", "newznab_enabled", "use_torznab", "torznab_enabled", - "use_nzbsorg", "use_omgwtfnzbs", "use_piratebay", - "use_waffles", "use_rutracker", + "use_nzbsorg", "use_omgwtfnzbs", "use_piratebay", "use_rutracker", "use_orpheus", "use_redacted", "redacted_use_fltoken", "preferred_bitrate_allow_lossless", "detect_bitrate", "ignore_clean_releases", "freeze_db", "cue_split", "move_files", "rename_files", "rename_single_disc_ignore", "correct_metadata", "cleanup_files",