Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Jun 9, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from RetroPackets June 9, 2023 22:02
Comment on lines -12 to +15
print("Found " + str(len(results)) + " Results.")
print(f"Found {len(results)} Results.")

for i in results:
string = ""
for j in i:
string += j
string = "".join(i)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 12-17 refactored with the following changes:

titlePrinter()
check = rootcheck()
masterList = []
blacklist = ('http://76qugh5bey5gum7l.onion')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 24-24 refactored with the following changes:

Comment on lines -25 to +31
html = str(content,'utf-8').replace('\t',' ').replace('\n',' ').replace('\r',' ').replace('\"','')
return html
return (
str(content, 'utf-8')
.replace('\t', ' ')
.replace('\n', ' ')
.replace('\r', ' ')
.replace('\"', '')
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function onionHTML refactored with the following changes:

Comment on lines -59 to +64
ahmia = list(set(results))
return ahmia
return list(set(results))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ahmia refactored with the following changes:

Comment on lines -63 to -64
results = []
regex = r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.onion\/?[-a-zA-Z0-9@:%._\/+~#=]{1,256}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function redditOnions refactored with the following changes:

Comment on lines -132 to +148
for i in onions:
temp.append((i.replace("<a href=","").replace(">","")))
temp.extend(i.replace("<a href=","").replace(">","") for i in onions)
for i in temp:
if "http" in i:
if ".onion" not in i:
pass
else:
if ".onion" in i:
temp2.append(i)
elif "mailto:" in i:
pass
elif i.startswith("../"):
i = i.replace("../",inputURL+"/")
i = i.replace("../", f"{inputURL}/")
temp2.append(i)
elif i.startswith("/"):
temp2.append(inputURL+i)
else:
temp2.append(inputURL + "/" + i)
aTag = list(set(temp2))
return aTag
temp2.append(f"{inputURL}/{i}")
return list(set(temp2))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function aTag refactored with the following changes:

def createDB():
con = sqlite3.connect('output/deepminer.db')
return con
return sqlite3.connect('output/deepminer.db')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createDB refactored with the following changes:

Comment on lines -9 to +8
con = sqlite3.connect('output/deepminer.db', timeout=30)
return con
return sqlite3.connect('output/deepminer.db', timeout=30)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function connectDB refactored with the following changes:

Comment on lines -69 to +67
results = cur.fetchall()
return results
return cur.fetchall()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function searchDB refactored with the following changes:

Comment on lines -86 to +83
results = cur.fetchall()
return results
return cur.fetchall()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function searchFTS refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants