mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Remove anonymous redirect
This commit is contained in:
parent
52e2950aa9
commit
5e02db897f
2 changed files with 2 additions and 51 deletions
|
@ -676,27 +676,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox advanced-setting">
|
||||
<label>
|
||||
<input type="checkbox" name="anon_redirect_dynamic" id="anon_redirect_dynamic" value="1" ${config['anon_redirect_dynamic']} /> Use Dynamic Anonymous Redirect Service
|
||||
</label>
|
||||
<p class="help-block">
|
||||
Allow Tautulli to use the dynamic anonymous redirect service listed <a href="${anon_url('https://tautulli.com/anonymizer.txt')}" target="_blank" rel="noreferrer">here</a>.
|
||||
Disable to specify your own service.
|
||||
</p>
|
||||
</div>
|
||||
<div id="anon_redirect_options">
|
||||
<div class="form-group advanced-setting">
|
||||
<label for="anon_redirect">Anonymous Redirect Service</label>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" id="anon_redirect" name="anon_redirect" value="${config['anon_redirect']}" size="30">
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block">Backlink protection via anonymizer service, must end in "?". Leave blank to disable.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padded-header">
|
||||
<h3>Authentication</h3>
|
||||
</div>
|
||||
|
@ -2416,7 +2395,6 @@ $(document).ready(function() {
|
|||
|
||||
initConfigCheckbox('#api_enabled');
|
||||
initConfigCheckbox('#enable_https');
|
||||
initConfigCheckbox('#anon_redirect_dynamic', null, true);
|
||||
initConfigCheckbox('#https_create_cert');
|
||||
initConfigCheckbox('#check_github');
|
||||
initConfigCheckbox('#monitor_pms_updates');
|
||||
|
|
|
@ -784,36 +784,9 @@ def whois_lookup(ip_address):
|
|||
return whois_info
|
||||
|
||||
|
||||
# Taken from SickRage
|
||||
def anon_url(*url):
|
||||
"""
|
||||
Return a URL string consisting of the Anonymous redirect URL and an arbitrary number of values appended.
|
||||
"""
|
||||
if plexpy.CONFIG.ANON_REDIRECT_DYNAMIC:
|
||||
cache_time = timestamp()
|
||||
cache_filepath = os.path.join(plexpy.CONFIG.CACHE_DIR, 'anonymizer.json')
|
||||
try:
|
||||
with open(cache_filepath, 'r', encoding='utf-8') as cache_file:
|
||||
cache_data = json.load(cache_file)
|
||||
if cache_time - cache_data['_cache_time'] < 86400: # 24 hours
|
||||
anon_redirect = cache_data['anon_redirect']
|
||||
else:
|
||||
raise
|
||||
except:
|
||||
try:
|
||||
anon_redirect = request.request_content('https://tautulli.com/anonymizer.txt').decode('utf-8')
|
||||
cache_data = {
|
||||
'anon_redirect': anon_redirect,
|
||||
'_cache_time': cache_time
|
||||
}
|
||||
with open(cache_filepath, 'w', encoding='utf-8') as cache_file:
|
||||
json.dump(cache_data, cache_file)
|
||||
except:
|
||||
anon_redirect = plexpy.CONFIG.ANON_REDIRECT
|
||||
else:
|
||||
anon_redirect = plexpy.CONFIG.ANON_REDIRECT
|
||||
|
||||
return '' if None in url else '%s%s' % (anon_redirect, ''.join(str(s) for s in url))
|
||||
# Removed anonymous redirect and just return the URL
|
||||
return '' if None in url else ''.join(str(s) for s in url)
|
||||
|
||||
|
||||
def get_img_service(include_self=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue