Remove anonymous redirect

This commit is contained in:
JonnyWong16 2024-04-18 12:15:01 -07:00
commit 5e02db897f
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 2 additions and 51 deletions

View file

@ -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):