From 1bfdcbe12a3828d180e036cb6ecebbfa4560de57 Mon Sep 17 00:00:00 2001 From: X0RW3LL Date: Sun, 28 Jul 2024 06:13:48 +0300 Subject: [PATCH] Fix Python 3.12 Syntax Warnings (use raw strings) --- maryam/core/util/helpers/web_scrap.py | 2 +- maryam/core/util/iris/cluster.py | 2 +- maryam/modules/footprint/crawl_pages.py | 2 +- maryam/modules/osint/cloud_storage.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/maryam/core/util/helpers/web_scrap.py b/maryam/core/util/helpers/web_scrap.py index 6a196cad8..0712a1ade 100644 --- a/maryam/core/util/helpers/web_scrap.py +++ b/maryam/core/util/helpers/web_scrap.py @@ -136,7 +136,7 @@ def link_category(self, urls): if cond1: continue - join = str(join).replace('\/', '/') + join = str(join).replace(r'\/', '/') ########################## # ADD OUT SCOPE ########################## diff --git a/maryam/core/util/iris/cluster.py b/maryam/core/util/iris/cluster.py index 3e9e4528e..58a756a6d 100644 --- a/maryam/core/util/iris/cluster.py +++ b/maryam/core/util/iris/cluster.py @@ -31,7 +31,7 @@ def remove_stopwords(self, text): return [x for x in text if x not in stops] def tokenize_and_stem(self, text): - tokens = re.findall("[A-Z]{2,}(?![a-z])|[A-Z][a-z]+(?=[A-Z])|[\'\w\-]+",text) + tokens = re.findall(r"[A-Z]{2,}(?![a-z])|[A-Z][a-z]+(?=[A-Z])|[\'\w\-]+",text) filtered_tokens = [] for token in tokens: if re.search('[a-zA-Z]', token): diff --git a/maryam/modules/footprint/crawl_pages.py b/maryam/modules/footprint/crawl_pages.py index 880dcb94c..805ff2664 100644 --- a/maryam/modules/footprint/crawl_pages.py +++ b/maryam/modules/footprint/crawl_pages.py @@ -30,7 +30,7 @@ ('debug', False, False, 'debug the scraper', '--debug', 'store_true', bool), ('thread', 1, False, 'The number of links that open per round', '-t', 'store', int), ), - 'examples': ('crawl_pages -d -r "https?://[A-z0-9\./]+"\ + 'examples': (r'crawl_pages -d -r "https?://[A-z0-9\./]+"\ --output', 'crawl_pages -d --limit 2 --more') } diff --git a/maryam/modules/osint/cloud_storage.py b/maryam/modules/osint/cloud_storage.py index 32b68ae57..95a3c949f 100644 --- a/maryam/modules/osint/cloud_storage.py +++ b/maryam/modules/osint/cloud_storage.py @@ -70,7 +70,7 @@ def module_api(self): self.thread(search, self.options['thread'], engine, query, q_formats, limit, count, meta['sources']) output['links'] += list( self.reglib().filter(r"https?://([\w\-\.]+\.)?"\ - + site_url.replace('.','\.')+"/", list( set(LINKS) ) ) ) #escaping . for regex search using replace() + + site_url.replace('.',r'\.')+"/", list( set(LINKS) ) ) ) #escaping . for regex search using replace() self.save_gather(output, 'osint/cloud_storage', query, output=self.options.get('output')) return output