minor bug fix, both issue 80 and 20 are done

This commit is contained in:
doctor_dev 2025-06-06 21:00:10 +00:00
parent 14231fff92
commit fde645fd60
No known key found for this signature in database
GPG key ID: F12F7F71CB84AEAA
3 changed files with 32 additions and 8 deletions

View file

@ -1,7 +1,7 @@
from utils import *
import logic.lantern_logic as lantern
from dotenv import load_dotenv
import options
import logic.options as options
import os, pwd
@ -533,7 +533,7 @@ Maintenance:
#####################################################
case 4:
options.run_option_4()
break
@ -679,7 +679,6 @@ Maintenance:
case 6:
options.run_option_6()
break

View file

@ -1,8 +1,15 @@
import shutil
import os
import utils
import conf
import lantern_logic as lantern
import logic.lantern_logic as lantern
def run_option_4():
"""
Running option 4: syncing all links from official and registered webrings
"""
try:
utils.print_colors("4) Synchronize new links from new or existing webring participants, into your local csv files")
@ -70,6 +77,10 @@ def run_option_4():
utils.print_colors("[-] Option 4 failed suddently, please try again", is_error=True)
def run_option_6():
"""
Running option 6: Trusting/Untrusting/Blacklisting a webring participant
"""
while True:
utils.print_colors("[+] Trust/UnTrust/Blacklist a webring participant (Potentially dangerous)")
@ -164,6 +175,10 @@ def run_option_6():
utils.print_colors("[-] Option 6 failed suddently, please try again", is_error=True)
def run_option_9():
"""
Running option 9: cleans duplications in local instance verified and unverified csv files
"""
utils.print_colors("[+] 9) Cleaning up all duplicates in your own unverified + verified.csv (based on the url)")
try:
@ -181,6 +196,10 @@ def run_option_9():
utils.print_colors("[-] Option 9 failed suddenly, please try again", is_error=True)
def run_option_10():
"""
Running option 10: go over all verified and unverified participants csv files
"""
utils.print_colors("[+] 10) perform sanity checks on all csv files (to mark them as sensitive / or remove the ones that are blacklisted)")
try:
@ -191,6 +210,9 @@ def run_option_10():
for participant in os.listdir(conf.PARTICIPANT_DIR):
participant_local_dir = conf.PARTICIPANT_DIR + participant + '/'
if not os.path.exists(f'{participant_local_dir}verified.csv'):
continue
utils.print_colors('[+] Reading webrring participant\'s verified and unverified')
participant_verified_df, participant_unverified_df = utils.get_participant_local_verified_and_unverified(participant_local_dir)
@ -206,8 +228,7 @@ def run_option_10():
utils.save_local_participant_verified_and_unverified(participant_verified_df, participant_unverified_df, participant_local_dir)
except Exception as err:
utils.print_colors("[-] Option 10 failed suddently, please try again", is_error=True)
utils.print_colors("[-] Option 10 failed suddenly, please try again", is_error=True)

View file

@ -28,8 +28,12 @@ def get_current_instance():
#expanduser gives the current user directory
instance_file = os.path.expanduser("~") + '/.darknet_participant_url'
with open(instance_file) as f:
return f.read().rstrip()
if os.path.exists(instance_file):
with open(instance_file) as f:
return f.read().rstrip()
else:
return ""
#Set the local dir on script run
conf.LOCAL_DIR = conf.PARTICIPANT_DIR + get_current_instance() + '/'