From 48c910c93c23fc36f9c893307b1afe87630eff46 Mon Sep 17 00:00:00 2001 From: Noam Rathaus Date: Tue, 14 May 2024 18:06:31 +0300 Subject: [PATCH] 'new_line' ... not the structure --- lib/core/dictionary.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/core/dictionary.py b/lib/core/dictionary.py index be85ea8c6..f6cd62061 100755 --- a/lib/core/dictionary.py +++ b/lib/core/dictionary.py @@ -145,11 +145,10 @@ def generate(self, files=[], is_blacklist=False): final_lines = [] for new_line in new_lines: # If %DOMAIN% is found, replace it with self.urls (insert as many as they exist) - original_line = new_line['line'] - if DOMAIN_TAG in original_line: + if DOMAIN_TAG in new_line: for hostname in hostnames: split_hostnames = hostname.split(".") - new_line = original_line.replace(DOMAIN_TAG, hostname) + new_line = new_line.replace(DOMAIN_TAG, hostname) final_lines.append(new_line) if len(split_hostnames) > 1: @@ -157,14 +156,14 @@ def generate(self, files=[], is_blacklist=False): # www.somesite.co.uk, somesite.co.uk, co.uk for dots in range(1, len(split_hostnames)): new_hostname = ".".join(split_hostnames[dots:]) - new_line = original_line.replace(DOMAIN_TAG, new_hostname) + new_line = new_line.replace(DOMAIN_TAG, new_hostname) final_lines.append(new_line) # We go from n dot to .. 1 .. as we want to return from www.somesite.co.uk: # www.somesite.co, www.somesite, www for dots in range(1, len(split_hostnames)): new_hostname = ".".join(split_hostnames[:dots]) - new_line = original_line.replace(DOMAIN_TAG, new_hostname) + new_line = new_line.replace(DOMAIN_TAG, new_hostname) final_lines.append(new_line) new_lines = final_lines[:]