Replaced all instances of WCD with Apollo

This commit is contained in:
Noam
2016-12-02 13:08:03 +02:00
parent b8e8e752f0
commit f8900795da
4 changed files with 33 additions and 33 deletions

View File

@@ -633,24 +633,24 @@
<fieldset>
<div class="row checkbox left">
<input id="use_whatcd" type="checkbox" class="bigcheck" name="use_whatcd" value="1" ${config['use_whatcd']} /><label for="use_whatcd"><span class="option">What.cd</span></label>
<input id="use_apollo" type="checkbox" class="bigcheck" name="use_apollo" value="1" ${config['use_apollo']} /><label for="use_apollo"><span class="option">Apollo.rip</span></label>
</div>
<div class="config">
<div class="row">
<label>Username</label>
<input type="text" name="whatcd_username" value="${config['whatcd_username']}" size="36">
<input type="text" name="apollo_username" value="${config['apollo_username']}" size="36">
</div>
<div class="row">
<label>Password</label>
<input type="password" name="whatcd_password" value="${config['whatcd_password'] | h}" size="36">
<input type="password" name="apollo_password" value="${config['apollo_password'] | h}" size="36">
</div>
<div class="row">
<label>URL</label>
<input type="text" name="whatcd_url" value="${config['whatcd_url']}" size="36">
<input type="text" name="apollo_url" value="${config['apollo_url']}" size="36">
</div>
<div class="row">
<label>Seed Ratio</label>
<input type="text" class="override-float" name="whatcd_ratio" value="${config['whatcd_ratio']}" size="10" title="Stop seeding when ratio met, 0 = unlimited. Scheduled job will remove torrent when post processed and finished seeding">
<input type="text" class="override-float" name="apollo_ratio" value="${config['apollo_ratio']}" size="10" title="Stop seeding when ratio met, 0 = unlimited. Scheduled job will remove torrent when post processed and finished seeding">
</div>
</div>
</fieldset>
@@ -2439,7 +2439,7 @@
initConfigCheckbox("#use_mininova");
initConfigCheckbox("#use_waffles");
initConfigCheckbox("#use_rutracker");
initConfigCheckbox("#use_whatcd");
initConfigCheckbox("#use_apollo");
initConfigCheckbox("#use_pth");
initConfigCheckbox("#use_strike");
initConfigCheckbox("#api_enabled");

View File

