mirror of
https://github.com/moparisthebest/SickRage
synced 2024-10-31 15:35:01 -04:00
Added per-provider options search mode and search fallback.
Search mode allows you to choose season packs only or episodes only which controls how backlogs search for data. Search fallback if selected will attempt a 2nd search this time using the alternative search mode to see if it can get results if the previous attempt failed. Provider settings are now read and stored dynamically instead of always having to retrieve them by there static names, this will allow for dropping in new provider modules easier to intergrate with existing options already present. Fixed search code to not perform dupe searches by mistake. Cache stores a list of shows we have rejected so that next time around we don't have to process them to know we don't like em.
This commit is contained in:
parent
816a3d9572
commit
e96035ff4f
@ -115,8 +115,8 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
|
||||
<span class="component-title jumbo">Configure Provider:</span>
|
||||
<span class="component-desc">
|
||||
#set $provider_config_list = []
|
||||
#for $cur_provider in ("thepiratebay", "tvtorrents", "btn", "torrentleech", "iptorrents", "omgwtfnzbs", "kickasstorrents", "sceneaccess", "hdbits", "nextgen", "speedcd"):
|
||||
#set $cur_provider_obj = $sickbeard.providers.getProviderClass($cur_provider)
|
||||
#for $curProvider in $sickbeard.providers.sortedProviderList():
|
||||
#set $cur_provider_obj = $sickbeard.providers.getProviderClass($curProvider.getID())
|
||||
#if $cur_provider_obj.providerType == $GenericProvider.NZB and not $sickbeard.USE_NZBS:
|
||||
#continue
|
||||
#elif $cur_provider_obj.providerType == $GenericProvider.TORRENT and not $sickbeard.USE_TORRENTS:
|
||||
@ -140,8 +140,9 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
|
||||
|
||||
|
||||
<!-- start div for editing providers //-->
|
||||
#for $curNewznabProvider in [$curProvider for $curProvider in $sickbeard.newznabProviderList if $curProvider.default and $curProvider.needs_auth]:
|
||||
#for $curNewznabProvider in [$curProvider for $curProvider in $sickbeard.newznabProviderList]:
|
||||
<div class="providerDiv" id="${curNewznabProvider.getID()}Div">
|
||||
#if $curProvider.default and $curProvider.needs_auth
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">URL:</span>
|
||||
@ -154,6 +155,34 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
|
||||
<input class="component-desc newznab_key" type="text" id="${curNewznabProvider.getID()}_hash" value="$curNewznabProvider.key" newznab_name="${curNewznabProvider.getID()}_hash" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curNewznabProvider, 'search_fallback'):
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" name="${curNewznabProvider.getID()}_search_fallback" id="${curNewznabProvider.getID()}_search_fallback" #if $curNewznabProvider.search_fallback then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="${curNewznabProvider.getID()}_search_fallback">
|
||||
<span class="component-title">Search Fallback</span>
|
||||
<span class="component-desc">This will restart the search using the alternative method from Search Mode if first attempt fails to return any results to snatch.</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curNewznabProvider, 'search_mode'):
|
||||
<div class="field-pair">
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title">Search Mode</span>
|
||||
<span class="component-desc">
|
||||
<input type="radio" name="${curNewznabProvider.getID()}_search_mode" id="${curNewznabProvider.getID()}_search_mode_sponly" value="sponly" class="radio" #if $curNewznabProvider.search_mode=="sponly" then "checked=\"checked\"" else ""# />Season Packs ONLY!<br />
|
||||
</span>
|
||||
</label>
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title"></span>
|
||||
<span class="component-desc">
|
||||
<input type="radio" name="${curNewznabProvider.getID()}_search_mode" id="${curNewznabProvider.getID()}_search_mode_eponly" value="eponly" class="radio" #if $curNewznabProvider.search_mode=="eponly" then "checked=\"checked\"" else ""# />Episodes ONLY!<br />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
</div>
|
||||
#end for
|
||||
|
||||
@ -172,304 +201,171 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#;
|
||||
</div>
|
||||
</div><!-- /omgwtfnzbsDiv //-->
|
||||
|
||||
<div class="providerDiv" id="ezrssDiv">
|
||||
#for $curTorrentProvider in [$curProvider for $curProvider in $sickbeard.providers.sortedProviderList() if $curProvider.providerType == $GenericProvider.TORRENT]:
|
||||
<div class="providerDiv" id="${curTorrentProvider.getID()}Div">
|
||||
#if $hasattr($curTorrentProvider, 'api_key'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="ezrss_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="ezrss_ratio" id="ezrss_ratio" value="$sickbeard.EZRSS_RATIO" size="40" />
|
||||
<span class="component-title">Api Key:</span>
|
||||
<input class="component-desc" type="text" name="${curTorrentProvider.getID()}_api_key" id="${curTorrentProvider.getID()}_api_key" value="$curTorrentProvider.api_key" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
<div class="providerDiv" id="tvtorrentsDiv">
|
||||
#if $hasattr($curTorrentProvider, 'digest'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Digest:</span>
|
||||
<input class="component-desc" type="text" name="tvtorrents_digest" value="$sickbeard.TVTORRENTS_DIGEST" size="40" />
|
||||
<input class="component-desc" type="text" name="${curTorrentProvider.getID()}_digest" id="${curTorrentProvider.getID()}_digest" value="$curTorrentProvider.digest" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'hash'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Hash:</span>
|
||||
<input class="component-desc" type="text" name="tvtorrents_hash" value="$sickbeard.TVTORRENTS_HASH" size="40" />
|
||||
<input class="component-desc" type="text" name="${curTorrentProvider.getID()}_hash" id="${curTorrentProvider.getID()}_hash" value="$curTorrentProvider.hash" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="tvtorrents_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="tvtorrents_ratio" id="tvtorrents_ratio" value="$sickbeard.TVTORRENTS_RATIO" size="40" />
|
||||
#if $hasattr($curTorrentProvider, 'options'):
|
||||
<div style="width: 340px; padding-bottom: 10px !important;">
|
||||
<input type="hidden" id="tvtorrents_option_string" />
|
||||
<fieldset style="display: block; border-width: 1px !important; border-radius: 5px !important; border-color: #D0D0D0 !important; border-style: solid !important;">
|
||||
<legend id="seed_options">Advanced Options</legend>
|
||||
<div class="field-pair" style="margin-top: -2px !important;">
|
||||
<label class="clearfix" >
|
||||
<span class="component-title" style="width: 130px !important;">Seeding Goal Ratio(%):</span>
|
||||
<input class="seed_option" type="text" id="tvtorrents_seed_ratio" size="5" style="margin-left: -5px !important;"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="providerDiv" id="thepiratebayDiv">
|
||||
<div class="field-pair">
|
||||
<div class="field-pair" style="margin-top: -10px !important;">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="thepiratebay_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="thepiratebay_ratio" id="thepiratebay_ratio" value="$sickbeard.THEPIRATEBAY_RATIO" size="40" />
|
||||
<span class="component-title" style="width: 130px !important;">Seeding Goal Time(h):</span>
|
||||
<input class="seed_option" type="text" id="tvtorrents_seed_time" size="5" style="margin-left: -5px !important;" />
|
||||
</label>
|
||||
</div>
|
||||
<div style="display: block; text-align: center;margin-top: -10px !important;" class="float-left">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" style="margin-left: -49px !important; width: 201px !important;">Process Method:</span>
|
||||
<select class="seed_option" id="tvtorrents_process_method" class="input-medium" >
|
||||
#set $process_method_text = {'': "", 'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"}
|
||||
#for $curAction in ('', 'copy', 'move', 'hardlink', 'symlink'):
|
||||
#set $process_method = ""
|
||||
<option class="seed_option" value="$curAction" $process_method>$process_method_text[$curAction]</option>
|
||||
#end for
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'username'):
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" class="enabler" name="thepiratebay_proxy" id="thepiratebay_proxy" #if $sickbeard.THEPIRATEBAY_PROXY then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Access TPB via Proxy</span>
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="${curTorrentProvider.getID()}_username" id="${curTorrentProvider.getID()}_username" value="$curTorrentProvider.username" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'password'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="${curTorrentProvider.getID()}_password" id="${curTorrentProvider.getID()}_password" value="$curTorrentProvider.password" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'ratio'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="${curTorrentProvider.getID()}_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="${curTorrentProvider.getID()}_ratio" id="${curTorrentProvider.getID()}_ratio" value="$curTorrentProvider.ratio" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'proxy'):
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" class="enabler" name="${curTorrentProvider.getID()}_proxy" id="${curTorrentProvider.getID()}_proxy" #if $curTorrentProvider.proxy then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Access Provider via Proxy</span>
|
||||
<span class="component-desc">To bypass Country Blocking Mechanism</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
<div class="field-pair content_thepiratebay_proxy" id="content_thepiratebay_proxy">
|
||||
#if $hasattr($curTorrentProvider, 'proxy_url'):
|
||||
<div class="field-pair content_${curTorrentProvider.getID()}_proxy" id="content_${curTorrentProvider.getID()}_proxy">
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title">Proxy URL:</span>
|
||||
<span class="component-desc">
|
||||
<select name="thepiratebay_proxy_url" id="thepiratebay_proxy_url">
|
||||
#for $i in $thepiratebay.proxy_dict.keys():
|
||||
<option value="$thepiratebay.proxy_dict[$i]" #if $thepiratebay.proxy_dict[$i] == $sickbeard.THEPIRATEBAY_PROXY_URL then "selected=\"selected\"" else ""#>$i</option>
|
||||
<select name="${curTorrentProvider.getID()}_proxy_url" id="${curTorrentProvider.getID()}_proxy_url">
|
||||
#for $i in $curTorrentProvider.proxy_dict.keys():
|
||||
<option value="$curTorrentProvider.proxy_dict[$i]" #if $curTorrentProvider.proxy_dict[$i] == $curTorrentProvider.proxy_url then "selected=\"selected\"" else ""#>$i</option>
|
||||
#end for
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'confirmed'):
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" name="thepiratebay_trusted" id="thepiratebay_trusted" #if $sickbeard.THEPIRATEBAY_TRUSTED then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="thepiratebay_trusted">
|
||||
<span class="component-title">Trusted Download</span>
|
||||
<span class="component-desc">Download torrent only from trusted uploaders?</span>
|
||||
<input type="checkbox" name="${curTorrentProvider.getID()}_confirmed" id="${curTorrentProvider.getID()}_confirmed" #if $curTorrentProvider.confirmed then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="${curTorrentProvider.getID()}_confirmed">
|
||||
<span class="component-title">Confirmed Download</span>
|
||||
<span class="component-desc">Download torrent only from trusted/verified uploaders?</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
#end if
|
||||
|
||||
<div class="providerDiv" id="kickasstorrentsDiv">
|
||||
#if $hasattr($curTorrentProvider, 'freeleech'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="kat_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="kat_ratio" id="kat_ratio" value="$sickbeard.KAT_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" name="kat_verified" id="kat_verified" #if $sickbeard.KAT_VERIFIED then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="kat_verified">
|
||||
<span class="component-title">Verified Only</span>
|
||||
<span class="component-desc">Download only verified torrent?</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="providerDiv" id="publichdDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="publichd_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="publichd_ratio" id="publichd_ratio" value="$sickbeard.PUBLICHD_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="providerDiv btn" id="btnDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Api Key:</span>
|
||||
<input class="component-desc" type="text" name="btn_api_key" value="$sickbeard.BTN_API_KEY" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="btn_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="btn_ratio" id="btn_ratio" value="$sickbeard.BTN_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="providerDiv" id="torrentleechDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="torrentleech_username" value="$sickbeard.TORRENTLEECH_USERNAME" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="torrentleech_password" value="$sickbeard.TORRENTLEECH_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="torrentleech_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="torrentleech_ratio" id="torrentleech_ratio" value="$sickbeard.TORRENTLEECH_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="providerDiv" id="iptorrentsDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="iptorrents_username" value="$sickbeard.IPTORRENTS_USERNAME" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="iptorrents_password" value="$sickbeard.IPTORRENTS_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="iptorrents_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="iptorrents_ratio" id="iptorrents_ratio" value="$sickbeard.IPTORRENTS_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" name="iptorrents_freeleech" id="iptorrents_freeleech" #if $sickbeard.IPTORRENTS_FREELEECH then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="iptorrents_freeleech">
|
||||
<input type="checkbox" name="${curTorrentProvider.getID()}_freeleech" id="${curTorrentProvider.getID()}_freeleech" #if $curTorrentProvider.freeleech then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="${curTorrentProvider.getID()}_freeleech">
|
||||
<span class="component-title">FreeLeech</span>
|
||||
<span class="component-desc">This will only download <b>[FreeLeech]</b> torrents.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /iptorrentsDiv //-->
|
||||
#end if
|
||||
|
||||
<div class="providerDiv" id="sceneaccessDiv">
|
||||
#if $hasattr($curTorrentProvider, 'search_fallback'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="scc_username" value="$sickbeard.SCC_USERNAME" size="40" />
|
||||
<input type="checkbox" name="${curTorrentProvider.getID()}_search_fallback" id="${curTorrentProvider.getID()}_search_fallback" #if $curTorrentProvider.search_fallback then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="${curTorrentProvider.getID()}_search_fallback">
|
||||
<span class="component-title">Search Fallback</span>
|
||||
<span class="component-desc">This will restart the search using the alternative method from Search Mode if first attempt fails to return any results to snatch.</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="scc_password" value="$sickbeard.SCC_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="scc_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="scc_ratio" id="scc_ratio" value="$sickbeard.SCC_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /sceneaccessDiv //-->
|
||||
#end if
|
||||
|
||||
<div class="providerDiv" id="hdtorrentsDiv">
|
||||
#if $hasattr($curTorrentProvider, 'search_mode'):
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="hdtorrents_username" value="$sickbeard.HDTORRENTS_USERNAME" size="40" />
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title">Search Mode</span>
|
||||
<span class="component-desc">
|
||||
<input type="radio" name="${curTorrentProvider.getID()}_search_mode" id="${curTorrentProvider.getID()}_search_mode_sponly" value="sponly" class="radio" #if $curTorrentProvider.search_mode=="sponly" then "checked=\"checked\"" else ""# />Season Packs ONLY!<br />
|
||||
</span>
|
||||
</label>
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title"></span>
|
||||
<span class="component-desc">
|
||||
<input type="radio" name="${curTorrentProvider.getID()}_search_mode" id="${curTorrentProvider.getID()}_search_mode_eponly" value="eponly" class="radio" #if $curTorrentProvider.search_mode=="eponly" then "checked=\"checked\"" else ""# />Episodes ONLY!<br />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="hdtorrents_password" value="$sickbeard.HDTORRENTS_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="hdtorrents_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="hdtorrents_ratio" id="hdtorrents_ratio" value="$sickbeard.HDTORRENTS_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /sceneaccessDiv //-->
|
||||
#end if
|
||||
|
||||
<div class="providerDiv" id="torrentdayDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="torrentday_username" value="$sickbeard.TORRENTDAY_USERNAME" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="torrentday_password" value="$sickbeard.TORRENTDAY_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="torrentday_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="torrentday_ratio" id="torrentday_ratio" value="$sickbeard.TORRENTDAY_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" name="torrentday_freeleech" id="torrentday_freeleech" #if $sickbeard.TORRENTDAY_FREELEECH then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="torrentday_freeleech">
|
||||
<span class="component-title">FreeLeech</span>
|
||||
<span class="component-desc">This will only download <b>[FreeLeech]</b> torrents.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /torrentsDayDiv //-->
|
||||
|
||||
<div class="providerDiv" id="nextgenDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="nextgen_username" value="$sickbeard.NEXTGEN_USERNAME" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="nextgen_password" value="$sickbeard.NEXTGEN_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="nextgen_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="nextgen_ratio" id="nextgen_ratio" value="$sickbeard.NEXTGEN_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /nextgenDiv //-->
|
||||
</div>
|
||||
#end for
|
||||
|
||||
<div class="providerDiv" id="hdbitsDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="hdbits_username" value="$sickbeard.HDBITS_USERNAME" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Passkey:</span>
|
||||
<input class="component-desc" type="text" name="hdbits_passkey" value="$sickbeard.HDBITS_PASSKEY" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="hdbits_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="hdbits_ratio" id="hdbits_ratio" value="$sickbeard.HDBITS_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /hdbitsDiv //-->
|
||||
|
||||
<div class="providerDiv" id="speedcdDiv">
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Username:</span>
|
||||
<input class="component-desc" type="text" name="speedcd_username" value="$sickbeard.SPEEDCD_USERNAME" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title">Password:</span>
|
||||
<input class="component-desc" type="password" name="speedcd_password" value="$sickbeard.SPEEDCD_PASSWORD" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label class="clearfix">
|
||||
<span class="component-title" id="speedcd_ratio_desc">Seed Ratio:</span>
|
||||
<input type="text" name="speedcd_ratio" id="speedcd_ratio" value="$sickbeard.SPEEDCD_RATIO" size="40" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<input type="checkbox" name="speedcd_freeleech" id="speedcd_freeleech" #if $sickbeard.SPEEDCD_FREELEECH then "checked=\"checked\"" else ""#/>
|
||||
<label class="clearfix" for="iptorrents_freeleech">
|
||||
<span class="component-title">FreeLeech</span>
|
||||
<span class="component-desc">This will only download <b>[FreeLeech]</b> torrents.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /speedcdDiv //-->
|
||||
|
||||
<!-- end div for editing providers -->
|
||||
|
||||
|
@ -63,10 +63,12 @@ $(document).ready(function(){
|
||||
|
||||
}
|
||||
|
||||
$.fn.updateProvider = function (id, url, key) {
|
||||
$.fn.updateProvider = function (id, url, key, search_mode, search_fallback) {
|
||||
|
||||
newznabProviders[id][1][1] = url;
|
||||
newznabProviders[id][1][2] = key;
|
||||
newznabProviders[id][1][3] = search_mode;
|
||||
newznabProviders[id][1][4] = search_fallback;
|
||||
|
||||
$(this).populateNewznabSection();
|
||||
|
||||
@ -297,8 +299,10 @@ $(document).ready(function(){
|
||||
|
||||
var url = $('#'+provider_id+'_url').val();
|
||||
var key = $(this).val();
|
||||
var search_mode = $('#'+provider_id+'_search_mode').val();
|
||||
var search_fallback = $('#'+provider_id+'_search_fallback').val();
|
||||
|
||||
$(this).updateProvider(provider_id, url, key);
|
||||
$(this).updateProvider(provider_id, url, key, search_mode, search_fallback);
|
||||
|
||||
});
|
||||
|
||||
@ -311,8 +315,10 @@ $(document).ready(function(){
|
||||
|
||||
var url = $('#newznab_url').val();
|
||||
var key = $('#newznab_key').val();
|
||||
var search_mode = 'eponly';
|
||||
var search_fallback = 0;
|
||||
|
||||
$(this).updateProvider(selectedProvider, url, key);
|
||||
$(this).updateProvider(selectedProvider, url, key, search_mode, search_fallback);
|
||||
|
||||
});
|
||||
|
||||
|
@ -30,9 +30,11 @@ from threading import Lock
|
||||
|
||||
# apparently py2exe won't build these unless they're imported somewhere
|
||||
from sickbeard import providers, metadata, config
|
||||
from sickbeard.providers.generic import GenericProvider
|
||||
from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, publichd, iptorrents, \
|
||||
omgwtfnzbs, scc, hdtorrents, torrentday, hdbits, nextgen, speedcd
|
||||
from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, naming_ep_type
|
||||
from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, \
|
||||
naming_ep_type
|
||||
from sickbeard import searchBacklog, showUpdater, versionChecker, properFinder, autoPostProcesser, \
|
||||
subtitles, traktWatchListChecker
|
||||
from sickbeard import helpers, db, exceptions, show_queue, search_queue, scheduler, show_name_helpers
|
||||
@ -191,83 +193,6 @@ MIN_UPDATE_FREQUENCY = 1
|
||||
DEFAULT_SEARCH_FREQUENCY = 40
|
||||
DEFAULT_UPDATE_FREQUENCY = 12
|
||||
|
||||
EZRSS = False
|
||||
EZRSS_RATIO = None
|
||||
|
||||
TVTORRENTS = False
|
||||
TVTORRENTS_DIGEST = None
|
||||
TVTORRENTS_HASH = None
|
||||
TVTORRENTS_RATIO = None
|
||||
|
||||
BTN = False
|
||||
BTN_API_KEY = None
|
||||
BTN_RATIO = None
|
||||
|
||||
NEWZNAB_DATA = None
|
||||
|
||||
THEPIRATEBAY = False
|
||||
THEPIRATEBAY_RATIO = None
|
||||
THEPIRATEBAY_TRUSTED = False
|
||||
THEPIRATEBAY_PROXY = False
|
||||
THEPIRATEBAY_PROXY_URL = None
|
||||
THEPIRATEBAY_BLACKLIST = None
|
||||
|
||||
TORRENTLEECH = False
|
||||
TORRENTLEECH_KEY = None
|
||||
TORRENTLEECH_USERNAME = None
|
||||
TORRENTLEECH_PASSWORD = None
|
||||
TORRENTLEECH_RATIO = None
|
||||
|
||||
IPTORRENTS = False
|
||||
IPTORRENTS_USERNAME = None
|
||||
IPTORRENTS_PASSWORD = None
|
||||
IPTORRENTS_RATIO = None
|
||||
IPTORRENTS_FREELEECH = False
|
||||
|
||||
NEXTGEN = False
|
||||
NEXTGEN_USERNAME = None
|
||||
NEXTGEN_PASSWORD = None
|
||||
NEXTGEN_RATIO = None
|
||||
NEXTGEN_FREELEECH = False
|
||||
|
||||
KAT = None
|
||||
KAT_RATIO = None
|
||||
KAT_VERIFIED = False
|
||||
|
||||
PUBLICHD = None
|
||||
PUBLICHD_RATIO = None
|
||||
|
||||
SCC = False
|
||||
SCC_USERNAME = None
|
||||
SCC_PASSWORD = None
|
||||
SCC_RATIO = None
|
||||
|
||||
HDTORRENTS = False
|
||||
HDTORRENTS_USERNAME = None
|
||||
HDTORRENTS_PASSWORD = None
|
||||
HDTORRENTS_RATIO = None
|
||||
HDTORRENTS_UID = None
|
||||
HDTORRENTS_HASH = None
|
||||
|
||||
TORRENTDAY = None
|
||||
TORRENTDAY_USERNAME = None
|
||||
TORRENTDAY_PASSWORD = None
|
||||
TORRENTDAY_RATIO = None
|
||||
TORRENTDAY_UID = None
|
||||
TORRENTDAY_HASH = None
|
||||
TORRENTDAY_FREELEECH = None
|
||||
|
||||
HDBITS = False
|
||||
HDBITS_USERNAME = None
|
||||
HDBITS_PASSKEY = None
|
||||
HDBITS_RATIO = None
|
||||
|
||||
SPEEDCD = False
|
||||
SPEEDCD_USERNAME = None
|
||||
SPEEDCD_PASSWORD = None
|
||||
SPEEDCD_RATIO = None
|
||||
SPEEDCD_FREELEECH = None
|
||||
|
||||
ADD_SHOWS_WO_DIR = None
|
||||
CREATE_MISSING_SHOW_DIRS = None
|
||||
RENAME_EPISODES = False
|
||||
@ -502,12 +427,7 @@ def initialize(consoleLogging=True):
|
||||
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \
|
||||
PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, \
|
||||
showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \
|
||||
NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, EZRSS, TVTORRENTS, TVTORRENTS_DIGEST, TVTORRENTS_HASH, TVTORRENTS_OPTIONS, BTN, BTN_API_KEY, BTN_OPTIONS, \
|
||||
THEPIRATEBAY, THEPIRATEBAY_TRUSTED, THEPIRATEBAY_PROXY, THEPIRATEBAY_PROXY_URL, THEPIRATEBAY_BLACKLIST, THEPIRATEBAY_OPTIONS, TORRENTLEECH, TORRENTLEECH_USERNAME, TORRENTLEECH_PASSWORD, TORRENTLEECH_OPTIONS, \
|
||||
IPTORRENTS, IPTORRENTS_USERNAME, IPTORRENTS_PASSWORD, IPTORRENTS_FREELEECH, IPTORRENTS_OPTIONS, KAT, KAT_VERIFIED, KAT_OPTIONS, PUBLICHD, PUBLICHD_OPTIONS, SCC, SCC_USERNAME, SCC_PASSWORD, SCC_OPTIONS, HDTORRENTS, HDTORRENTS_USERNAME, HDTORRENTS_PASSWORD, HDTORRENTS_UID, HDTORRENTS_HASH, HDTORRENTS_OPTIONS, TORRENTDAY, TORRENTDAY_USERNAME, TORRENTDAY_PASSWORD, TORRENTDAY_UID, TORRENTDAY_HASH, TORRENTDAY_FREELEECH, TORRENTDAY_OPTIONS, \
|
||||
HDBITS, HDBITS_USERNAME, HDBITS_PASSKEY, HDBITS_OPTIONS, TORRENT_DIR, USENET_RETENTION, SOCKET_TIMEOUT, RSSUPDATE_FREQUENCY, DEFAULT_SEARCH_FREQUENCY, BACKLOG_FREQUENCY, BACKLOG_STARTUP, INDEXER_DEFAULT, RSSUPDATE_STARTUP, \
|
||||
NEXTGEN, NEXTGEN_USERNAME, NEXTGEN_PASSWORD, NEXTGEN_FREELEECH, NEXTGEN_OPTIONS, SPEEDCD, SPEEDCD_USERNAME, SPEEDCD_PASSWORD, SPEEDCD_FREELEECH, \
|
||||
EZRSS_RATIO, TVTORRENTS_RATIO, BTN_RATIO, THEPIRATEBAY_RATIO, TORRENTLEECH_RATIO, IPTORRENTS_RATIO, KAT_RATIO, PUBLICHD_RATIO, TORRENTDAY_RATIO, SCC_RATIO, HDTORRENTS_RATIO, HDBITS_RATIO, NEXTGEN_RATIO, SPEEDCD_RATIO, \
|
||||
NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH,\
|
||||
QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, \
|
||||
GROWL_NOTIFY_ONSNATCH, GROWL_NOTIFY_ONDOWNLOAD, GROWL_NOTIFY_ONSUBTITLEDOWNLOAD, TWITTER_NOTIFY_ONSNATCH, TWITTER_NOTIFY_ONDOWNLOAD, TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD, \
|
||||
USE_GROWL, GROWL_HOST, GROWL_PASSWORD, USE_PROWL, PROWL_NOTIFY_ONSNATCH, PROWL_NOTIFY_ONDOWNLOAD, PROWL_NOTIFY_ONSUBTITLEDOWNLOAD, PROWL_API, PROWL_PRIORITY, PROG_DIR, \
|
||||
@ -709,89 +629,6 @@ def initialize(consoleLogging=True):
|
||||
CREATE_MISSING_SHOW_DIRS = check_setting_int(CFG, 'General', 'create_missing_show_dirs', 0)
|
||||
ADD_SHOWS_WO_DIR = check_setting_int(CFG, 'General', 'add_shows_wo_dir', 0)
|
||||
|
||||
EZRSS = bool(check_setting_int(CFG, 'General', 'use_torrent', 0))
|
||||
if not EZRSS:
|
||||
EZRSS = bool(check_setting_int(CFG, 'EZRSS', 'ezrss', 0))
|
||||
EZRSS_RATIO = check_setting_float(CFG, 'EZRSS', 'ezrss_ratio', 0)
|
||||
|
||||
TVTORRENTS = bool(check_setting_int(CFG, 'TVTORRENTS', 'tvtorrents', 0))
|
||||
TVTORRENTS_DIGEST = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_digest', '')
|
||||
TVTORRENTS_HASH = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_hash', '')
|
||||
TVTORRENTS_RATIO = check_setting_float(CFG, 'TVTORRENTS', 'tvtorrents_ratio', 0)
|
||||
TVTORRENTS_OPTIONS = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_options', '')
|
||||
|
||||
BTN = bool(check_setting_int(CFG, 'BTN', 'btn', 0))
|
||||
BTN_API_KEY = check_setting_str(CFG, 'BTN', 'btn_api_key', '')
|
||||
BTN_RATIO = check_setting_float(CFG, 'BTN', 'btn_ratio', 0)
|
||||
BTN_OPTIONS = check_setting_str(CFG, 'BTN', 'btn_options', '')
|
||||
|
||||
THEPIRATEBAY = bool(check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay', 1))
|
||||
THEPIRATEBAY_RATIO = check_setting_float(CFG, 'THEPIRATEBAY', 'thepiratebay_ratio', 0)
|
||||
THEPIRATEBAY_TRUSTED = bool(check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay_trusted', 1))
|
||||
THEPIRATEBAY_PROXY = bool(check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay_proxy', 0))
|
||||
THEPIRATEBAY_PROXY_URL = check_setting_str(CFG, 'THEPIRATEBAY', 'thepiratebay_proxy_url', '')
|
||||
THEPIRATEBAY_BLACKLIST = check_setting_str(CFG, 'THEPIRATEBAY', 'thepiratebay_blacklist', '')
|
||||
THEPIRATEBAY_OPTIONS = check_setting_str(CFG, 'THEPIRATEBAY', 'thepiratebay_options', '')
|
||||
|
||||
TORRENTLEECH = bool(check_setting_int(CFG, 'TORRENTLEECH', 'torrentleech', 0))
|
||||
TORRENTLEECH_USERNAME = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_username', '')
|
||||
TORRENTLEECH_PASSWORD = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_password', '')
|
||||
TORRENTLEECH_RATIO = check_setting_float(CFG, 'TORRENTLEECH', 'torrentleech_ratio', 0)
|
||||
TORRENTLEECH_OPTIONS = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_options', '')
|
||||
|
||||
IPTORRENTS = bool(check_setting_int(CFG, 'IPTORRENTS', 'iptorrents', 0))
|
||||
IPTORRENTS_USERNAME = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_username', '')
|
||||
IPTORRENTS_PASSWORD = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_password', '')
|
||||
IPTORRENTS_RATIO = check_setting_float(CFG, 'IPTORRENTS', 'iptorrents_ratio', 0)
|
||||
IPTORRENTS_FREELEECH = bool(check_setting_int(CFG, 'IPTORRENTS', 'iptorrents_freeleech', 0))
|
||||
IPTORRENTS_OPTIONS = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_options', '')
|
||||
|
||||
NEXTGEN = bool(check_setting_int(CFG, 'NEXTGEN', 'nextgen', 0))
|
||||
NEXTGEN_USERNAME = check_setting_str(CFG, 'NEXTGEN', 'nextgen_username', '')
|
||||
NEXTGEN_PASSWORD = check_setting_str(CFG, 'NEXTGEN', 'nextgen_password', '')
|
||||
NEXTGEN_RATIO = check_setting_float(CFG, 'NEXTGEN', 'nextgen_ratio', 0)
|
||||
NEXTGEN_OPTIONS = check_setting_str(CFG, 'NEXTGEN', 'nextgen_options', '')
|
||||
|
||||
KAT = bool(check_setting_int(CFG, 'KAT', 'kat', 0))
|
||||
KAT_RATIO = check_setting_float(CFG, 'KAT', 'kat_ratio', 0)
|
||||
KAT_VERIFIED = bool(check_setting_int(CFG, 'KAT', 'kat_verified', 1))
|
||||
KAT_OPTIONS = check_setting_str(CFG, 'KAT', 'kat_options', '')
|
||||
|
||||
PUBLICHD = bool(check_setting_int(CFG, 'PUBLICHD', 'publichd', 0))
|
||||
PUBLICHD_RATIO = check_setting_float(CFG, 'PUBLICHD', 'publichd_ratio', 0)
|
||||
PUBLICHD_OPTIONS = check_setting_str(CFG, 'PUBLICHD', 'publichd_options', '')
|
||||
|
||||
SCC = bool(check_setting_int(CFG, 'SCC', 'scc', 0))
|
||||
SCC_USERNAME = check_setting_str(CFG, 'SCC', 'scc_username', '')
|
||||
SCC_PASSWORD = check_setting_str(CFG, 'SCC', 'scc_password', '')
|
||||
SCC_RATIO = check_setting_float(CFG, 'SCC', 'scc_ratio', 0)
|
||||
SCC_OPTIONS = check_setting_str(CFG, 'SCC', 'scc_options', '')
|
||||
|
||||
HDTORRENTS = bool(check_setting_int(CFG, 'HDTORRENTS', 'hdtorrents', 0))
|
||||
HDTORRENTS_USERNAME = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_username', '')
|
||||
HDTORRENTS_PASSWORD = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_password', '')
|
||||
HDTORRENTS_RATIO = check_setting_float(CFG, 'HDTORRENTS', 'hdtorrents_ratio', 0)
|
||||
HDTORRENTS_OPTIONS = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_options', '')
|
||||
|
||||
TORRENTDAY = bool(check_setting_int(CFG, 'TORRENTDAY', 'torrentday', 0))
|
||||
TORRENTDAY_USERNAME = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_username', '')
|
||||
TORRENTDAY_PASSWORD = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_password', '')
|
||||
TORRENTDAY_RATIO = check_setting_float(CFG, 'TORRENTDAY', 'torrentday_ratio', 0)
|
||||
TORRENTDAY_FREELEECH = bool(check_setting_int(CFG, 'TORRENTDAY', 'torrentday_freeleech', 0))
|
||||
TORRENTDAY_OPTIONS = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_options', '')
|
||||
|
||||
HDBITS = bool(check_setting_int(CFG, 'HDBITS', 'hdbits', 0))
|
||||
HDBITS_USERNAME = check_setting_str(CFG, 'HDBITS', 'hdbits_username', '')
|
||||
HDBITS_PASSKEY = check_setting_str(CFG, 'HDBITS', 'hdbits_passkey', '')
|
||||
HDBITS_RATIO = check_setting_float(CFG, 'HDBITS', 'hdbits_ratio', 0)
|
||||
HDBITS_OPTIONS = check_setting_str(CFG, 'HDBITS', 'hdbits_options', '')
|
||||
|
||||
SPEEDCD = bool(check_setting_int(CFG, 'SPEEDCD', 'speedcd', 0))
|
||||
SPEEDCD_USERNAME = check_setting_str(CFG, 'SPEEDCD', 'speedcd_username', '')
|
||||
SPEEDCD_PASSWORD = check_setting_str(CFG, 'SPEEDCD', 'speedcd_password', '')
|
||||
SPEEDCD_RATIO = check_setting_float(CFG, 'SPEEDCD', 'speedcd_ratio', 0)
|
||||
SPEEDCD_FREELEECH = bool(check_setting_int(CFG, 'SPEEDCD', 'speedcd_freeleech', 0))
|
||||
|
||||
NZBS = bool(check_setting_int(CFG, 'NZBs', 'nzbs', 0))
|
||||
NZBS_UID = check_setting_str(CFG, 'NZBs', 'nzbs_uid', '')
|
||||
NZBS_HASH = check_setting_str(CFG, 'NZBs', 'nzbs_hash', '')
|
||||
@ -1123,10 +960,10 @@ def initialize(consoleLogging=True):
|
||||
runImmediately=BACKLOG_STARTUP)
|
||||
|
||||
dailySearchScheduler = scheduler.Scheduler(dailysearcher.DailySearcher(),
|
||||
cycleTime=datetime.timedelta(minutes=DAILYSEARCH_FREQUENCY),
|
||||
threadName="DAILYSEARCHER",
|
||||
silent=True,
|
||||
runImmediately=True)
|
||||
cycleTime=datetime.timedelta(minutes=DAILYSEARCH_FREQUENCY),
|
||||
threadName="DAILYSEARCHER",
|
||||
silent=True,
|
||||
runImmediately=True)
|
||||
|
||||
subtitlesFinderScheduler = scheduler.Scheduler(subtitles.SubtitlesFinder(),
|
||||
cycleTime=datetime.timedelta(hours=SUBTITLES_FINDER_FREQUENCY),
|
||||
@ -1145,6 +982,70 @@ def initialize(consoleLogging=True):
|
||||
showList = []
|
||||
loadingShowList = {}
|
||||
|
||||
# dynamically load provider settings
|
||||
for curTorrentProvider in [curProvider for curProvider in providers.sortedProviderList() if
|
||||
curProvider.providerType == GenericProvider.TORRENT]:
|
||||
curTorrentProvider.enabled = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID(), 0))
|
||||
|
||||
if hasattr(curTorrentProvider, 'api_key'):
|
||||
curTorrentProvider.api_key = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_api_key', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'hash'):
|
||||
curTorrentProvider.hash = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_hash', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'digest'):
|
||||
curTorrentProvider.digest = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_digest', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'username'):
|
||||
curTorrentProvider.username = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_username', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'password'):
|
||||
curTorrentProvider.password = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_password', '') or \
|
||||
check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_passkey', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'proxy'):
|
||||
curTorrentProvider.proxy = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_proxy', 0))
|
||||
|
||||
if hasattr(curTorrentProvider, 'proxy_url'):
|
||||
curTorrentProvider.proxy_url = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_proxy_url', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'confirmed'):
|
||||
curTorrentProvider.confirmed = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_confirmed', 0)) or \
|
||||
bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_trusted', 0)) or \
|
||||
bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_verified', 0))
|
||||
|
||||
if hasattr(curTorrentProvider, 'options'):
|
||||
curTorrentProvider.options = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_options', '')
|
||||
|
||||
if hasattr(curTorrentProvider, 'ratio'):
|
||||
curTorrentProvider.ratio = float(check_setting_float(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_ratio', 0))
|
||||
|
||||
if hasattr(curTorrentProvider, 'freeleech'):
|
||||
curTorrentProvider.freeleech = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_freeleech', 0))
|
||||
|
||||
if hasattr(curTorrentProvider, 'search_mode'):
|
||||
curTorrentProvider.search_mode = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_search_mode', 'eponly')
|
||||
|
||||
if hasattr(curTorrentProvider, 'search_fallback'):
|
||||
curTorrentProvider.search_fallback = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
||||
curTorrentProvider.getID() + '_search_mode', 0))
|
||||
|
||||
try:
|
||||
url = 'http://raw.github.com/echel0n/sickrage-init/master/settings.ini'
|
||||
clear_cache = ElementTree.XML(helpers.getURL(url)).find('cache/clear').text
|
||||
@ -1154,7 +1055,8 @@ def initialize(consoleLogging=True):
|
||||
curProvider.cache._clearCache()
|
||||
CLEAR_CACHE = clear_cache
|
||||
save_config()
|
||||
except:pass
|
||||
except:
|
||||
pass
|
||||
|
||||
__INITIALIZED__ = True
|
||||
return True
|
||||
@ -1312,11 +1214,13 @@ def remove_pid_file(PIDFILE):
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def sig_handler(signum=None, frame=None):
|
||||
if type(signum) != type(None):
|
||||
logger.log(u"Signal %i caught, saving and exiting..." % int(signum))
|
||||
saveAndShutdown()
|
||||
|
||||
|
||||
def saveAll():
|
||||
global showList
|
||||
|
||||
@ -1494,100 +1398,37 @@ def save_config():
|
||||
new_config['Blackhole']['nzb_dir'] = NZB_DIR
|
||||
new_config['Blackhole']['torrent_dir'] = TORRENT_DIR
|
||||
|
||||
new_config['EZRSS'] = {}
|
||||
new_config['EZRSS']['ezrss'] = int(EZRSS)
|
||||
new_config['EZRSS']['ezrss_ratio'] = float(EZRSS_RATIO)
|
||||
|
||||
new_config['TVTORRENTS'] = {}
|
||||
new_config['TVTORRENTS']['tvtorrents'] = int(TVTORRENTS)
|
||||
new_config['TVTORRENTS']['tvtorrents_digest'] = TVTORRENTS_DIGEST
|
||||
new_config['TVTORRENTS']['tvtorrents_hash'] = TVTORRENTS_HASH
|
||||
new_config['TVTORRENTS']['tvtorrents_ratio'] = float(TVTORRENTS_RATIO)
|
||||
new_config['TVTORRENTS']['tvtorrents_options'] = TVTORRENTS_OPTIONS
|
||||
|
||||
new_config['BTN'] = {}
|
||||
new_config['BTN']['btn'] = int(BTN)
|
||||
new_config['BTN']['btn_api_key'] = BTN_API_KEY
|
||||
new_config['BTN']['btn_ratio'] = float(BTN_RATIO)
|
||||
new_config['BTN']['btn_options'] = BTN_OPTIONS
|
||||
|
||||
new_config['THEPIRATEBAY'] = {}
|
||||
new_config['THEPIRATEBAY']['thepiratebay'] = int(THEPIRATEBAY)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_ratio'] = float(THEPIRATEBAY_RATIO)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_trusted'] = int(THEPIRATEBAY_TRUSTED)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_proxy'] = int(THEPIRATEBAY_PROXY)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_proxy_url'] = THEPIRATEBAY_PROXY_URL
|
||||
new_config['THEPIRATEBAY']['thepiratebay_blacklist'] = THEPIRATEBAY_BLACKLIST
|
||||
new_config['THEPIRATEBAY']['thepiratebay_options'] = THEPIRATEBAY_OPTIONS
|
||||
|
||||
new_config['TORRENTLEECH'] = {}
|
||||
new_config['TORRENTLEECH']['torrentleech'] = int(TORRENTLEECH)
|
||||
new_config['TORRENTLEECH']['torrentleech_username'] = TORRENTLEECH_USERNAME
|
||||
new_config['TORRENTLEECH']['torrentleech_password'] = helpers.encrypt(TORRENTLEECH_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['TORRENTLEECH']['torrentleech_ratio'] = float(TORRENTLEECH_RATIO)
|
||||
new_config['TORRENTLEECH']['torrentleech_options'] = TORRENTLEECH_OPTIONS
|
||||
|
||||
new_config['IPTORRENTS'] = {}
|
||||
new_config['IPTORRENTS']['iptorrents'] = int(IPTORRENTS)
|
||||
new_config['IPTORRENTS']['iptorrents_username'] = IPTORRENTS_USERNAME
|
||||
new_config['IPTORRENTS']['iptorrents_password'] = helpers.encrypt(IPTORRENTS_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['IPTORRENTS']['iptorrents_ratio'] = float(IPTORRENTS_RATIO)
|
||||
new_config['IPTORRENTS']['iptorrents_freeleech'] = int(IPTORRENTS_FREELEECH)
|
||||
new_config['IPTORRENTS']['iptorrents_options'] = IPTORRENTS_OPTIONS
|
||||
|
||||
new_config['NEXTGEN'] = {}
|
||||
new_config['NEXTGEN']['nextgen'] = int(NEXTGEN)
|
||||
new_config['NEXTGEN']['nextgen_username'] = NEXTGEN_USERNAME
|
||||
new_config['NEXTGEN']['nextgen_password'] = helpers.encrypt(NEXTGEN_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['NEXTGEN']['nextgen_ratio'] = float(NEXTGEN_RATIO)
|
||||
new_config['NEXTGEN']['nextgen_options'] = NEXTGEN_OPTIONS
|
||||
|
||||
new_config['KAT'] = {}
|
||||
new_config['KAT']['kat'] = int(KAT)
|
||||
new_config['KAT']['kat_ratio'] = float(KAT_RATIO)
|
||||
new_config['KAT']['kat_verified'] = int(KAT_VERIFIED)
|
||||
new_config['KAT']['kat_options'] = KAT_OPTIONS
|
||||
|
||||
new_config['PUBLICHD'] = {}
|
||||
new_config['PUBLICHD']['publichd'] = int(PUBLICHD)
|
||||
new_config['PUBLICHD']['publichd_ratio'] = float(PUBLICHD_RATIO)
|
||||
new_config['PUBLICHD']['publichd_options'] = PUBLICHD_OPTIONS
|
||||
|
||||
new_config['SCC'] = {}
|
||||
new_config['SCC']['scc'] = int(SCC)
|
||||
new_config['SCC']['scc_username'] = SCC_USERNAME
|
||||
new_config['SCC']['scc_password'] = helpers.encrypt(SCC_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['SCC']['scc_ratio'] = float(SCC_RATIO)
|
||||
new_config['SCC']['scc_options'] = SCC_OPTIONS
|
||||
|
||||
new_config['HDTORRENTS'] = {}
|
||||
new_config['HDTORRENTS']['hdtorrents'] = int(HDTORRENTS)
|
||||
new_config['HDTORRENTS']['hdtorrents_username'] = HDTORRENTS_USERNAME
|
||||
new_config['HDTORRENTS']['hdtorrents_password'] = helpers.encrypt(HDTORRENTS_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['HDTORRENTS']['hdtorrents_ratio'] = float(HDTORRENTS_RATIO)
|
||||
new_config['HDTORRENTS']['hdtorrents_options'] = HDTORRENTS_OPTIONS
|
||||
|
||||
new_config['TORRENTDAY'] = {}
|
||||
new_config['TORRENTDAY']['torrentday'] = int(TORRENTDAY)
|
||||
new_config['TORRENTDAY']['torrentday_username'] = TORRENTDAY_USERNAME
|
||||
new_config['TORRENTDAY']['torrentday_password'] = helpers.encrypt(TORRENTDAY_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['TORRENTDAY']['torrentday_ratio'] = float(TORRENTDAY_RATIO)
|
||||
new_config['TORRENTDAY']['torrentday_freeleech'] = int(TORRENTDAY_FREELEECH)
|
||||
new_config['TORRENTDAY']['torrentday_options'] = TORRENTDAY_OPTIONS
|
||||
|
||||
new_config['HDBITS'] = {}
|
||||
new_config['HDBITS']['hdbits'] = int(HDBITS)
|
||||
new_config['HDBITS']['hdbits_username'] = HDBITS_USERNAME
|
||||
new_config['HDBITS']['hdbits_passkey'] = HDBITS_PASSKEY
|
||||
new_config['HDBITS']['hdbits_ratio'] = float(HDBITS_RATIO)
|
||||
new_config['HDBITS']['hdbits_options'] = HDBITS_OPTIONS
|
||||
|
||||
new_config['SPEEDCD'] = {}
|
||||
new_config['SPEEDCD']['speedcd'] = int(SPEEDCD)
|
||||
new_config['SPEEDCD']['speedcd_username'] = SPEEDCD_USERNAME
|
||||
new_config['SPEEDCD']['speedcd_password'] = helpers.encrypt(SPEEDCD_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['SPEEDCD']['speedcd_ratio'] = float(SPEEDCD_RATIO)
|
||||
new_config['SPEEDCD']['speedcd_freeleech'] = int(SPEEDCD_FREELEECH)
|
||||
# dynamically save provider settings
|
||||
for curTorrentProvider in [curProvider for curProvider in providers.sortedProviderList() if
|
||||
curProvider.providerType == GenericProvider.TORRENT]:
|
||||
new_config[curTorrentProvider.getID().upper()] = {}
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID()] = int(curTorrentProvider.enabled)
|
||||
if hasattr(curTorrentProvider, 'digest'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_digest'] = curTorrentProvider.digest
|
||||
if hasattr(curTorrentProvider, 'hash'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_hash'] = curTorrentProvider.hash
|
||||
if hasattr(curTorrentProvider, 'api_key'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_api_key'] = curTorrentProvider.api_key
|
||||
if hasattr(curTorrentProvider, 'username'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_username'] = curTorrentProvider.username
|
||||
if hasattr(curTorrentProvider, 'password'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_password'] = curTorrentProvider.password
|
||||
if hasattr(curTorrentProvider, 'confirmed'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_confirmed'] = curTorrentProvider.confirmed
|
||||
if hasattr(curTorrentProvider, 'ratio'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_ratio'] = float(curTorrentProvider.ratio)
|
||||
if hasattr(curTorrentProvider, 'options'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_options'] = curTorrentProvider.options
|
||||
if hasattr(curTorrentProvider, 'proxy'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy'] = curTorrentProvider.proxy
|
||||
if hasattr(curTorrentProvider, 'proxy_url'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy_url'] = curTorrentProvider.proxy_url
|
||||
if hasattr(curTorrentProvider, 'freeleech'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_freeleech'] = int(curTorrentProvider.freeleech)
|
||||
if hasattr(curTorrentProvider, 'search_mode'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_search_mode'] = curTorrentProvider.search_mode
|
||||
if hasattr(curTorrentProvider, 'search_fallback'):
|
||||
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_search_fallback'] = int(curTorrentProvider.search_fallback)
|
||||
|
||||
new_config['NZBs'] = {}
|
||||
new_config['NZBs']['nzbs'] = int(NZBS)
|
||||
@ -1860,4 +1701,4 @@ def getEpList(epIDs, showid=None):
|
||||
curEpObj = curShowObj.getEpisode(int(curEp["season"]), int(curEp["episode"]))
|
||||
epList.append(curEpObj)
|
||||
|
||||
return epList
|
||||
return epList
|
@ -81,6 +81,8 @@ def getNewznabProviderList(data):
|
||||
providerDict[curDefault.name].name = curDefault.name
|
||||
providerDict[curDefault.name].url = curDefault.url
|
||||
providerDict[curDefault.name].needs_auth = curDefault.needs_auth
|
||||
providerDict[curDefault.name].search_mode = curDefault.search_mode
|
||||
providerDict[curDefault.name].search_fallback = curDefault.search_fallback
|
||||
|
||||
return filter(lambda x: x, providerList)
|
||||
|
||||
@ -89,16 +91,23 @@ def makeNewznabProvider(configString):
|
||||
if not configString:
|
||||
return None
|
||||
|
||||
search_mode = 'eponly'
|
||||
search_fallback = 0
|
||||
|
||||
try:
|
||||
name, url, key, catIDs, enabled = configString.split('|')
|
||||
name, url, key, catIDs, enabled, search_mode, search_fallback = configString.split('|')
|
||||
except ValueError:
|
||||
logger.log(u"Skipping Newznab provider string: '" + configString + "', incorrect format", logger.ERROR)
|
||||
return None
|
||||
try:
|
||||
name, url, key, catIDs, enabled = configString.split('|')
|
||||
except ValueError:
|
||||
logger.log(u"Skipping Newznab provider string: '" + configString + "', incorrect format", logger.ERROR)
|
||||
return None
|
||||
|
||||
newznab = sys.modules['sickbeard.providers.newznab']
|
||||
|
||||
newProvider = newznab.NewznabProvider(name, url, key=key, catIDs=catIDs)
|
||||
newProvider = newznab.NewznabProvider(name, url, key=key, catIDs=catIDs, search_mode=search_mode, search_fallback=search_fallback)
|
||||
newProvider.enabled = enabled == '1'
|
||||
newProvider.search_fallback = search_fallback == '1'
|
||||
|
||||
return newProvider
|
||||
|
||||
@ -123,7 +132,7 @@ def makeTorrentRssProvider(configString):
|
||||
|
||||
|
||||
def getDefaultNewznabProviders():
|
||||
return 'Sick Beard Index|http://lolo.sickbeard.com/|0|5030,5040,5060|0!!!NZBs.org|https://nzbs.org/||5030,5040,5060,5070,5090|0!!!Usenet-Crawler|https://www.usenet-crawler.com/||5030,5040,5060|0'
|
||||
return 'Sick Beard Index|http://lolo.sickbeard.com/|0|5030,5040,5060|0|eponly|0!!!NZBs.org|https://nzbs.org/||5030,5040,5060,5070,5090|0|eponly|0!!!Usenet-Crawler|https://www.usenet-crawler.com/||5030,5040,5060|0|eponly|0'
|
||||
|
||||
|
||||
def getProviderModule(name):
|
||||
|
@ -39,18 +39,23 @@ class BTNProvider(generic.TorrentProvider):
|
||||
generic.TorrentProvider.__init__(self, "BTN")
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.api_key = None
|
||||
self.ratio = None
|
||||
|
||||
self.cache = BTNCache(self)
|
||||
|
||||
self.url = "http://broadcasthe.net"
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.BTN
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'btn.png'
|
||||
|
||||
def _checkAuth(self):
|
||||
if not sickbeard.BTN_API_KEY:
|
||||
if not self.api_key:
|
||||
raise AuthException("Your authentication credentials for " + self.name + " are missing, check your config.")
|
||||
|
||||
return True
|
||||
@ -73,7 +78,7 @@ class BTNProvider(generic.TorrentProvider):
|
||||
self._checkAuth()
|
||||
|
||||
params = {}
|
||||
apikey = sickbeard.BTN_API_KEY
|
||||
apikey = self.api_key
|
||||
|
||||
# age in seconds
|
||||
if age:
|
||||
@ -296,8 +301,7 @@ class BTNProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.BTN_RATIO
|
||||
|
||||
return self.ratio
|
||||
|
||||
class BTNCache(tvcache.TVCache):
|
||||
def __init__(self, provider):
|
||||
|
@ -32,11 +32,16 @@ class DTTProvider(generic.TorrentProvider):
|
||||
def __init__(self):
|
||||
generic.TorrentProvider.__init__(self, "DailyTvTorrents")
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.ratio = None
|
||||
|
||||
self.cache = DTTCache(self)
|
||||
|
||||
self.url = 'http://www.dailytvtorrents.org/'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.DTT
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'dailytvtorrents.gif'
|
||||
@ -46,8 +51,8 @@ class DTTProvider(generic.TorrentProvider):
|
||||
quality = Quality.sceneQuality(url)
|
||||
return quality
|
||||
|
||||
def getSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
return generic.TorrentProvider.findSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
def findSearchResults(self, show, season, episodes, search_mode, manualSearch=False):
|
||||
return generic.TorrentProvider.findSearchResults(self, show, season, episodes, search_mode, manualSearch)
|
||||
|
||||
def _dtt_show_id(self, show_name):
|
||||
return sanitizeSceneName(show_name).replace('.', '-').lower()
|
||||
|
@ -40,12 +40,15 @@ class EZRSSProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.ratio = None
|
||||
|
||||
self.cache = EZRSSCache(self)
|
||||
|
||||
self.url = 'https://www.ezrss.it/'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.EZRSS
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'ezrss.png'
|
||||
@ -57,7 +60,7 @@ class EZRSSProvider(generic.TorrentProvider):
|
||||
|
||||
return quality
|
||||
|
||||
def getSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
def findSearchResults(self, show, season, episodes, search_mode, manualSearch=False):
|
||||
|
||||
self.show = show
|
||||
|
||||
@ -68,7 +71,7 @@ class EZRSSProvider(generic.TorrentProvider):
|
||||
logger.WARNING)
|
||||
return results
|
||||
|
||||
results = generic.TorrentProvider.findSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
results = generic.TorrentProvider.findSearchResults(self, show, season, episodes, search_mode, manualSearch)
|
||||
|
||||
return results
|
||||
|
||||
@ -158,7 +161,7 @@ class EZRSSProvider(generic.TorrentProvider):
|
||||
return None
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.EZRSS_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class EZRSSCache(tvcache.TVCache):
|
||||
|
@ -52,7 +52,9 @@ class GenericProvider:
|
||||
self.url = ''
|
||||
|
||||
self.show = None
|
||||
|
||||
self.supportsBacklog = False
|
||||
|
||||
self.search_mode = None
|
||||
self.search_fallback = False
|
||||
|
||||
@ -225,7 +227,7 @@ class GenericProvider:
|
||||
|
||||
return (title, url)
|
||||
|
||||
def findSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
def findSearchResults(self, show, season, episodes, search_mode, manualSearch=False):
|
||||
|
||||
self._checkAuth()
|
||||
self.show = show
|
||||
@ -236,7 +238,7 @@ class GenericProvider:
|
||||
|
||||
searched_scene_season = None
|
||||
for epObj in episodes:
|
||||
if seasonSearch and searched_scene_season:
|
||||
if search_mode == 'sponly' and searched_scene_season:
|
||||
if searched_scene_season == epObj.scene_season:
|
||||
continue
|
||||
|
||||
@ -254,7 +256,7 @@ class GenericProvider:
|
||||
results.update({epObj.episode:cacheResult[epObj]})
|
||||
continue
|
||||
|
||||
if seasonSearch:
|
||||
if search_mode == 'sponly':
|
||||
for curString in self._get_season_search_strings(epObj):
|
||||
itemList += self._doSearch(curString, len(episodes))
|
||||
else:
|
||||
@ -289,7 +291,7 @@ class GenericProvider:
|
||||
continue
|
||||
|
||||
if not (self.show.air_by_date or self.show.sports):
|
||||
if seasonSearch and len(parse_result.episode_numbers):
|
||||
if search_mode == 'sponly' and len(parse_result.episode_numbers):
|
||||
logger.log(
|
||||
u"This is supposed to be a season pack search but the result " + title + " is not a valid season pack, skipping it",
|
||||
logger.DEBUG)
|
||||
@ -413,4 +415,4 @@ class TorrentProvider(GenericProvider):
|
||||
def __init__(self, name):
|
||||
GenericProvider.__init__(self, name)
|
||||
|
||||
self.providerType = GenericProvider.TORRENT
|
||||
self.providerType = GenericProvider.TORRENT
|
@ -38,8 +38,13 @@ class HDBitsProvider(generic.TorrentProvider):
|
||||
|
||||
generic.TorrentProvider.__init__(self, "HDBits")
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
|
||||
self.cache = HDBitsCache(self)
|
||||
|
||||
self.url = 'https://hdbits.org'
|
||||
@ -48,11 +53,11 @@ class HDBitsProvider(generic.TorrentProvider):
|
||||
self.download_url = 'http://hdbits.org/download.php?'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.HDBITS
|
||||
return self.enabled
|
||||
|
||||
def _checkAuth(self):
|
||||
|
||||
if not sickbeard.HDBITS_USERNAME or not sickbeard.HDBITS_PASSKEY:
|
||||
if not self.username or not self.password:
|
||||
raise AuthException("Your authentication credentials for " + self.name + " are missing, check your config.")
|
||||
|
||||
return True
|
||||
@ -83,7 +88,7 @@ class HDBitsProvider(generic.TorrentProvider):
|
||||
if title:
|
||||
title = title.replace(' ', '.')
|
||||
|
||||
url = self.download_url + urllib.urlencode({'id': item['id'], 'passkey': sickbeard.HDBITS_PASSKEY})
|
||||
url = self.download_url + urllib.urlencode({'id': item['id'], 'passkey': self.password})
|
||||
|
||||
return (title, url)
|
||||
|
||||
@ -141,8 +146,8 @@ class HDBitsProvider(generic.TorrentProvider):
|
||||
def _make_post_data_JSON(self, show=None, episode=None, season=None, search_term=None):
|
||||
|
||||
post_data = {
|
||||
'username': sickbeard.HDBITS_USERNAME,
|
||||
'passkey': sickbeard.HDBITS_PASSKEY,
|
||||
'username': self.username,
|
||||
'passkey': self.password,
|
||||
'category': [2], # TV Category
|
||||
}
|
||||
|
||||
@ -171,7 +176,7 @@ class HDBitsProvider(generic.TorrentProvider):
|
||||
return json.dumps(post_data)
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.HDBITS_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class HDBitsCache(tvcache.TVCache):
|
||||
|
@ -56,6 +56,11 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
|
||||
self.cache = HDTorrentsCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -65,7 +70,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||
self.cookies = None
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.HDTORRENTS
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'hdtorrents.png'
|
||||
@ -80,14 +85,14 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
|
||||
return True
|
||||
|
||||
if sickbeard.HDTORRENTS_UID and sickbeard.HDTORRENTS_HASH:
|
||||
if self.uid and self.hash:
|
||||
|
||||
requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies)
|
||||
|
||||
else:
|
||||
|
||||
login_params = {'uid': sickbeard.HDTORRENTS_USERNAME,
|
||||
'pwd': sickbeard.HDTORRENTS_PASSWORD,
|
||||
login_params = {'uid': self.username,
|
||||
'pwd': self.password,
|
||||
'submit': 'Confirm',
|
||||
}
|
||||
|
||||
@ -102,11 +107,11 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||
logger.log(u'Invalid username or password for ' + self.name + ' Check your settings', logger.ERROR)
|
||||
return False
|
||||
|
||||
sickbeard.HDTORRENTS_UID = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
||||
sickbeard.HDTORRENTS_HASH = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
||||
self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
||||
self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
||||
|
||||
self.cookies = {'uid': sickbeard.HDTORRENTS_UID,
|
||||
'pass': sickbeard.HDTORRENTS_HASH
|
||||
self.cookies = {'uid': self.uid,
|
||||
'pass': self.hash
|
||||
}
|
||||
|
||||
return True
|
||||
@ -321,7 +326,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.HDTORRENTS_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class HDTorrentsCache(tvcache.TVCache):
|
||||
|
@ -53,6 +53,12 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
self.freeleech = False
|
||||
|
||||
self.cache = IPTorrentsCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -60,7 +66,7 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
||||
self.categorie = 'l73=1&l78=1&l66=1&l65=1&l79=1&l5=1&l4=1'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.IPTORRENTS
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'iptorrents.png'
|
||||
@ -72,8 +78,8 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
||||
|
||||
def _doLogin(self):
|
||||
|
||||
login_params = {'username': sickbeard.IPTORRENTS_USERNAME,
|
||||
'password': sickbeard.IPTORRENTS_PASSWORD,
|
||||
login_params = {'username': self.username,
|
||||
'password': self.password,
|
||||
'login': 'submit',
|
||||
}
|
||||
|
||||
@ -137,7 +143,7 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
||||
results = []
|
||||
items = {'Season': [], 'Episode': [], 'RSS': []}
|
||||
|
||||
freeleech = '&free=on' if sickbeard.IPTORRENTS_FREELEECH else ''
|
||||
freeleech = '&free=on' if self.freeleech else ''
|
||||
|
||||
if not self._doLogin():
|
||||
return []
|
||||
@ -266,8 +272,7 @@ class IPTorrentsProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.IPTORRENTS_RATIO
|
||||
|
||||
return self.ratio
|
||||
|
||||
class IPTorrentsCache(tvcache.TVCache):
|
||||
def __init__(self, provider):
|
||||
|
@ -56,6 +56,10 @@ class KATProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.confirmed = False
|
||||
self.ratio = None
|
||||
|
||||
self.cache = KATCache(self)
|
||||
|
||||
self.url = 'http://kickass.to/'
|
||||
@ -63,7 +67,7 @@ class KATProvider(generic.TorrentProvider):
|
||||
self.searchurl = self.url + 'usearch/%s/?field=seeders&sorder=desc' #order by seed
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.KAT
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'kat.png'
|
||||
@ -261,7 +265,7 @@ class KATProvider(generic.TorrentProvider):
|
||||
if mode != 'RSS' and seeders == 0:
|
||||
continue
|
||||
|
||||
if sickbeard.KAT_VERIFIED and not verified:
|
||||
if self.confirmed and not verified:
|
||||
logger.log(
|
||||
u"KAT Provider found result " + title + " but that doesn't seem like a verified result so I'm ignoring it",
|
||||
logger.DEBUG)
|
||||
@ -398,7 +402,7 @@ class KATProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.KAT_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class KATCache(tvcache.TVCache):
|
||||
|
@ -42,7 +42,7 @@ from sickbeard.exceptions import ex, AuthException
|
||||
|
||||
|
||||
class NewznabProvider(generic.NZBProvider):
|
||||
def __init__(self, name, url, key='', catIDs='5030,5040,5060'):
|
||||
def __init__(self, name, url, key='', catIDs='5030,5040,5060', search_mode='eponly', search_fallback=False):
|
||||
|
||||
generic.NZBProvider.__init__(self, name)
|
||||
|
||||
@ -52,6 +52,14 @@ class NewznabProvider(generic.NZBProvider):
|
||||
|
||||
self.key = key
|
||||
|
||||
self.search_mode = search_mode
|
||||
self.search_fallback = search_fallback
|
||||
|
||||
if self.search_fallback == '0':
|
||||
self.search_fallback = False
|
||||
else:
|
||||
self.search_fallback = True
|
||||
|
||||
# a 0 in the key spot indicates that no key is needed
|
||||
if self.key == '0':
|
||||
self.needs_auth = False
|
||||
@ -69,7 +77,7 @@ class NewznabProvider(generic.NZBProvider):
|
||||
self.default = False
|
||||
|
||||
def configStr(self):
|
||||
return self.name + '|' + self.url + '|' + self.key + '|' + self.catIDs + '|' + str(int(self.enabled))
|
||||
return self.name + '|' + self.url + '|' + self.key + '|' + self.catIDs + '|' + str(int(self.enabled)) + '|' + self.search_mode + '|' + str(int(self.search_fallback))
|
||||
|
||||
def imageName(self):
|
||||
if ek.ek(os.path.isfile,
|
||||
|
@ -56,6 +56,11 @@ class NextGenProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
|
||||
self.cache = NextGenCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -67,7 +72,7 @@ class NextGenProvider(generic.TorrentProvider):
|
||||
self.login_opener = None
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.NEXTGEN
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'nextgen.png'
|
||||
@ -79,8 +84,8 @@ class NextGenProvider(generic.TorrentProvider):
|
||||
|
||||
def getLoginParams(self):
|
||||
return {
|
||||
'username': sickbeard.NEXTGEN_USERNAME,
|
||||
'password': sickbeard.NEXTGEN_PASSWORD,
|
||||
'username': self.username,
|
||||
'password': self.password,
|
||||
}
|
||||
|
||||
def loginSuccess(self, output):
|
||||
@ -315,7 +320,7 @@ class NextGenProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.NEXTGEN_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class NextGenCache(tvcache.TVCache):
|
||||
|
@ -39,12 +39,14 @@ class NyaaProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsAbsoluteNumbering = True
|
||||
|
||||
self.enabled = False
|
||||
|
||||
self.cache = NyaaCache(self)
|
||||
|
||||
self.url = 'http://www.nyaa.eu/'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.NYAA
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'nyaatorrents.png'
|
||||
@ -54,9 +56,8 @@ class NyaaProvider(generic.TorrentProvider):
|
||||
quality = Quality.sceneQuality(title)
|
||||
return quality
|
||||
|
||||
def getSearchResults(self, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
results = generic.TorrentProvider.findSearchResults(self, show, season, episodes, seasonSearch, manualSearch)
|
||||
return results
|
||||
def findSearchResults(self, show, season, episodes, search_mode, manualSearch=False):
|
||||
return generic.TorrentProvider.findSearchResults(self, show, season, episodes, search_mode, manualSearch)
|
||||
|
||||
def _get_season_search_strings(self, ep_obj):
|
||||
names = []
|
||||
|
@ -54,6 +54,9 @@ class PublicHDProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.ratio = None
|
||||
|
||||
self.cache = PublicHDCache(self)
|
||||
|
||||
self.url = 'http://phdproxy.com/'
|
||||
@ -63,7 +66,7 @@ class PublicHDProvider(generic.TorrentProvider):
|
||||
self.categories = {'Season': ['23'], 'Episode': ['7', '14', '24'], 'RSS': ['7', '14', '23', '24']}
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.PUBLICHD
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'publichd.png'
|
||||
@ -290,7 +293,7 @@ class PublicHDProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.PUBLICHD_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class PublicHDCache(tvcache.TVCache):
|
||||
|
@ -58,6 +58,11 @@ class SCCProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
|
||||
self.cache = SCCCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -67,7 +72,7 @@ class SCCProvider(generic.TorrentProvider):
|
||||
self.headers = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'}
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.SCC
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'scc.png'
|
||||
@ -79,8 +84,8 @@ class SCCProvider(generic.TorrentProvider):
|
||||
|
||||
def _doLogin(self):
|
||||
|
||||
login_params = {'username': sickbeard.SCC_USERNAME,
|
||||
'password': sickbeard.SCC_PASSWORD,
|
||||
login_params = {'username': self.username,
|
||||
'password': self.password,
|
||||
'submit': 'come on in',
|
||||
}
|
||||
|
||||
@ -162,6 +167,8 @@ class SCCProvider(generic.TorrentProvider):
|
||||
if isinstance(search_string, unicode):
|
||||
search_string = unidecode(search_string)
|
||||
|
||||
nonsceneSearchURL = None
|
||||
foreignSearchURL = None
|
||||
if mode == 'Season':
|
||||
searchURL = self.urls['archive'] % (search_string)
|
||||
data = [self.getURL(searchURL, headers=self.headers)]
|
||||
@ -306,7 +313,7 @@ class SCCProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.SCC_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class SCCCache(tvcache.TVCache):
|
||||
|
@ -52,6 +52,12 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
self.freeleech = False
|
||||
|
||||
self.cache = SpeedCDCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -59,7 +65,7 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||
self.categories = {'Season': {'c14':1}, 'Episode': {'c2':1, 'c49':1}, 'RSS': {'c14':1, 'c2':1, 'c49':1}}
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.SPEEDCD
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'speedcd.png'
|
||||
@ -71,12 +77,10 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||
|
||||
def _doLogin(self):
|
||||
|
||||
login_params = {'username': sickbeard.SPEEDCD_USERNAME,
|
||||
'password': sickbeard.SPEEDCD_PASSWORD
|
||||
login_params = {'username': self.username,
|
||||
'password': self.password
|
||||
}
|
||||
|
||||
self.session = requests.Session()
|
||||
|
||||
try:
|
||||
response = self.session.post(self.urls['login'], data=login_params, timeout=30, verify=False)
|
||||
except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError), e:
|
||||
@ -157,7 +161,7 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||
|
||||
for torrent in torrents:
|
||||
|
||||
if sickbeard.SPEEDCD_FREELEECH and not torrent['free']:
|
||||
if self.freeleech and not torrent['free']:
|
||||
continue
|
||||
|
||||
title = re.sub('<[^>]*>', '', torrent['name'])
|
||||
@ -245,8 +249,7 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.SPEEDCD_RATIO
|
||||
|
||||
return self.ratio
|
||||
|
||||
class SpeedCDCache(tvcache.TVCache):
|
||||
|
||||
|
@ -63,6 +63,10 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.ratio = None
|
||||
self.confirmed = False
|
||||
|
||||
self.cache = ThePirateBayCache(self)
|
||||
|
||||
self.proxy = ThePirateBayWebproxy()
|
||||
@ -74,7 +78,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
||||
self.re_title_url = '/torrent/(?P<id>\d+)/(?P<title>.*?)//1".+?(?P<url>magnet.*?)//1".+?(?P<seeders>\d+)</td>.+?(?P<leechers>\d+)</td>'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.THEPIRATEBAY
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'thepiratebay.png'
|
||||
@ -257,7 +261,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
||||
continue
|
||||
|
||||
#Accept Torrent only from Good People for every Episode Search
|
||||
if sickbeard.THEPIRATEBAY_TRUSTED and re.search('(VIP|Trusted|Helper)', torrent.group(0)) is None:
|
||||
if self.confirmed and re.search('(VIP|Trusted|Helper)', torrent.group(0)) is None:
|
||||
logger.log(u"ThePirateBay Provider found result " + torrent.group(
|
||||
'title') + " but that doesn't seem like a trusted result so I'm ignoring it", logger.DEBUG)
|
||||
continue
|
||||
@ -390,7 +394,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.THEPIRATEBAY_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class ThePirateBayCache(tvcache.TVCache):
|
||||
@ -445,14 +449,16 @@ class ThePirateBayWebproxy:
|
||||
self.Type = 'GlypeProxy'
|
||||
self.param = 'browse.php?u='
|
||||
self.option = '&b=32'
|
||||
self.proxy = False
|
||||
self.proxy_url = None
|
||||
|
||||
def isEnabled(self):
|
||||
""" Return True if we Choose to call TPB via Proxy """
|
||||
return sickbeard.THEPIRATEBAY_PROXY
|
||||
return self.proxy
|
||||
|
||||
def getProxyURL(self):
|
||||
""" Return the Proxy URL Choosen via Provider Setting """
|
||||
return str(sickbeard.THEPIRATEBAY_PROXY_URL)
|
||||
return str(self.proxy_url)
|
||||
|
||||
def _buildURL(self, url):
|
||||
""" Return the Proxyfied URL of the page """
|
||||
|
@ -53,6 +53,12 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
self.freeleech = False
|
||||
|
||||
self.cache = TorrentDayCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -63,7 +69,7 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
'RSS': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1, 'c14': 1}}
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.TORRENTDAY
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'torrentday.png'
|
||||
@ -78,14 +84,14 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
if any(requests.utils.dict_from_cookiejar(self.session.cookies).values()):
|
||||
return True
|
||||
|
||||
if sickbeard.TORRENTDAY_UID and sickbeard.TORRENTDAY_HASH:
|
||||
if self.uid and self.hash:
|
||||
|
||||
requests.utils.add_dict_to_cookiejar(self.session.cookies, self.cookies)
|
||||
|
||||
else:
|
||||
|
||||
login_params = {'username': sickbeard.TORRENTDAY_USERNAME,
|
||||
'password': sickbeard.TORRENTDAY_PASSWORD,
|
||||
login_params = {'username': self.username,
|
||||
'password': self.password,
|
||||
'submit.x': 0,
|
||||
'submit.y': 0
|
||||
}
|
||||
@ -105,11 +111,11 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
return False
|
||||
|
||||
if requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] and requests.utils.dict_from_cookiejar(self.session.cookies)['pass']:
|
||||
sickbeard.TORRENTDAY_UID = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
||||
sickbeard.TORRENTDAY_HASH = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
||||
self.uid = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
|
||||
self.hash = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
|
||||
|
||||
self.cookies = {'uid': sickbeard.TORRENTDAY_UID,
|
||||
'pass': sickbeard.TORRENTDAY_HASH
|
||||
self.cookies = {'uid': self.uid,
|
||||
'pass': self.hash
|
||||
}
|
||||
return True
|
||||
|
||||
@ -164,7 +170,7 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
results = []
|
||||
items = {'Season': [], 'Episode': [], 'RSS': []}
|
||||
|
||||
freeleech = '&free=on' if sickbeard.TORRENTDAY_FREELEECH else ''
|
||||
freeleech = '&free=on' if self.freeleech else ''
|
||||
|
||||
if not self._doLogin():
|
||||
return []
|
||||
@ -179,7 +185,7 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
post_data = dict({'/browse.php?': None, 'cata': 'yes', 'jxt': 8, 'jxw': 'b', 'search': search_string},
|
||||
**self.categories[mode])
|
||||
|
||||
if sickbeard.TORRENTDAY_FREELEECH:
|
||||
if self.freeleech:
|
||||
post_data.update({'free': 'on'})
|
||||
|
||||
data = self.session.post(self.urls['search'], data=post_data).json()
|
||||
@ -268,7 +274,7 @@ class TorrentDayProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.TORRENTDAY_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class TorrentDayCache(tvcache.TVCache):
|
||||
|
@ -54,6 +54,11 @@ class TorrentLeechProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = True
|
||||
|
||||
self.enabled = False
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.ratio = None
|
||||
|
||||
self.cache = TorrentLeechCache(self)
|
||||
|
||||
self.url = self.urls['base_url']
|
||||
@ -61,7 +66,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
|
||||
self.categories = "2,26,27,32"
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.TORRENTLEECH
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'torrentleech.png'
|
||||
@ -73,8 +78,8 @@ class TorrentLeechProvider(generic.TorrentProvider):
|
||||
|
||||
def _doLogin(self):
|
||||
|
||||
login_params = {'username': sickbeard.TORRENTLEECH_USERNAME,
|
||||
'password': sickbeard.TORRENTLEECH_PASSWORD,
|
||||
login_params = {'username': self.username,
|
||||
'password': self.password,
|
||||
'remember_me': 'on',
|
||||
'login': 'submit',
|
||||
}
|
||||
@ -267,7 +272,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
|
||||
return results
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.TORRENTLEECH_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class TorrentLeechCache(tvcache.TVCache):
|
||||
|
@ -37,19 +37,25 @@ class TvTorrentsProvider(generic.TorrentProvider):
|
||||
|
||||
self.supportsBacklog = False
|
||||
|
||||
self.enabled = False
|
||||
self.hash = None
|
||||
self.digest = None
|
||||
self.ratio = None
|
||||
self.options = None
|
||||
|
||||
self.cache = TvTorrentsCache(self)
|
||||
|
||||
self.url = 'http://www.tvtorrents.com/'
|
||||
|
||||
def isEnabled(self):
|
||||
return sickbeard.TVTORRENTS
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'tvtorrents.png'
|
||||
|
||||
def _checkAuth(self):
|
||||
|
||||
if not sickbeard.TVTORRENTS_DIGEST or not sickbeard.TVTORRENTS_HASH:
|
||||
if not self.digest or not self.hash:
|
||||
raise AuthException("Your authentication credentials for " + self.name + " are missing, check your config.")
|
||||
|
||||
return True
|
||||
@ -70,7 +76,7 @@ class TvTorrentsProvider(generic.TorrentProvider):
|
||||
return True
|
||||
|
||||
def seedRatio(self):
|
||||
return sickbeard.TVTORRENTS_RATIO
|
||||
return self.ratio
|
||||
|
||||
|
||||
class TvTorrentsCache(tvcache.TVCache):
|
||||
@ -84,7 +90,7 @@ class TvTorrentsCache(tvcache.TVCache):
|
||||
# These will be ignored on the serverside.
|
||||
ignore_regex = "all.month|month.of|season[\s\d]*complete"
|
||||
|
||||
rss_url = self.provider.url + 'RssServlet?digest=' + sickbeard.TVTORRENTS_DIGEST + '&hash=' + sickbeard.TVTORRENTS_HASH + '&fname=true&exclude=(' + ignore_regex + ')'
|
||||
rss_url = self.provider.url + 'RssServlet?digest=' + provider.digest + '&hash=' + provider.hash + '&fname=true&exclude=(' + ignore_regex + ')'
|
||||
logger.log(self.provider.name + u" cache update URL: " + rss_url, logger.DEBUG)
|
||||
|
||||
return self.getRSSFeed(rss_url)
|
||||
|
@ -316,13 +316,14 @@ def filterSearchResults(show, results):
|
||||
return foundResults
|
||||
|
||||
|
||||
def searchProviders(queueItem, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||
def searchProviders(queueItem, show, season, episodes, manualSearch=False):
|
||||
threadName = threading.currentThread().name
|
||||
|
||||
if seasonSearch:
|
||||
logger.log(u"Searching for " + show.name + " Season " + str(season) + " pack")
|
||||
else:
|
||||
logger.log(u"Searching for episodes we need from " + show.name + " Season " + str(season))
|
||||
# check if we want to search for season packs instead of just season/episode
|
||||
seasonSearch = False
|
||||
seasonEps = show.getAllEpisodes(season)
|
||||
if len(seasonEps) == len(episodes):
|
||||
seasonSearch = True
|
||||
|
||||
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive()]
|
||||
|
||||
@ -331,14 +332,26 @@ def searchProviders(queueItem, show, season, episodes, seasonSearch=False, manua
|
||||
logger.ERROR)
|
||||
return queueItem
|
||||
|
||||
def doSearch():
|
||||
foundResults = {}
|
||||
for providerNum, provider in enumerate(providers):
|
||||
foundResults.setdefault(provider.name, {})
|
||||
threading.currentThread().name = threadName + ":[" + provider.name + "]"
|
||||
foundResults = {}
|
||||
for providerNum, provider in enumerate(providers):
|
||||
threading.currentThread().name = threadName + ":[" + provider.name + "]"
|
||||
foundResults.setdefault(provider.name, {})
|
||||
searchCount = 0
|
||||
|
||||
search_mode = 'eponly'
|
||||
if seasonSearch and provider.search_mode == 'sponly':
|
||||
search_mode = provider.search_mode
|
||||
|
||||
while(True):
|
||||
searchCount += 1
|
||||
|
||||
if search_mode == 'sponly':
|
||||
logger.log(u"Searching for " + show.name + " Season " + str(season) + " pack")
|
||||
else:
|
||||
logger.log(u"Searching for episodes we need from " + show.name + " Season " + str(season))
|
||||
|
||||
try:
|
||||
curResults = provider.findSearchResults(show, season, episodes, seasonSearch, manualSearch)
|
||||
searchResults = provider.findSearchResults(show, season, episodes, search_mode, manualSearch)
|
||||
except exceptions.AuthException, e:
|
||||
logger.log(u"Authentication error: " + ex(e), logger.ERROR)
|
||||
continue
|
||||
@ -347,220 +360,225 @@ def searchProviders(queueItem, show, season, episodes, seasonSearch=False, manua
|
||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||
continue
|
||||
|
||||
if not len(curResults):
|
||||
continue
|
||||
if len(searchResults) and not provider.search_fallback or searchCount == 2:
|
||||
foundResults[provider.name] = filterSearchResults(show, searchResults)
|
||||
break
|
||||
|
||||
foundResults[provider.name] = filterSearchResults(show, curResults)
|
||||
if not len(foundResults[provider.name]):
|
||||
continue
|
||||
if search_mode == 'sponly':
|
||||
logger.log(u"FALLBACK EPISODE SEARCH INITIATED ...")
|
||||
search_mode = 'eponly'
|
||||
else:
|
||||
logger.log(u"FALLBACK SEASON PACK SEARCH INITIATED ...")
|
||||
search_mode = 'eponly'
|
||||
|
||||
anyQualities, bestQualities = Quality.splitQuality(show.quality)
|
||||
# skip to next provider if we have no results to process
|
||||
if not len(foundResults[provider.name]):
|
||||
continue
|
||||
|
||||
# pick the best season NZB
|
||||
bestSeasonNZB = None
|
||||
if SEASON_RESULT in foundResults[provider.name]:
|
||||
bestSeasonNZB = pickBestResult(foundResults[provider.name][SEASON_RESULT], show,
|
||||
anyQualities + bestQualities)
|
||||
anyQualities, bestQualities = Quality.splitQuality(show.quality)
|
||||
|
||||
highest_quality_overall = 0
|
||||
for cur_episode in foundResults[provider.name]:
|
||||
for cur_result in foundResults[provider.name][cur_episode]:
|
||||
if cur_result.quality != Quality.UNKNOWN and cur_result.quality > highest_quality_overall:
|
||||
highest_quality_overall = cur_result.quality
|
||||
logger.log(u"The highest quality of any match is " + Quality.qualityStrings[highest_quality_overall],
|
||||
logger.DEBUG)
|
||||
# pick the best season NZB
|
||||
bestSeasonNZB = None
|
||||
if SEASON_RESULT in foundResults[provider.name]:
|
||||
bestSeasonNZB = pickBestResult(foundResults[provider.name][SEASON_RESULT], show,
|
||||
anyQualities + bestQualities)
|
||||
|
||||
# see if every episode is wanted
|
||||
if bestSeasonNZB:
|
||||
highest_quality_overall = 0
|
||||
for cur_episode in foundResults[provider.name]:
|
||||
for cur_result in foundResults[provider.name][cur_episode]:
|
||||
if cur_result.quality != Quality.UNKNOWN and cur_result.quality > highest_quality_overall:
|
||||
highest_quality_overall = cur_result.quality
|
||||
logger.log(u"The highest quality of any match is " + Quality.qualityStrings[highest_quality_overall],
|
||||
logger.DEBUG)
|
||||
|
||||
# get the quality of the season nzb
|
||||
seasonQual = Quality.sceneQuality(bestSeasonNZB.name)
|
||||
seasonQual = bestSeasonNZB.quality
|
||||
# see if every episode is wanted
|
||||
if bestSeasonNZB:
|
||||
|
||||
# get the quality of the season nzb
|
||||
seasonQual = Quality.sceneQuality(bestSeasonNZB.name)
|
||||
seasonQual = bestSeasonNZB.quality
|
||||
logger.log(
|
||||
u"The quality of the season " + bestSeasonNZB.provider.providerType + " is " + Quality.qualityStrings[
|
||||
seasonQual], logger.DEBUG)
|
||||
|
||||
myDB = db.DBConnection()
|
||||
allEps = [int(x["episode"]) for x in
|
||||
myDB.select("SELECT episode FROM tv_episodes WHERE showid = ? AND season = ?",
|
||||
[show.indexerid, season])]
|
||||
logger.log(u"Episode list: " + str(allEps), logger.DEBUG)
|
||||
|
||||
allWanted = True
|
||||
anyWanted = False
|
||||
for curEpNum in allEps:
|
||||
if not show.wantEpisode(season, curEpNum, seasonQual):
|
||||
allWanted = False
|
||||
else:
|
||||
anyWanted = True
|
||||
|
||||
# if we need every ep in the season and there's nothing better then just download this and be done with it (unless single episodes are preferred)
|
||||
if allWanted and bestSeasonNZB.quality == highest_quality_overall:
|
||||
logger.log(
|
||||
u"The quality of the season " + bestSeasonNZB.provider.providerType + " is " + Quality.qualityStrings[
|
||||
seasonQual], logger.DEBUG)
|
||||
|
||||
myDB = db.DBConnection()
|
||||
allEps = [int(x["episode"]) for x in
|
||||
myDB.select("SELECT episode FROM tv_episodes WHERE showid = ? AND season = ?",
|
||||
[show.indexerid, season])]
|
||||
logger.log(u"Episode list: " + str(allEps), logger.DEBUG)
|
||||
|
||||
allWanted = True
|
||||
anyWanted = False
|
||||
u"Every ep in this season is needed, downloading the whole " + bestSeasonNZB.provider.providerType + " " + bestSeasonNZB.name)
|
||||
epObjs = []
|
||||
for curEpNum in allEps:
|
||||
if not show.wantEpisode(season, curEpNum, seasonQual):
|
||||
allWanted = False
|
||||
else:
|
||||
anyWanted = True
|
||||
epObjs.append(show.getEpisode(season, curEpNum))
|
||||
bestSeasonNZB.episodes = epObjs
|
||||
queueItem.results = [bestSeasonNZB]
|
||||
return queueItem
|
||||
|
||||
# if we need every ep in the season and there's nothing better then just download this and be done with it (unless single episodes are preferred)
|
||||
if allWanted and bestSeasonNZB.quality == highest_quality_overall:
|
||||
elif not anyWanted:
|
||||
logger.log(
|
||||
u"No eps from this season are wanted at this quality, ignoring the result of " + bestSeasonNZB.name,
|
||||
logger.DEBUG)
|
||||
|
||||
else:
|
||||
|
||||
if bestSeasonNZB.provider.providerType == GenericProvider.NZB:
|
||||
logger.log(u"Breaking apart the NZB and adding the individual ones to our results", logger.DEBUG)
|
||||
|
||||
# if not, break it apart and add them as the lowest priority results
|
||||
individualResults = nzbSplitter.splitResult(bestSeasonNZB)
|
||||
|
||||
individualResults = filter(
|
||||
lambda x: show_name_helpers.filterBadReleases(x.name) and show_name_helpers.isGoodResult(x.name,
|
||||
show),
|
||||
individualResults)
|
||||
|
||||
for curResult in individualResults:
|
||||
if len(curResult.episodes) == 1:
|
||||
epNum = curResult.episodes[0].episode
|
||||
elif len(curResult.episodes) > 1:
|
||||
epNum = MULTI_EP_RESULT
|
||||
|
||||
if epNum in foundResults[provider.name]:
|
||||
foundResults[provider.name][epNum].append(curResult)
|
||||
else:
|
||||
foundResults[provider.name][epNum] = [curResult]
|
||||
|
||||
# If this is a torrent all we can do is leech the entire torrent, user will have to select which eps not do download in his torrent client
|
||||
else:
|
||||
|
||||
# Season result from Torrent Provider must be a full-season torrent, creating multi-ep result for it.
|
||||
logger.log(
|
||||
u"Every ep in this season is needed, downloading the whole " + bestSeasonNZB.provider.providerType + " " + bestSeasonNZB.name)
|
||||
u"Adding multi-ep result for full-season torrent. Set the episodes you don't want to 'don't download' in your torrent client if desired!")
|
||||
epObjs = []
|
||||
for curEpNum in allEps:
|
||||
epObjs.append(show.getEpisode(season, curEpNum))
|
||||
bestSeasonNZB.episodes = epObjs
|
||||
queueItem.results = [bestSeasonNZB]
|
||||
return queueItem
|
||||
|
||||
elif not anyWanted:
|
||||
logger.log(
|
||||
u"No eps from this season are wanted at this quality, ignoring the result of " + bestSeasonNZB.name,
|
||||
logger.DEBUG)
|
||||
|
||||
else:
|
||||
|
||||
if bestSeasonNZB.provider.providerType == GenericProvider.NZB:
|
||||
logger.log(u"Breaking apart the NZB and adding the individual ones to our results", logger.DEBUG)
|
||||
|
||||
# if not, break it apart and add them as the lowest priority results
|
||||
individualResults = nzbSplitter.splitResult(bestSeasonNZB)
|
||||
|
||||
individualResults = filter(
|
||||
lambda x: show_name_helpers.filterBadReleases(x.name) and show_name_helpers.isGoodResult(x.name,
|
||||
show),
|
||||
individualResults)
|
||||
|
||||
for curResult in individualResults:
|
||||
if len(curResult.episodes) == 1:
|
||||
epNum = curResult.episodes[0].episode
|
||||
elif len(curResult.episodes) > 1:
|
||||
epNum = MULTI_EP_RESULT
|
||||
|
||||
if epNum in foundResults[provider.name]:
|
||||
foundResults[provider.name][epNum].append(curResult)
|
||||
else:
|
||||
foundResults[provider.name][epNum] = [curResult]
|
||||
|
||||
# If this is a torrent all we can do is leech the entire torrent, user will have to select which eps not do download in his torrent client
|
||||
epNum = MULTI_EP_RESULT
|
||||
if epNum in foundResults[provider.name]:
|
||||
foundResults[provider.name][epNum].append(bestSeasonNZB)
|
||||
else:
|
||||
foundResults[provider.name][epNum] = [bestSeasonNZB]
|
||||
|
||||
# Season result from Torrent Provider must be a full-season torrent, creating multi-ep result for it.
|
||||
logger.log(
|
||||
u"Adding multi-ep result for full-season torrent. Set the episodes you don't want to 'don't download' in your torrent client if desired!")
|
||||
epObjs = []
|
||||
for curEpNum in allEps:
|
||||
epObjs.append(show.getEpisode(season, curEpNum))
|
||||
bestSeasonNZB.episodes = epObjs
|
||||
# go through multi-ep results and see if we really want them or not, get rid of the rest
|
||||
multiResults = {}
|
||||
if MULTI_EP_RESULT in foundResults[provider.name]:
|
||||
for multiResult in foundResults[provider.name][MULTI_EP_RESULT]:
|
||||
|
||||
epNum = MULTI_EP_RESULT
|
||||
if epNum in foundResults[provider.name]:
|
||||
foundResults[provider.name][epNum].append(bestSeasonNZB)
|
||||
else:
|
||||
foundResults[provider.name][epNum] = [bestSeasonNZB]
|
||||
logger.log(u"Seeing if we want to bother with multi-episode result " + multiResult.name, logger.DEBUG)
|
||||
|
||||
# go through multi-ep results and see if we really want them or not, get rid of the rest
|
||||
multiResults = {}
|
||||
if MULTI_EP_RESULT in foundResults[provider.name]:
|
||||
for multiResult in foundResults[provider.name][MULTI_EP_RESULT]:
|
||||
if sickbeard.USE_FAILED_DOWNLOADS and failed_history.hasFailed(multiResult.name, multiResult.size,
|
||||
multiResult.provider.name):
|
||||
logger.log(multiResult.name + u" has previously failed, rejecting this multi-ep result")
|
||||
continue
|
||||
|
||||
logger.log(u"Seeing if we want to bother with multi-episode result " + multiResult.name, logger.DEBUG)
|
||||
# see how many of the eps that this result covers aren't covered by single results
|
||||
neededEps = []
|
||||
notNeededEps = []
|
||||
for epObj in multiResult.episodes:
|
||||
epNum = epObj.episode
|
||||
# if we have results for the episode
|
||||
if epNum in foundResults[provider.name] and len(foundResults[provider.name][epNum]) > 0:
|
||||
# but the multi-ep is worse quality, we don't want it
|
||||
# TODO: wtf is this False for
|
||||
#if False and multiResult.quality <= pickBestResult(foundResults[epNum]):
|
||||
# notNeededEps.append(epNum)
|
||||
#else:
|
||||
neededEps.append(epNum)
|
||||
else:
|
||||
neededEps.append(epNum)
|
||||
|
||||
if sickbeard.USE_FAILED_DOWNLOADS and failed_history.hasFailed(multiResult.name, multiResult.size,
|
||||
multiResult.provider.name):
|
||||
logger.log(multiResult.name + u" has previously failed, rejecting this multi-ep result")
|
||||
continue
|
||||
logger.log(
|
||||
u"Single-ep check result is neededEps: " + str(neededEps) + ", notNeededEps: " + str(notNeededEps),
|
||||
logger.DEBUG)
|
||||
|
||||
# see how many of the eps that this result covers aren't covered by single results
|
||||
neededEps = []
|
||||
notNeededEps = []
|
||||
for epObj in multiResult.episodes:
|
||||
epNum = epObj.episode
|
||||
# if we have results for the episode
|
||||
if epNum in foundResults[provider.name] and len(foundResults[provider.name][epNum]) > 0:
|
||||
# but the multi-ep is worse quality, we don't want it
|
||||
# TODO: wtf is this False for
|
||||
#if False and multiResult.quality <= pickBestResult(foundResults[epNum]):
|
||||
# notNeededEps.append(epNum)
|
||||
#else:
|
||||
neededEps.append(epNum)
|
||||
else:
|
||||
neededEps.append(epNum)
|
||||
if not neededEps:
|
||||
logger.log(u"All of these episodes were covered by single nzbs, ignoring this multi-ep result",
|
||||
logger.DEBUG)
|
||||
continue
|
||||
|
||||
# check if these eps are already covered by another multi-result
|
||||
multiNeededEps = []
|
||||
multiNotNeededEps = []
|
||||
for epObj in multiResult.episodes:
|
||||
epNum = epObj.episode
|
||||
if epNum in multiResults:
|
||||
multiNotNeededEps.append(epNum)
|
||||
else:
|
||||
multiNeededEps.append(epNum)
|
||||
|
||||
logger.log(
|
||||
u"Multi-ep check result is multiNeededEps: " + str(multiNeededEps) + ", multiNotNeededEps: " + str(
|
||||
multiNotNeededEps), logger.DEBUG)
|
||||
|
||||
if not multiNeededEps:
|
||||
logger.log(
|
||||
u"Single-ep check result is neededEps: " + str(neededEps) + ", notNeededEps: " + str(notNeededEps),
|
||||
u"All of these episodes were covered by another multi-episode nzbs, ignoring this multi-ep result",
|
||||
logger.DEBUG)
|
||||
continue
|
||||
|
||||
if not neededEps:
|
||||
logger.log(u"All of these episodes were covered by single nzbs, ignoring this multi-ep result",
|
||||
logger.DEBUG)
|
||||
continue
|
||||
# if we're keeping this multi-result then remember it
|
||||
for epObj in multiResult.episodes:
|
||||
multiResults[epObj.episode] = multiResult
|
||||
|
||||
# check if these eps are already covered by another multi-result
|
||||
multiNeededEps = []
|
||||
multiNotNeededEps = []
|
||||
for epObj in multiResult.episodes:
|
||||
epNum = epObj.episode
|
||||
if epNum in multiResults:
|
||||
multiNotNeededEps.append(epNum)
|
||||
else:
|
||||
multiNeededEps.append(epNum)
|
||||
|
||||
logger.log(
|
||||
u"Multi-ep check result is multiNeededEps: " + str(multiNeededEps) + ", multiNotNeededEps: " + str(
|
||||
multiNotNeededEps), logger.DEBUG)
|
||||
|
||||
if not multiNeededEps:
|
||||
# don't bother with the single result if we're going to get it with a multi result
|
||||
for epObj in multiResult.episodes:
|
||||
epNum = epObj.episode
|
||||
if epNum in foundResults[provider.name]:
|
||||
logger.log(
|
||||
u"All of these episodes were covered by another multi-episode nzbs, ignoring this multi-ep result",
|
||||
logger.DEBUG)
|
||||
continue
|
||||
u"A needed multi-episode result overlaps with a single-episode result for ep #" + str(
|
||||
epNum) + ", removing the single-episode results from the list", logger.DEBUG)
|
||||
del foundResults[provider.name][epNum]
|
||||
|
||||
# if we're keeping this multi-result then remember it
|
||||
for epObj in multiResult.episodes:
|
||||
multiResults[epObj.episode] = multiResult
|
||||
|
||||
# don't bother with the single result if we're going to get it with a multi result
|
||||
for epObj in multiResult.episodes:
|
||||
epNum = epObj.episode
|
||||
if epNum in foundResults[provider.name]:
|
||||
logger.log(
|
||||
u"A needed multi-episode result overlaps with a single-episode result for ep #" + str(
|
||||
epNum) + ", removing the single-episode results from the list", logger.DEBUG)
|
||||
del foundResults[provider.name][epNum]
|
||||
|
||||
# of all the single ep results narrow it down to the best one for each episode
|
||||
queueItem.results += set(multiResults.values())
|
||||
for curEp in foundResults[provider.name]:
|
||||
if curEp in (MULTI_EP_RESULT, SEASON_RESULT):
|
||||
continue
|
||||
|
||||
if len(foundResults[provider.name][curEp]) == 0:
|
||||
continue
|
||||
|
||||
bestResult = pickBestResult(foundResults[provider.name][curEp], show)
|
||||
|
||||
# if all results were rejected move on to the next episode
|
||||
if not bestResult:
|
||||
continue
|
||||
|
||||
# add result if its not a duplicate and
|
||||
found = False
|
||||
for i, result in enumerate(queueItem.results):
|
||||
for bestResultEp in bestResult.episodes:
|
||||
if bestResultEp in result.episodes:
|
||||
if result.quality < bestResult.quality:
|
||||
queueItem.results.pop(i)
|
||||
else:
|
||||
found = True
|
||||
if not found:
|
||||
queueItem.results += [bestResult]
|
||||
|
||||
|
||||
# check that we got all the episodes we wanted first before doing a match and snatch
|
||||
wantedEpCount = 0
|
||||
for wantedEp in episodes:
|
||||
for result in queueItem.results:
|
||||
if wantedEp in result.episodes and isFinalResult(result):
|
||||
wantedEpCount += 1
|
||||
|
||||
# make sure we search every provider for results unless we found everything we wanted
|
||||
if providerNum != len(providers) and wantedEpCount != len(episodes):
|
||||
# of all the single ep results narrow it down to the best one for each episode
|
||||
queueItem.results += set(multiResults.values())
|
||||
for curEp in foundResults[provider.name]:
|
||||
if curEp in (MULTI_EP_RESULT, SEASON_RESULT):
|
||||
continue
|
||||
|
||||
return queueItem
|
||||
if len(foundResults[provider.name][curEp]) == 0:
|
||||
continue
|
||||
|
||||
results = doSearch()
|
||||
return results
|
||||
bestResult = pickBestResult(foundResults[provider.name][curEp], show)
|
||||
|
||||
# if all results were rejected move on to the next episode
|
||||
if not bestResult:
|
||||
continue
|
||||
|
||||
# add result if its not a duplicate and
|
||||
found = False
|
||||
for i, result in enumerate(queueItem.results):
|
||||
for bestResultEp in bestResult.episodes:
|
||||
if bestResultEp in result.episodes:
|
||||
if result.quality < bestResult.quality:
|
||||
queueItem.results.pop(i)
|
||||
else:
|
||||
found = True
|
||||
if not found:
|
||||
queueItem.results += [bestResult]
|
||||
|
||||
|
||||
# check that we got all the episodes we wanted first before doing a match and snatch
|
||||
wantedEpCount = 0
|
||||
for wantedEp in episodes:
|
||||
for result in queueItem.results:
|
||||
if wantedEp in result.episodes and isFinalResult(result):
|
||||
wantedEpCount += 1
|
||||
|
||||
# make sure we search every provider for results unless we found everything we wanted
|
||||
if providerNum != len(providers) and wantedEpCount != len(episodes):
|
||||
continue
|
||||
|
||||
return queueItem
|
@ -98,7 +98,7 @@ class ManualSearchQueueItem(generic_queue.QueueItem):
|
||||
|
||||
try:
|
||||
logger.log("Beginning manual search for [" + self.segment.prettyName() + "]")
|
||||
searchResult = search.searchProviders(self, self.show, self.segment.season, [self.segment],False,True)
|
||||
searchResult = search.searchProviders(self, self.show, self.segment.season, [self.segment], True)
|
||||
|
||||
if searchResult:
|
||||
SearchQueue().snatch_item(searchResult)
|
||||
@ -131,15 +131,9 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
||||
|
||||
wantedEps = self.segment[season]
|
||||
|
||||
# check if we want to search for season packs instead of just season/episode
|
||||
seasonSearch = False
|
||||
seasonEps = self.show.getAllEpisodes(season)
|
||||
if len(seasonEps) == len(wantedEps) and not sickbeard.PREFER_EPISODE_RELEASES:
|
||||
seasonSearch = True
|
||||
|
||||
try:
|
||||
logger.log("Beginning backlog search for [" + self.show.name + "]")
|
||||
searchResult = search.searchProviders(self, self.show, season, wantedEps, seasonSearch, False)
|
||||
searchResult = search.searchProviders(self, self.show, season, wantedEps, False)
|
||||
|
||||
if searchResult:
|
||||
SearchQueue().snatch_item(searchResult)
|
||||
@ -182,7 +176,7 @@ class FailedQueueItem(generic_queue.QueueItem):
|
||||
|
||||
if len(failed_episodes):
|
||||
try:
|
||||
searchResult = search.searchProviders(self, self.show, failed_episodes[0].season, failed_episodes, False, True)
|
||||
searchResult = search.searchProviders(self, self.show, failed_episodes[0].season, failed_episodes, True)
|
||||
|
||||
if searchResult:
|
||||
SearchQueue().snatch_item(searchResult)
|
||||
|
@ -1449,24 +1449,7 @@ class ConfigProviders:
|
||||
return '1'
|
||||
|
||||
@cherrypy.expose
|
||||
def saveProviders(self, newznab_string='', torrentrss_string='',
|
||||
omgwtfnzbs_username=None, omgwtfnzbs_apikey=None,
|
||||
ezrss_ratio=None,
|
||||
tvtorrents_digest=None, tvtorrents_hash=None, tvtorrents_ratio=None,
|
||||
btn_api_key=None, btn_ratio=None,
|
||||
thepiratebay_ratio=None, thepiratebay_trusted=None, thepiratebay_proxy=None, thepiratebay_proxy_url=None,
|
||||
torrentleech_username=None, torrentleech_password=None, torrentleech_ratio=None,
|
||||
iptorrents_username=None, iptorrents_password=None, iptorrents_ratio=None, iptorrents_freeleech=None,
|
||||
kat_trusted=None, kat_ratio=None, kat_verified=None,
|
||||
publichd_ratio=None,
|
||||
scc_username=None, scc_password=None, scc_ratio=None,
|
||||
hdtorrents_username=None, hdtorrents_password=None, hdtorrents_ratio=None,
|
||||
torrentday_username=None, torrentday_password=None, torrentday_ratio=None, torrentday_freeleech=None,
|
||||
hdbits_username=None, hdbits_passkey=None, hdbits_ratio=None,
|
||||
nextgen_username=None, nextgen_password=None, nextgen_ratio=None,
|
||||
newzbin_username=None, newzbin_password=None,
|
||||
speedcd_username=None, speedcd_password=None, speedcd_ratio=None, speedcd_freeleech=None,
|
||||
provider_order=None):
|
||||
def saveProviders(self, newznab_string='', torrentrss_string='', provider_order=None, **kwargs):
|
||||
|
||||
results = []
|
||||
|
||||
@ -1487,9 +1470,7 @@ class ConfigProviders:
|
||||
|
||||
cur_name, cur_url, cur_key = curNewznabProviderStr.split('|')
|
||||
cur_url = config.clean_url(cur_url)
|
||||
|
||||
newProvider = newznab.NewznabProvider(cur_name, cur_url, key=cur_key)
|
||||
|
||||
cur_id = newProvider.getID()
|
||||
|
||||
# if it already exists then update it
|
||||
@ -1503,7 +1484,28 @@ class ConfigProviders:
|
||||
else:
|
||||
newznabProviderDict[cur_id].needs_auth = True
|
||||
|
||||
try:
|
||||
newznabProviderDict[cur_id].search_mode = kwargs[cur_id + '_search_mode'].strip()
|
||||
except:
|
||||
newznabProviderDict[cur_id].search_mode = 'eponly'
|
||||
|
||||
try:
|
||||
newznabProviderDict[cur_id].search_fallback = config.checkbox_to_value(
|
||||
kwargs[cur_id + '_search_fallback'])
|
||||
except:
|
||||
newznabProviderDict[cur_id].search_fallback = 0
|
||||
else:
|
||||
try:
|
||||
newProvider.search_mode = kwargs[cur_id + '_search_mode'].strip()
|
||||
except:
|
||||
newProvider.search_mode = 'eponly'
|
||||
|
||||
try:
|
||||
newProvider.search_fallback = config.checkbox_to_value(
|
||||
kwargs[cur_id + '_search_fallback'])
|
||||
except:
|
||||
newProvider.search_fallback = 0
|
||||
|
||||
sickbeard.newznabProviderList.append(newProvider)
|
||||
|
||||
finishedNames.append(cur_id)
|
||||
@ -1557,120 +1559,91 @@ class ConfigProviders:
|
||||
|
||||
provider_list.append(curProvider)
|
||||
|
||||
if curProvider == 'nzbs_org_old':
|
||||
sickbeard.NZBS = curEnabled
|
||||
elif curProvider == 'newzbin':
|
||||
sickbeard.NEWZBIN = curEnabled
|
||||
elif curProvider == 'bin_req':
|
||||
sickbeard.BINREQ = curEnabled
|
||||
elif curProvider == 'womble_s_index':
|
||||
sickbeard.WOMBLE = curEnabled
|
||||
elif curProvider == 'omgwtfnzbs':
|
||||
sickbeard.OMGWTFNZBS = curEnabled
|
||||
elif curProvider == 'ezrss':
|
||||
sickbeard.EZRSS = curEnabled
|
||||
elif curProvider == 'tvtorrents':
|
||||
sickbeard.TVTORRENTS = curEnabled
|
||||
elif curProvider == 'torrentleech':
|
||||
sickbeard.TORRENTLEECH = curEnabled
|
||||
elif curProvider == 'btn':
|
||||
sickbeard.BTN = curEnabled
|
||||
elif curProvider == 'thepiratebay':
|
||||
sickbeard.THEPIRATEBAY = curEnabled
|
||||
elif curProvider == 'torrentleech':
|
||||
sickbeard.TORRENTLEECH = curEnabled
|
||||
elif curProvider == 'iptorrents':
|
||||
sickbeard.IPTORRENTS = curEnabled
|
||||
elif curProvider == 'omgwtfnzbs':
|
||||
sickbeard.OMGWTFNZBS = curEnabled
|
||||
elif curProvider == 'kickasstorrents':
|
||||
sickbeard.KAT = curEnabled
|
||||
elif curProvider == 'publichd':
|
||||
sickbeard.PUBLICHD = curEnabled
|
||||
elif curProvider == 'sceneaccess':
|
||||
sickbeard.SCC = curEnabled
|
||||
elif curProvider == 'hdtorrents':
|
||||
sickbeard.HDTORRENTS = curEnabled
|
||||
elif curProvider == 'torrentday':
|
||||
sickbeard.TORRENTDAY = curEnabled
|
||||
elif curProvider == 'hdbits':
|
||||
sickbeard.HDBITS = curEnabled
|
||||
elif curProvider == 'nextgen':
|
||||
sickbeard.NEXTGEN = curEnabled
|
||||
elif curProvider == 'speedcd':
|
||||
sickbeard.SPEEDCD = curEnabled
|
||||
elif curProvider in newznabProviderDict:
|
||||
newznabProviderDict[curProvider].enabled = bool(curEnabled)
|
||||
elif curProvider in torrentRssProviderDict:
|
||||
torrentRssProviderDict[curProvider].enabled = bool(curEnabled)
|
||||
else:
|
||||
logger.log(u"don't know what " + curProvider + " is, skipping")
|
||||
# dynamically set providers enabled/disabled
|
||||
for provider in sickbeard.providers.sortedProviderList():
|
||||
if provider.getID() != curProvider or not hasattr(provider, 'enabled'):
|
||||
continue
|
||||
|
||||
sickbeard.EZRSS_RATIO = ezrss_ratio
|
||||
provider.enabled = curEnabled
|
||||
|
||||
sickbeard.TVTORRENTS_DIGEST = tvtorrents_digest.strip()
|
||||
sickbeard.TVTORRENTS_HASH = tvtorrents_hash.strip()
|
||||
sickbeard.TVTORRENTS_RATIO = config.to_int(tvtorrents_ratio)
|
||||
# dynamically load provider settings
|
||||
for curTorrentProvider in [curProvider for curProvider in sickbeard.providers.sortedProviderList() if
|
||||
curProvider.providerType == sickbeard.GenericProvider.TORRENT]:
|
||||
|
||||
sickbeard.BTN_API_KEY = btn_api_key.strip()
|
||||
sickbeard.BTN_RATIO = btn_ratio
|
||||
if hasattr(curTorrentProvider, 'ratio'):
|
||||
try:
|
||||
curTorrentProvider.ratio = kwargs[curTorrentProvider.getID() + '_ratio'].strip()
|
||||
except:
|
||||
curTorrentProvider.ratio = None
|
||||
|
||||
sickbeard.THEPIRATEBAY_RATIO = thepiratebay_ratio
|
||||
sickbeard.THEPIRATEBAY_TRUSTED = config.checkbox_to_value(thepiratebay_trusted)
|
||||
if hasattr(curTorrentProvider, 'digest'):
|
||||
try:
|
||||
curTorrentProvider.digest = kwargs[curTorrentProvider.getID() + '_digest'].strip()
|
||||
except:
|
||||
curTorrentProvider.digest = None
|
||||
|
||||
thepiratebay_proxy = config.checkbox_to_value(thepiratebay_proxy)
|
||||
if thepiratebay_proxy:
|
||||
sickbeard.THEPIRATEBAY_PROXY_URL = thepiratebay_proxy_url.strip()
|
||||
else:
|
||||
sickbeard.THEPIRATEBAY_PROXY_URL = ""
|
||||
if hasattr(curTorrentProvider, 'hash'):
|
||||
try:
|
||||
curTorrentProvider.hash = kwargs[curTorrentProvider.getID() + '_hash'].strip()
|
||||
except:
|
||||
curTorrentProvider.hash = None
|
||||
|
||||
sickbeard.THEPIRATEBAY_PROXY = thepiratebay_proxy
|
||||
if hasattr(curTorrentProvider, 'api_key'):
|
||||
try:
|
||||
curTorrentProvider.api_key = kwargs[curTorrentProvider.getID() + '_api_key'].strip()
|
||||
except:
|
||||
curTorrentProvider.api_key = None
|
||||
|
||||
sickbeard.TORRENTLEECH_USERNAME = torrentleech_username
|
||||
sickbeard.TORRENTLEECH_PASSWORD = torrentleech_password
|
||||
sickbeard.TORRENTLEECH_RATIO = torrentleech_ratio
|
||||
if hasattr(curTorrentProvider, 'username'):
|
||||
try:
|
||||
curTorrentProvider.username = kwargs[curTorrentProvider.getID() + '_username'].strip()
|
||||
except:
|
||||
curTorrentProvider.username = None
|
||||
|
||||
sickbeard.IPTORRENTS_USERNAME = iptorrents_username.strip()
|
||||
sickbeard.IPTORRENTS_PASSWORD = iptorrents_password.strip()
|
||||
sickbeard.IPTORRENTS_RATIO = iptorrents_ratio
|
||||
if hasattr(curTorrentProvider, 'password'):
|
||||
try:
|
||||
curTorrentProvider.password = kwargs[curTorrentProvider.getID() + '_password'].strip()
|
||||
except:
|
||||
curTorrentProvider.password = None
|
||||
|
||||
sickbeard.IPTORRENTS_FREELEECH = config.checkbox_to_value(iptorrents_freeleech)
|
||||
if hasattr(curTorrentProvider, 'confirmed'):
|
||||
try:
|
||||
curTorrentProvider.confirmed = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_confirmed'])
|
||||
except:
|
||||
curTorrentProvider.confirmed = 0
|
||||
|
||||
sickbeard.KAT_TRUSTED = config.checkbox_to_value(kat_trusted)
|
||||
sickbeard.KAT_RATIO = kat_ratio
|
||||
sickbeard.KAT_VERIFIED = config.checkbox_to_value(kat_verified)
|
||||
if hasattr(curTorrentProvider, 'proxy'):
|
||||
try:
|
||||
curTorrentProvider.proxy = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_proxy'])
|
||||
except:
|
||||
curTorrentProvider.proxy = 0
|
||||
|
||||
sickbeard.PUBLICHD_RATIO = publichd_ratio
|
||||
if hasattr(curTorrentProvider, 'proxy_url'):
|
||||
try:
|
||||
curTorrentProvider.proxy_url = kwargs[curTorrentProvider.getID() + '_proxy_url'].strip()
|
||||
except:
|
||||
curTorrentProvider.proxy_url = None
|
||||
|
||||
sickbeard.TORRENTDAY_USERNAME = torrentday_username.strip()
|
||||
sickbeard.TORRENTDAY_PASSWORD = torrentday_password.strip()
|
||||
sickbeard.TORRENTDAY_RATIO = torrentday_ratio
|
||||
if hasattr(curTorrentProvider, 'freeleech'):
|
||||
try:
|
||||
curTorrentProvider.freeleech = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_freeleech'])
|
||||
except:
|
||||
curTorrentProvider.freeleech = 0
|
||||
|
||||
sickbeard.TORRENTDAY_FREELEECH = config.checkbox_to_value(torrentday_freeleech)
|
||||
if hasattr(curTorrentProvider, 'search_mode'):
|
||||
try:
|
||||
curTorrentProvider.search_mode = kwargs[curTorrentProvider.getID() + '_search_mode'].strip()
|
||||
except:
|
||||
curTorrentProvider.search_mode = 'eponly'
|
||||
|
||||
sickbeard.SCC_USERNAME = scc_username.strip()
|
||||
sickbeard.SCC_PASSWORD = scc_password.strip()
|
||||
sickbeard.SCC_RATIO = scc_ratio
|
||||
if hasattr(curTorrentProvider, 'search_fallback'):
|
||||
try:
|
||||
curTorrentProvider.search_fallback = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_search_fallback'])
|
||||
except:
|
||||
curTorrentProvider.search_fallback = 0
|
||||
|
||||
sickbeard.HDTORRENTS_USERNAME = hdtorrents_username.strip()
|
||||
sickbeard.HDTORRENTS_PASSWORD = hdtorrents_password.strip()
|
||||
sickbeard.HDTORRENTS_RATIO = hdtorrents_ratio
|
||||
|
||||
sickbeard.HDBITS_USERNAME = hdbits_username.strip()
|
||||
sickbeard.HDBITS_PASSKEY = hdbits_passkey.strip()
|
||||
sickbeard.HDBITS_RATIO = hdbits_ratio
|
||||
|
||||
sickbeard.OMGWTFNZBS_USERNAME = omgwtfnzbs_username.strip()
|
||||
sickbeard.OMGWTFNZBS_APIKEY = omgwtfnzbs_apikey.strip()
|
||||
|
||||
sickbeard.NEXTGEN_USERNAME = nextgen_username.strip()
|
||||
sickbeard.NEXTGEN_PASSWORD = nextgen_password.strip()
|
||||
sickbeard.NEXTGEN_RATIO = nextgen_ratio
|
||||
|
||||
sickbeard.SPEEDCD_USERNAME = speedcd_username.strip()
|
||||
sickbeard.SPEEDCD_PASSWORD = speedcd_password.strip()
|
||||
sickbeard.SPEEDCD_RATIO = speedcd_ratio
|
||||
sickbeard.SPEEDCD_FREELEECH = config.checkbox_to_value(speedcd_freeleech)
|
||||
sickbeard.OMGWTFNZBS_USERNAME = kwargs['omgwtfnzbs_username'].strip()
|
||||
sickbeard.OMGWTFNZBS_APIKEY = kwargs['omgwtfnzbs_apikey'].strip()
|
||||
|
||||
sickbeard.NEWZNAB_DATA = '!!!'.join([x.configStr() for x in sickbeard.newznabProviderList])
|
||||
sickbeard.PROVIDER_ORDER = provider_list
|
||||
|
Loading…
Reference in New Issue
Block a user