From 6cfc27cb876d7f167b7e1870aa7c4280d6500b21 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sun, 31 Jan 2021 17:36:43 -0600 Subject: [PATCH] Slightly better that hard coding ffnet domain in. --- fanficfare/browsercache/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fanficfare/browsercache/__init__.py b/fanficfare/browsercache/__init__.py index 175a960e..6e6f4af4 100644 --- a/fanficfare/browsercache/__init__.py +++ b/fanficfare/browsercache/__init__.py @@ -22,5 +22,13 @@ class BrowserCache(object): ## newer browser caches separate by calling domain to not ## leak information about past visited pages by showing ## quick retrieval. - d = self.browser_cache.get_data("_dk_https://fanfiction.net https://fanfiction.net "+url) + + ## There has to be a better way to do this... + ## Or parse the whole cache for proper URLs. + # protocol & domain only. + prefix = ('/'.join(url.split('/')[:3])).replace('www.','') + key = "_dk_"+prefix+" "+prefix+" "+url + # print(key) + # print("_dk_https://fanfiction.net https://fanfiction.net "+url) + d = self.browser_cache.get_data(key) return d