@@ -39,6 +39,11 @@ _CONFIG_DEFINITIONS = {
'ALBUM_COMPLETION_PCT': (int, 'Advanced', 80),
'API_ENABLED': (int, 'General', 0),
'API_KEY': (str, 'General', ''),
'APOLLO': (int, 'Apollo.rip', 0),
'APOLLO_PASSWORD': (str, 'Apollo.rip', ''),
'APOLLO_RATIO': (str, 'Apollo.rip', ''),
'APOLLO_USERNAME': (str, 'Apollo.rip', ''),
'APOLLO_URL': (str, 'Apollo.rip', 'https://apollo.rip'),
'AUTOWANT_ALL': (int, 'General', 0),
'AUTOWANT_MANUALLY_ADDED': (int, 'General', 1),
'AUTOWANT_UPCOMING': (int, 'General', 1),
@@ -289,11 +294,6 @@ _CONFIG_DEFINITIONS = {
'WAFFLES_PASSKEY': (str, 'Waffles', ''),
'WAFFLES_RATIO': (str, 'Waffles', ''),
'WAFFLES_UID': (str, 'Waffles', ''),
'WHATCD': (int, 'What.cd', 0),
'WHATCD_PASSWORD': (str, 'What.cd', ''),
'WHATCD_RATIO': (str, 'What.cd', ''),
'WHATCD_USERNAME': (str, 'What.cd', ''),
'WHATCD_URL': (str, 'What.cd', 'https://what.cd'),
'PTH': (int, 'PassTheHeadphones.me', 0),
'PTH_PASSWORD': (str, 'PassTheHeadphones.me', ''),
'PTH_RATIO': (str, 'PassTheHeadphones.me', ''),

View File

@@ -45,7 +45,7 @@ TORRENT_TO_MAGNET_SERVICES = [
'https://torcache.net/torrent/%s.torrent',
]
# Persistent What.cd API object
# Persistent Apollo.rip API object
gazelle = None
ruobj = None
@@ -160,8 +160,8 @@ def get_seed_ratio(provider):
seed_ratio = headphones.CONFIG.RUTRACKER_RATIO
elif provider == 'Kick Ass Torrents':
seed_ratio = headphones.CONFIG.KAT_RATIO
elif provider == 'What.cd':
seed_ratio = headphones.CONFIG.WHATCD_RATIO
elif provider == 'Apollo.rip':
seed_ratio = headphones.CONFIG.APOLLO_RATIO
elif provider == 'PassTheHeadphones.Me':
seed_ratio = headphones.CONFIG.PTH_RATIO
elif provider == 'The Pirate Bay':
@@ -274,7 +274,7 @@ def do_sorted_search(album, new, losslessOnly, choose_specific_download=False):
headphones.CONFIG.MININOVA or
headphones.CONFIG.WAFFLES or
headphones.CONFIG.RUTRACKER or
headphones.CONFIG.WHATCD or
headphones.CONFIG.APOLLO or
headphones.CONFIG.PTH or
headphones.CONFIG.STRIKE)
@@ -1176,7 +1176,7 @@ def verifyresult(title, artistterm, term, lossless):
def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
choose_specific_download=False):
global gazelle # persistent what.cd api object to reduce number of login attempts
global gazelle # persistent apollo.rip api object to reduce number of login attempts
global ruobj # and rutracker
reldate = album['ReleaseDate']
@@ -1468,9 +1468,9 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
if rulist:
resultlist.extend(rulist)
if headphones.CONFIG.WHATCD:
provider = "What.cd"
providerurl = "http://what.cd/"
if headphones.CONFIG.APOLLO:
provider = "Apollo.rip"
providerurl = "http://apollo.rip/"
bitrate = None
bitrate_string = bitrate
@@ -1493,7 +1493,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
bitrate_string = encoding_string
if bitrate_string not in gazelleencoding.ALL_ENCODINGS:
logger.info(
u"Your preferred bitrate is not one of the available What.cd filters, so not using it as a search parameter.")
u"Your preferred bitrate is not one of the available Apollo.rip filters, so not using it as a search parameter.")
maxsize = 10000000000
elif headphones.CONFIG.PREFERRED_QUALITY == 1 or allow_lossless: # Highest quality including lossless
search_formats = [gazelleformat.FLAC, gazelleformat.MP3]
@@ -1504,14 +1504,14 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
if not gazelle or not gazelle.logged_in():
try:
logger.info(u"Attempting to log in to What.cd...")
gazelle = gazelleapi.GazelleAPI(headphones.CONFIG.WHATCD_USERNAME,
headphones.CONFIG.WHATCD_PASSWORD,
headphones.CONFIG.WHATCD_URL)
logger.info(u"Attempting to log in to Apollo.rip...")
gazelle = gazelleapi.GazelleAPI(headphones.CONFIG.APOLLO_USERNAME,
headphones.CONFIG.APOLLO_PASSWORD,
headphones.CONFIG.APOLLO_URL)
gazelle._login()
except Exception as e:
gazelle = None
logger.error(u"What.cd credentials incorrect or site is down. Error: %s %s" % (
logger.error(u"Apollo.rip credentials incorrect or site is down. Error: %s %s" % (
e.__class__.__name__, str(e)))
if gazelle and gazelle.logged_in():
@@ -1593,7 +1593,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None,
bitrate_string = encoding_string
if bitrate_string not in gazelleencoding.ALL_ENCODINGS:
logger.info(
u"Your preferred bitrate is not one of the available What.cd filters, so not using it as a search parameter.")
u"Your preferred bitrate is not one of the available PTH filters, so not using it as a search parameter.")
maxsize = 10000000000
elif headphones.CONFIG.PREFERRED_QUALITY == 1 or allow_lossless: # Highest quality including lossless
search_formats = [gazelleformat.FLAC, gazelleformat.MP3]
@@ -2008,7 +2008,7 @@ def preprocess(resultlist):
if result[3] == 'Kick Ass Torrents':
headers['Referer'] = 'https://torcache.net/'
headers['User-Agent'] = USER_AGENT
elif result[3] == 'What.cd':
elif result[3] == 'Apollo.rip':
headers['User-Agent'] = 'Headphones'
elif result[3] == 'PassTheHeadphones.me':
headers['User-Agent'] = 'Headphones'

View File

@@ -1224,11 +1224,11 @@ class WebInterface(object):
"rutracker_user": headphones.CONFIG.RUTRACKER_USER,
"rutracker_password": headphones.CONFIG.RUTRACKER_PASSWORD,
"rutracker_ratio": headphones.CONFIG.RUTRACKER_RATIO,
"use_whatcd": checked(headphones.CONFIG.WHATCD),
"whatcd_username": headphones.CONFIG.WHATCD_USERNAME,
"whatcd_password": headphones.CONFIG.WHATCD_PASSWORD,
"whatcd_ratio": headphones.CONFIG.WHATCD_RATIO,
"whatcd_url": headphones.CONFIG.WHATCD_URL,
"use_apollo": checked(headphones.CONFIG.APOLLO),
"apollo_username": headphones.CONFIG.APOLLO_USERNAME,
"apollo_password": headphones.CONFIG.APOLLO_PASSWORD,
"apollo_ratio": headphones.CONFIG.APOLLO_RATIO,
"apollo_url": headphones.CONFIG.APOLLO_URL,
"use_pth": checked(headphones.CONFIG.PTH),
"pth_username": headphones.CONFIG.PTH_USERNAME,
"pth_password": headphones.CONFIG.PTH_PASSWORD,
@@ -1435,7 +1435,7 @@ class WebInterface(object):
"use_newznab", "newznab_enabled", "use_torznab", "torznab_enabled",
"use_nzbsorg", "use_omgwtfnzbs", "use_kat", "use_piratebay", "use_oldpiratebay",
"use_mininova", "use_waffles", "use_rutracker",
"use_whatcd", "use_strike", "use_tquattrecentonze", "preferred_bitrate_allow_lossless", "detect_bitrate",
"use_apollo", "use_strike", "use_tquattrecentonze", "preferred_bitrate_allow_lossless", "detect_bitrate",
"ignore_clean_releases", "freeze_db", "cue_split", "move_files",
"rename_files", "correct_metadata", "cleanup_files", "keep_nfo", "add_album_art",
"embed_album_art", "embed_lyrics",