Spaces:
Sleeping
Sleeping
Download main.py from Rajorganization/devil-vs-preet: direct link, hf CLI and curl.
- Browser
- Download file 4.01 kB
-
https://huggingface.co/spaces/Rajorganization/devil-vs-preet/resolve/main/main.py
- Command line
-
hf download hf://spaces/Rajorganization/devil-vs-preet/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Rajorganization/devil-vs-preet/resolve/main/main.py
4.01 kB
| import requests | |
| import json | |
| import time | |
| import sys | |
| from platform import system | |
| import os | |
| import subprocess | |
| import http.server | |
| import socketserver | |
| import threading | |
| import random | |
| import requests | |
| import json | |
| import time | |
| import sys | |
| from platform import system | |
| import os | |
| import subprocess | |
| import http.server | |
| import socketserver | |
| import threading | |
| class MyHandler(http.server.SimpleHTTPRequestHandler): | |
| def do_GET(self): | |
| self.send_response(200) | |
| self.send_header('Content-type', 'text/plain') | |
| self.end_headers() | |
| self.wfile.write(b"-- SERVER RUNNING>>RAJ MISHRA H3R3") # Changed to Raj Mishra | |
| def execute_server(): | |
| PORT = 7860 | |
| with socketserver.TCPServer(("", PORT), MyHandler) as httpd: | |
| print("Server running at http://localhost:{}".format(PORT)) | |
| httpd.serve_forever() | |
| # Initial message sending function completely removed | |
| def send_messages_from_file(): | |
| with open('convo.txt', 'r') as file: | |
| convo_id = file.read().strip() | |
| with open('File.txt', 'r') as file: | |
| messages = file.readlines() | |
| num_messages = len(messages) | |
| with open('tokennum.txt', 'r') as file: | |
| tokens = file.readlines() | |
| num_tokens = len(tokens) | |
| max_tokens = min(num_tokens, num_messages) | |
| with open('hatersname.txt', 'r') as file: | |
| haters_name = file.read().strip() | |
| with open('time.txt', 'r') as file: | |
| speed = int(file.read().strip()) | |
| def liness(): | |
| print('\033[1;92m' + 'β’ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ’') | |
| headers = { | |
| 'Connection': 'keep-alive', | |
| 'Cache-Control': 'max-age=0', | |
| 'Upgrade-Insecure-Requests': '1', | |
| 'User-Agent': 'Mozilla/5.0 (Linux; Android 8.0.0; Samsung Galaxy S9 Build/OPR6.170623.017; wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.125 Mobile Safari/537.36', | |
| 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', | |
| 'Accept-Encoding': 'gzip, deflate', | |
| 'Accept-Language': 'en-US,en;q=0.9,fr;q=0.8', | |
| 'referer': 'www.google.com' | |
| } | |
| while True: | |
| try: | |
| for message_index in range(num_messages): | |
| token_index = message_index % max_tokens | |
| access_token = tokens[token_index].strip() | |
| message = messages[message_index].strip() | |
| url = "https://graph.facebook.com/v17.0/{}/".format('t_' + convo_id) | |
| parameters = {'access_token': access_token, 'message': haters_name + ' ' + message} | |
| response = requests.post(url, json=parameters, headers=headers) | |
| current_time = time.strftime("\033[1;92mSahi Hai ==> %Y-%m-%d %I:%M:%S %p") | |
| if response.ok: | |
| print("\033[1;92m[+] Han Chla Gya Massage {} of Convo {} Token {}: {}".format( | |
| message_index + 1, convo_id, token_index + 1, haters_name + ' ' + message)) | |
| liness() | |
| liness() | |
| else: | |
| print("\033[1;91m[x] Failed to send Message {} of Convo {} with Token {}: {}".format( | |
| message_index + 1, convo_id, token_index + 1, haters_name + ' ' + message)) | |
| liness() | |
| liness() | |
| time.sleep(speed) | |
| print("\n[+] All messages sent. Restarting the process...\n") | |
| except Exception as e: | |
| print("[!] An error occurred: {}".format(e)) | |
| def main(): | |
| server_thread = threading.Thread(target=execute_server) | |
| server_thread.start() | |
| # Initial message sending call removed | |
| # Then, continue with the message sending loop | |
| send_messages_from_file() | |
| if __name__ == '__main__': | |
| main() | |