From df1f421072f9b85d68caf221e8674245cd232afd Mon Sep 17 00:00:00 2001 From: Official-Husko Date: Tue, 25 Jun 2024 16:17:20 +0200 Subject: [PATCH] remove deprecated sites --- .gitignore | 34 ++--- modules/deprecated/README.md | 6 - modules/deprecated/anonfiles.py | 55 ------- modules/deprecated/anonfilesme.py | 64 -------- modules/deprecated/anonymfile-api.py | 66 --------- modules/deprecated/anyfile.py | 64 -------- modules/deprecated/bayfiles.py | 55 ------- modules/deprecated/bayfilesio.py | 64 -------- modules/deprecated/bunkrr.py | 202 -------------------------- modules/deprecated/filechan.py | 55 ------- modules/deprecated/filemail.py | 60 -------- modules/deprecated/filestore.py | 88 ----------- modules/deprecated/filetransfer.py | 170 ---------------------- modules/deprecated/gofilecc.py | 64 -------- modules/deprecated/hotfile.py | 55 ------- modules/deprecated/krakenfiles_api.py | 71 --------- modules/deprecated/letsupload.py | 55 ------- modules/deprecated/lolabits.py | 55 ------- modules/deprecated/megaupload.py | 55 ------- modules/deprecated/myfile.py | 55 ------- modules/deprecated/nitrofile.py | 64 -------- modules/deprecated/openload.py | 54 ------- modules/deprecated/rapidshare.py | 55 ------- modules/deprecated/shareonline.py | 55 ------- modules/deprecated/udrop.py | 117 --------------- modules/deprecated/up2share.py | 130 ----------------- modules/deprecated/upvid.py | 55 ------- modules/deprecated/vshare.py | 55 ------- modules/deprecated/wetransfer.py | 189 ------------------------ modules/deprecated/yourfilestore.py | 84 ----------- 30 files changed, 9 insertions(+), 2242 deletions(-) delete mode 100644 modules/deprecated/README.md delete mode 100644 modules/deprecated/anonfiles.py delete mode 100644 modules/deprecated/anonfilesme.py delete mode 100644 modules/deprecated/anonymfile-api.py delete mode 100644 modules/deprecated/anyfile.py delete mode 100644 modules/deprecated/bayfiles.py delete mode 100644 modules/deprecated/bayfilesio.py delete mode 100644 modules/deprecated/bunkrr.py delete mode 100644 modules/deprecated/filechan.py delete mode 100644 modules/deprecated/filemail.py delete mode 100644 modules/deprecated/filestore.py delete mode 100644 modules/deprecated/filetransfer.py delete mode 100644 modules/deprecated/gofilecc.py delete mode 100644 modules/deprecated/hotfile.py delete mode 100644 modules/deprecated/krakenfiles_api.py delete mode 100644 modules/deprecated/letsupload.py delete mode 100644 modules/deprecated/lolabits.py delete mode 100644 modules/deprecated/megaupload.py delete mode 100644 modules/deprecated/myfile.py delete mode 100644 modules/deprecated/nitrofile.py delete mode 100644 modules/deprecated/openload.py delete mode 100644 modules/deprecated/rapidshare.py delete mode 100644 modules/deprecated/shareonline.py delete mode 100644 modules/deprecated/udrop.py delete mode 100644 modules/deprecated/up2share.py delete mode 100644 modules/deprecated/upvid.py delete mode 100644 modules/deprecated/vshare.py delete mode 100644 modules/deprecated/wetransfer.py delete mode 100644 modules/deprecated/yourfilestore.py diff --git a/.gitignore b/.gitignore index d575715..fb60d53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,12 @@ -/.env -/config.json -/runtime.log -/user_agents.json -/__pycache__ -modules/__pycache__ -git_message_rules -file_links.txt -/dist -developer_accounts.json -outdated -art/Icon.ai -art/site_banners.ai -file_links_formatted.txt +.DEBUG config_old.json -run.bat -build -Mul-Tor.spec -Build Releases.bat -presets/readme.txt +config.json +developer_accounts.json +git_message_rules possible_sites.txt -preset_sorter.py preset_sorter.json -.DEBUG -/test_files -*.zstd -/modules/old_scripts/ -/modules/deprecated/ +preset_sorter.py +/.env/ +/test_files/ +art/site_banners.ai +art/Icon.ai diff --git a/modules/deprecated/README.md b/modules/deprecated/README.md deleted file mode 100644 index 127c802..0000000 --- a/modules/deprecated/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Deprecated site scripts. - -All site scripts in this folder are deprecated for one or more reasons. Most of the site scripts will be here due to Website Takedowns. They are stored here for preservation templates reasons, to be fixed and added again or if needed for anything else. - - -Some scripts are here because I can't get them to work but they will most likely have most of the code complete to make it work and require minimal tweaking to make them work completely. \ No newline at end of file diff --git a/modules/deprecated/anonfiles.py b/modules/deprecated/anonfiles.py deleted file mode 100644 index 9aedd03..0000000 --- a/modules/deprecated/anonfiles.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -""" -Last Checked 24/03/2024 -""" - -""" - -"AnonFiles": { - "apiKey": False, - "url": "https://api.anonfiles.com/upload", - "api_url": "https://api.anonfiles.com/", - "download_url_base": "https://anonfiles.com/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -} - -""" - -site = "AnonFiles" - -class AnonFiles: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/anonfilesme.py b/modules/deprecated/anonfilesme.py deleted file mode 100644 index b182477..0000000 --- a/modules/deprecated/anonfilesme.py +++ /dev/null @@ -1,64 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "AnonFilesMe" - -""" -Last Checked 24/03/2024 -""" - -""" - -"AnonFilesMe": { - "apiKey": False, - "url": "https://anonfiles.me/api/v1/upload", - "api_url": "https://anonfiles.me/", - "download_url_base": "https://anonfiles.me/", - "size_limit": 7, - "size_unit": "GB" -}, - -""" - -class AnonFilesMe: - - def Uploader(file, proxy_list, user_agents, api_keys): - raw_req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies) - - response = raw_req.json() - download_url = response.get("data", {}).get("file", {}).get("url", {}).get("short", "") - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/anonymfile-api.py b/modules/deprecated/anonymfile-api.py deleted file mode 100644 index 41ede30..0000000 --- a/modules/deprecated/anonymfile-api.py +++ /dev/null @@ -1,66 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "Anonymfile" - -""" -Last Checked 24/03/2024 -This is the API version of Anonymfile. They broke the API a while ago so i replaced it with the non-api variant for now. - -""" - -""" - - "Anonymfile": { - "apiKey": False, - "url": "https://anonymfile.com/api/v1/upload", - "api_url": "https://anonymfile.com/", - "download_url_base": "https://anonymfile.com/", - "size_limit": 7, - "size_unit": "GB" - }, - -""" - -class Anonymfile: - - def Uploader(file, proxy_list, user_agents, api_keys): - raw_req = "None :(" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies) - - response = raw_req.json() - download_url = response.get("data", {}).get("file", {}).get("url", {}).get("short", "") - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/anyfile.py b/modules/deprecated/anyfile.py deleted file mode 100644 index 9632339..0000000 --- a/modules/deprecated/anyfile.py +++ /dev/null @@ -1,64 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "AnyFile" - -""" -Last Checked 24/03/2024 -""" - -""" - -"AnyFile": { - "apiKey": False, - "url": "https://anyfile.co/api/v1/upload", - "api_url": "https://anyfile.co/", - "download_url_base": "https://anyfile.co/", - "size_limit": 7, - "size_unit": "GB" -}, - -""" - -class AnyFile: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies) - - response = raw_req.json() - download_url = response.get("data", {}).get("file", {}).get("url", {}).get("short", "") - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/bayfiles.py b/modules/deprecated/bayfiles.py deleted file mode 100644 index 6efcbd5..0000000 --- a/modules/deprecated/bayfiles.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "BayFiles" - -""" -Last Checked 24/03/2024 -""" - -""" - -"BayFiles": { - "apiKey": False, - "url": "https://api.bayfiles.com/upload", - "api_url": "https://api.bayfiles.com/", - "download_url_base": "https://bayfiles.com/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -} - -""" - -class BayFiles: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/bayfilesio.py b/modules/deprecated/bayfilesio.py deleted file mode 100644 index 8430058..0000000 --- a/modules/deprecated/bayfilesio.py +++ /dev/null @@ -1,64 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "BayFilesIo" - -""" -Last Checked 24/03/2024 -""" - -""" - -"BayFilesIo": { - "apiKey": False, - "url": "https://bayfiles.io/api/v1/upload", - "api_url": "https://bayfiles.io/", - "download_url_base": "https://bayfiles.io/", - "size_limit": 7, - "size_unit": "GB" -}, - -""" - -class BayFilesIo: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies) - - response = raw_req.json() - download_url = response.get("data", {}).get("file", {}).get("url", {}).get("short", "") - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/bunkrr.py b/modules/deprecated/bunkrr.py deleted file mode 100644 index 85f1556..0000000 --- a/modules/deprecated/bunkrr.py +++ /dev/null @@ -1,202 +0,0 @@ -import requests -import os -import random -import uuid -import re - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "Bunkrr" - -""" -Last Checked 24/03/2024 -""" - -# https://github.com/Official-Husko/mul-tor/discussions/13 - -""" - -"Bunkrr": { - "apiKey": True, - "url": "{server}", - "api_url": "https://app.bunkrr.su/", - "download_url_base": "https://bunkrr.ru/d/", - "server_url": "https://app.bunkrr.su/api/node", - "options_url": "https://app.bunkrr.su/api/check", - "finalize_url": "{server}/finishchunks" -}, - -""" - - -class Bunkrr: - def Uploader(file, proxy_list, user_agents, api_keys): - """ - Uploads a file to a specified site using random user agents and proxies. - - Args: - file (str): The path to the file to be uploaded. - proxy_list (list): A list of proxy URLs. - user_agents (list): A list of user agent strings. - - Returns: - dict: A dictionary containing the status, file name, file URL, and site. - - Raises: - Exception: If an error occurs during the upload process. - """ - raw_req = "None :(" - try: - download_url_base = sites_data_dict[site]["download_url_base"] - # Select a random user agent - ua = random.choice(user_agents) - - # Get the file size and name - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - - # Truncate the file name if it is too long - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name - - # Select a random proxy, if available - proxies = random.choice(proxy_list) if proxy_list else None - - api_token = api_keys.get("token", False) - - if api_token in (False, ""): - raise Exception("Missing API Credentials?") - - options_url = sites_data_dict[site]["options_url"] - - headers = { - "User-Agent": ua, - "Accept": "application/json", - } - - raw_req = requests.get(url=options_url, headers=headers, proxies=proxies, timeout=300) - raw_req = raw_req.json() - - max_file_size = raw_req.get("maxSize", "0B") - chunk_size = raw_req.get("chunkSize", {}).get("max", "0B") - file_blacklist = raw_req.get("stripTags", {}).get("blacklistExtensions", []) - - if max_file_size == "0B" or chunk_size == "0B": - raise Exception("Invalid max file size or chunk size") - - # TODO: check if either one is 0 and abort - - units_to_calc = [max_file_size, chunk_size] - units_calculated = [] - - for unit in units_to_calc: - size_str = unit.lower() - unit_multiplier = {'b': 1, 'kb': 1024, 'mb': 1024 ** 2, 'gb': 1024 ** 3, 'tb': 1024 ** 4} - match = re.match(r'^(\d+)([a-z]+)$', size_str) - - if match: - value, unit = match.groups() - bytes_size = int(value) * unit_multiplier.get(unit, 1) - units_calculated.append(bytes_size) - else: - raise ValueError("Invalid input format") - - max_file_size = units_calculated[0] - chunk_size = units_calculated[1] - - file_uuid = str(uuid.uuid4()) - - _, file_extension = os.path.splitext(file_name) - - if file_size <= max_file_size: - if file_extension in file_blacklist: - raise Exception(f"File is blacklisted! {file_blacklist}") - - # Get server URL - server_url = sites_data_dict[site]["server_url"] - - headers = { - "User-Agent": ua, - "Accept": "application/json", - "token": api_token - } - - raw_req = requests.get(url=server_url, headers=headers, proxies=proxies, timeout=300) - - try: - raw_req = raw_req.json() - if not raw_req.get("success", False) == True: - raise Exception("Failed to get server URL. Error: Success was somehow false? Report this!") - upload_url = raw_req.get("url", "") - - except Exception as e: - raise Exception(f"Failed to get server URL. Error: {e}") - - chunk_size = 25000000 - total_chunks = (file_size + chunk_size - 1) // chunk_size - chunk_index = 0 - dzchunkbyteoffset = 0 - - with open(file, 'rb') as file_data: - while True: - chunk_data = file_data.read(chunk_size) - if not chunk_data: - break # Exit the loop if we've reached the end of the file - - upload_data = { - "dzuuid": file_uuid, - "dzchunkindex": chunk_index, - "dztotalfilesize": file_size, - "dzchunksize": chunk_size, - "dztotalchunkcount": total_chunks, - "dzchunkbyteoffset": dzchunkbyteoffset - } - - # Prepare the json data to add extra data to the upload - form_data = { - 'files[]': (os.path.basename(file), chunk_data, 'application/octet-stream') - } - - # Send the upload request with the form data, headers, and proxies - raw_req = requests.post(url=upload_url, data=upload_data, files=form_data, headers=headers, proxies=proxies, timeout=300) - - raw_req = raw_req.json() - - if not raw_req.get("success", False) == True: - raise Exception("Upload failed somehow? Please Report this!") - - chunk_index += 1 - dzchunkbyteoffset += chunk_size - - # final request to get the data - upload_data = { - "files": [ - { - "uuid": file_uuid, - "original": file_name, - "type": "application/octet-stream", - "albumid": "", - "filelength": "", - "age": "" - } - ] - } - - finalize_url = sites_data_dict[site]["finalize_url"].format(server=upload_url) - - raw_req = requests.post(url=finalize_url, data=upload_data, headers=headers, proxies=proxies, timeout=300) - - json_req = raw_req.json() - - if json_req.get("success", False) == True: - file_url = json_req["files"][0]["url"] - - # Return successful message with the status, file name, file URL, and site - return {"status": "ok", "file_name": file_name, "file_url": file_url} - else: - # Return size error message - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - except Exception as e: - # Return error message - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/filechan.py b/modules/deprecated/filechan.py deleted file mode 100644 index e009c73..0000000 --- a/modules/deprecated/filechan.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "FileChan" - -""" -Last Checked 24/03/2024 -""" - -""" - -"FileChan": { - "apiKey": False, - "url": "https://api.filechan.org/upload", - "api_url": "https://api.filechan.org/", - "download_url_base": "https://filechan.org/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class FileChan: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/filemail.py b/modules/deprecated/filemail.py deleted file mode 100644 index aee4272..0000000 --- a/modules/deprecated/filemail.py +++ /dev/null @@ -1,60 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from .logger import Logger - -from main import DEBUG - -site = "FileMail" - -""" -Last Checked 24/03/2024 -""" - -""" - -Shitty 2 uploads limit per day. Even the initializing counts as one. - -""" - -class FileMail: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - base_url = sites_data_dict[site]["download_url_base"] - server_url = sites_data_dict[site]["server_url"].format(api_key=api_key) - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '') if len(file_name) > 240 else file_name # Changed from 255 to 15 as an additional safety net. - - # upload_url = sites_data_dict[site]["url"].format(server=server) - - headers = {"User-Agent": ua, "Content-Type": "application/octet-stream", "accept": "application/json"} - - # Initialize file upload and get server url - if proxy_list == []: - req = requests.post(url=server_url, headers=headers) - else: - req = requests.put(url=server_url, data=file_upload, headers=headers, proxies=random.choice(proxy_list)) - - - with open(file, "rb") as file_upload: - if proxy_list == []: - req = requests.post(url=rand_url, data=file_upload, headers=headers) - else: - req = requests.put(url=rand_url, data=file_upload, headers=headers, proxies=random.choice(proxy_list)) - file_upload.close() - if req.status_code == 201: - return {"status": "ok", "file_name": file_name, "file_url": rand_url} - else: - raise Exception("Wrong Response Code. View request body below or in log file.") - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/filestore.py b/modules/deprecated/filestore.py deleted file mode 100644 index 0a4e733..0000000 --- a/modules/deprecated/filestore.py +++ /dev/null @@ -1,88 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "FileStore" - -""" -Last Checked 24/03/2024 -""" - -""" - -"FileStore": { - "apiKey": True, - "url": "{server}", - "api_url": "https://filestore.me/", - "download_url_base": "https://filestore.me/", - "server_url": "https://filestore.me/?op=upload_form", - "size_limit": 100, - "size_unit": "MB" -}, - -""" - -class FileStore: - - def Uploader(file, proxy_list, user_agents, api_keys): - raw_req = "None :(" - try: - ua = random.choice(user_agents) - url = sites_data_dict[site]["api_url"] - download_url_base = sites_data_dict[site]["download_url_base"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - api_username = api_keys.get("username", False) - api_password = api_keys.get("password", False) - - if api_username in (False, "") or api_password in (False, ""): - raise Exception("Missing API Credentials?") - - # Execute Login for session id - data = { - "op": "login", - "login": api_username, - "password": api_password - } - - raw_req = requests.post(url=url, data=data, headers=headers, proxies=proxies) - - if raw_req.status_code == 200: - session_id = raw_req.cookies.get("xfss") - - if calc_size == "OK": - data = { - "sess_id": file_id, - "keepalive": 1 - } - form_data = { - 'file_0': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, data=data, files=form_data, headers=headers, proxies=proxies, stream=True) - - if raw_req.status_code == 200: - return {"status": "ok", "file_name": file_name, "file_url": download_url_base + file_id} - else: - raise Exception(f"Status code: {raw_req.status_code}") - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/filetransfer.py b/modules/deprecated/filetransfer.py deleted file mode 100644 index 107c15c..0000000 --- a/modules/deprecated/filetransfer.py +++ /dev/null @@ -1,170 +0,0 @@ -import requests -import os -import random -import base64 - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "FileTransfer" - -""" -Last Checked 24/03/2024 -""" - -""" - -"FileTransfer": { - "apiKey": False, - "url": "{server}", - "api_url": "https://filetransfer.io/", - "download_url_base": "https://filetransfer.io/data-package/", - "server_url": "https://filetransfer.io/api/v1/upload", - "initialize_url": "https://filetransfer.io/start-upload", - "finalize_url": "{final_url}", - "size_limit": 6, - "size_unit": "GB" -}, - -""" - -""" - -Throws 415 errors even tho it should all be correct. wasted too much time for something this poorly coded. -To whoever made this site and system go fuck yourself and do us all a favor and stop coding things. - -~ An edit 3 months later. I was a bit angry yes. - -""" - -class FileTransfer: - def Uploader(file, proxy_list, user_agents, api_keys): - """ - Uploads a file to a specified site using random user agents and proxies. - - Args: - file (str): The path to the file to be uploaded. - proxy_list (list): A list of proxy URLs. - user_agents (list): A list of user agent strings. - - Returns: - dict: A dictionary containing the status, file name, file URL, and site. - - Raises: - Exception: If an error occurs during the upload process. - """ - try: - # Select a random user agent - ua = random.choice(user_agents) - - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - # Get the file size and name - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - - # Get the upload URL and size limit from the site data dictionary - initialize_url = sites_data_dict[site]["initialize_url"] - - # Truncate the file name if it is too long - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name - - # Calculate the size unit for the site - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - # Set the user agent header - headers = { - "User-Agent": ua, - "X-Requested-With": "XMLHttpRequest" - } - - # Select a random proxy, if available - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - # Send the upload request with the form data, headers, and proxies - init_req = requests.get(url=initialize_url, headers=headers, proxies=proxies) - - # Parse the response JSON and get the download URL - init_resp = init_req.json() - server_url = init_resp.get("uploadUrl", "") - - base64_filename = base64.b64encode(file_name.encode('utf-8')) - base64_filename = base64_filename.decode('utf-8') - print(base64_filename) - - headers = { - "User-Agent": ua, - "Tus-Resumable": "1.0.0", - "Upload-Length": f"{file_size}", - "Upload-Metadata": f"filename {base64_filename},filetype ,fileorder MQ==", - } - - server_req = requests.post(url=server_url, headers=headers, proxies=proxies) - - print(server_req.status_code) - print(server_req.headers) - - parts = server_url.split("/") - print(parts) - upload_url_start = parts[2] - print(upload_url_start) - - server_location = server_req.headers["Location"] - upload_url = f"https://{upload_url_start}{server_location}" - print(upload_url) - - chunk_size = 10485760 # 10 MB (WHO THE FUCK DOES THIS SHIT IN 10MB CHUNKS? THIS WEBSITE IS FUCKED) - chunk_offset = 0 - - with open(file, 'rb') as file_data: - while True: - chunk_data = file_data.read(chunk_size) - if not chunk_data: - break # Exit the loop if we've reached the end of the file - - base64_filename = base64.b64encode(file_name.encode('utf-8')) - - headers = { - "User-Agent": ua, - "Tus-Resumable": "1.0.0", - "Upload-Offset": f"{chunk_offset}" - } - print(headers) - - form_data = { - 'file': (os.path.basename(file), chunk_data, 'application/offset+octet-stream') - } - - # Send the upload request with the form data, headers, and proxies - raw_req = requests.patch(url=upload_url, files=form_data, headers=headers, proxies=proxies, timeout=300) - - print(raw_req.status_code) - - if raw_req.status_code == 200 or raw_req.status_code == 204: - print("chunk uploaded") - - chunk_offset += chunk_size - - headers = { - "User-Agent": ua, - "X-Requested-With": "XMLHttpRequest" - } - - raw_req = requests.post(url=upload_url, headers=headers, proxies=proxies, timeout=300) - print(raw_req.text) - - upload_resp = raw_req.json() - - download_url = upload_resp.get("deliveryPublicLink", "") - - # Return successful message with the status, file name, file URL, and site - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - # Return size error message - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - except Exception as e: - # Return error message - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/gofilecc.py b/modules/deprecated/gofilecc.py deleted file mode 100644 index c5ba257..0000000 --- a/modules/deprecated/gofilecc.py +++ /dev/null @@ -1,64 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "GoFileCC" - -""" -Last Checked 24/03/2024 -""" - -""" - -"GoFileCC": { - "apiKey": False, - "url": "https://gofile.cc/api/v1/upload", - "api_url": "https://gofile.cc/", - "download_url_base": "https://gofile.cc/", - "size_limit": 7, - "size_unit": "GB" -}, - -""" - -class GoFileCC: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies, stream=True) - - response = raw_req.json() - download_url = response.get("data", {}).get("file", {}).get("url", {}).get("short", "") - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/hotfile.py b/modules/deprecated/hotfile.py deleted file mode 100644 index 0cda825..0000000 --- a/modules/deprecated/hotfile.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "HotFile" - -""" -Last Checked 24/03/2024 -""" - -""" - -"HotFile": { - "apiKey": False, - "url": "https://api.hotfile.io/upload", - "api_url": "https://api.hotfile.io/", - "download_url_base": "https://hotfile.io/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class HotFile: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/krakenfiles_api.py b/modules/deprecated/krakenfiles_api.py deleted file mode 100644 index 9947cf7..0000000 --- a/modules/deprecated/krakenfiles_api.py +++ /dev/null @@ -1,71 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "Krakenfiles" - -""" -Last Checked 24/03/2024 -""" - -# This version is currently not in use because the API docs are outdated. Following the API rules results in a 500 error. - -class Krakenfiles: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - server_url = sites_data_dict[site]["server_url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - characters = string.ascii_lowercase + string.digits + string.ascii_uppercase - file_id = ''.join(random.choice(characters) for i in range(10)) - access_code = ''.join(random.choice(characters) for i in range(7)) - - if proxy_list == []: - server_req = requests.get(url=server_url, headers={"User-Agent": ua}) - else: - server_req = requests.get(url=server_url, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)) - - server_response = server_req.json() - print(server_response) - upload_url = server_response.get("data", {}).get("url", "") - print(upload_url) - token = server_response.get("data", {}).get("serverAccessToken", "") - print(token) - - if calc_size == "OK": - data = { - "serverAccessToken": token - } - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - if proxy_list == []: - raw_req = requests.post(url=upload_url, data=data, files=form_data, headers={"User-Agent": ua}) - else: - raw_req = requests.post(url=upload_url, files=form_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)) - - if raw_req.status_code == 200: - return {"status": "ok", "file_name": file_name, "file_url": download_url_base + file_id} - else: - raise Exception(f"Status code: {raw_req.status_code}") - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/letsupload.py b/modules/deprecated/letsupload.py deleted file mode 100644 index c4a6e77..0000000 --- a/modules/deprecated/letsupload.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "LetsUpload" - -""" -Last Checked 24/03/2024 -""" - -""" - -"LetsUpload": { - "apiKey": False, - "url": "https://api.letsupload.cc/upload", - "api_url": "https://api.letsupload.cc/", - "download_url_base": "https://letsupload.cc/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class LetsUpload: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/lolabits.py b/modules/deprecated/lolabits.py deleted file mode 100644 index bfa9cc6..0000000 --- a/modules/deprecated/lolabits.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "LolaBits" - -""" -Last Checked 24/03/2024 -""" - -""" - -"LolaBits": { - "apiKey": False, - "url": "https://api.lolabits.se/upload", - "api_url": "https://api.lolabits.se/", - "download_url_base": "https://lolabits.se/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class LolaBits: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/megaupload.py b/modules/deprecated/megaupload.py deleted file mode 100644 index cc7fca5..0000000 --- a/modules/deprecated/megaupload.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "MegaUpload" - -""" -Last Checked 24/03/2024 -""" - -""" - -"MegaUpload": { - "apiKey": False, - "url": "https://api.megaupload.nz/upload", - "api_url": "https://api.megaupload.nz/", - "download_url_base": "https://megaupload.nz/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class MegaUpload: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/myfile.py b/modules/deprecated/myfile.py deleted file mode 100644 index aabc1ac..0000000 --- a/modules/deprecated/myfile.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "MyFile" - -""" -Last Checked 24/03/2024 -""" - -""" - -"MyFile": { - "apiKey": False, - "url": "https://api.myfile.is/upload", - "api_url": "https://api.myfile.is/", - "download_url_base": "https://myfile.is/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class MyFile: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/nitrofile.py b/modules/deprecated/nitrofile.py deleted file mode 100644 index 1626db6..0000000 --- a/modules/deprecated/nitrofile.py +++ /dev/null @@ -1,64 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "NitroFile" - -""" -Last Checked 24/03/2024 -""" - -""" - -"NitroFile": { - "apiKey": False, - "url": "https://nitrofile.cc/api/v1/upload", - "api_url": "https://nitrofile.cc/", - "download_url_base": "https://nitrofile.cc/", - "size_limit": 7, - "size_unit": "GB" -}, - -""" - -class NitroFile: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - form_data = { - 'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies, stream=True) - - response = raw_req.json() - download_url = response.get("data", {}).get("file", {}).get("url", {}).get("short", "") - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/openload.py b/modules/deprecated/openload.py deleted file mode 100644 index 89cfcfd..0000000 --- a/modules/deprecated/openload.py +++ /dev/null @@ -1,54 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "OpenLoad" - -""" -Last Checked 24/03/2024 -""" - -""" -"OpenLoad": { - "apiKey": False, - "url": "https://api.openload.cc/upload", - "api_url": "https://api.openload.cc/", - "download_url_base": "https://openload.cc/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -} - -""" - -class OpenLoad: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/rapidshare.py b/modules/deprecated/rapidshare.py deleted file mode 100644 index e0a017f..0000000 --- a/modules/deprecated/rapidshare.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "RapidShare" - -""" -Last Checked 24/03/2024 -""" - -""" - -"RapidShare": { - "apiKey": False, - "url": "https://api.rapidshare.nu/upload", - "api_url": "https://api.rapidshare.nu/", - "download_url_base": "https://rapidshare.nu/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class RapidShare: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/shareonline.py b/modules/deprecated/shareonline.py deleted file mode 100644 index 75f2ceb..0000000 --- a/modules/deprecated/shareonline.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "ShareOnline" - -""" -Last Checked 24/03/2024 -""" - -""" - -"ShareOnline": { - "apiKey": False, - "url": "https://api.share-online.is/upload", - "api_url": "https://api.share-online.is/", - "download_url_base": "https://share-online.is/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class ShareOnline: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/udrop.py b/modules/deprecated/udrop.py deleted file mode 100644 index 3b2551a..0000000 --- a/modules/deprecated/udrop.py +++ /dev/null @@ -1,117 +0,0 @@ -import requests -import os -import random -import json - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "uDrop" - -""" -For some weird unholy reason this script stopped working. it works fine in insonmnia tho? what the fuck.. -""" - -""" - - "uDrop": { - "apiKey": False, - "url": "https://udrop.com/ajax/file_upload_handler", - "api_url": "https://udrop.com/", - "download_url_base": "https://udrop.com/", - "size_limit": 10, - "size_unit": "GB" - }, - -""" - -class uDrop: - def Uploader(file, proxy_list, user_agents, api_keys): - """ - Uploads a file to a specified site using random user agents and proxies. - - Args: - file (str): The path to the file to be uploaded. - proxy_list (list): A list of proxy URLs. - user_agents (list): A list of user agent strings. - - Returns: - dict: A dictionary containing the status, file name, file URL, and site. - - Raises: - Exception: If an error occurs during the upload process. - """ - raw_req = "None :(" - try: - # Select a random user agent - ua = random.choice(user_agents) - - # Assemble Size Limit e.g. 5 GB - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - # Get the file size and name - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - - # Truncate the file name if it is too long - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name - - # Calculate the size unit for the site - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - # Select a random proxy, if available - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - - chunk_size = 500000000 # 500 MB - chunk_position_before = -1 - chunk_position_after = -1 - - with open(file, 'rb') as file_data: - while True: - chunk_data = file_data.read(chunk_size) - chunk_length = len(chunk_data) - if not chunk_data: - break # Exit the loop if we've reached the end of the file - - chunk_position_before = chunk_position_after + 1 - chunk_position_after = chunk_position_before + chunk_length - 1 - - # Set the user agent header - headers = { - "User-Agent": ua, - "Accept": "application/json", - "X-Requested-With": "XMLHttpRequest", - "Content-Range": f"bytes {chunk_position_before}-{chunk_position_after}/{file_size}" - } - - upload_data = { - "maxChunkSize": chunk_size, - "uploadSource": "file_manager", - } - - # Prepare the json data to add extra data to the upload - form_data = { - 'files[]': (os.path.basename(file), chunk_data, 'application/octet-stream') - } - - # Get the upload URL from the site data dictionary - upload_url = sites_data_dict[site]["url"] - - # Send the upload request with the form data, headers, and proxies - raw_req = requests.post(url="https://udrop.com/ajax/file_upload_handler", data=upload_data, files=form_data, headers=headers, proxies=proxies, timeout=300, stream=True) - - raw_req = raw_req.json() - download_url = raw_req[0].get("url", "") - - # Return successful message with the status, file name, file URL, and site - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - # Return size error message - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - except Exception as e: - # Return error message - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} - diff --git a/modules/deprecated/up2share.py b/modules/deprecated/up2share.py deleted file mode 100644 index a1b0c3c..0000000 --- a/modules/deprecated/up2share.py +++ /dev/null @@ -1,130 +0,0 @@ -import requests -import os -import random -import string - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -site = "Up2Share" - -""" -Last Checked 24/03/2024 -""" - -""" - -"Up2Share": { - "apiKey": False, - "url": "https://up2sha.re/upload", - "api_url": "https://up2sha.re/", - "download_url_base": "https://up2sha.re/file?f=", - "size_limit": 1, - "size_unit": "GB" -}, - -""" - -""" -This file is marked as deprecated due to a 400 error when uploading files after chunk 0. -I can't figure out why it does that - -Full Error: - -{ - "error": { - "message": "Something went wrong. Please try again." - } -} - -""" - -class Up2Share: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - # Define the maximum chunk size (in bytes) - max_chunk_size = round(75.976 * 1024 * 1024) # 75.976 MB in bytes - - # Initialize the upload key - upload_key = None - - # Calculate the expected number of chunks - expected_chunks = (file_size + max_chunk_size - 1) // max_chunk_size - print("expected chunks: " + str(expected_chunks)) - - # Open the file in binary mode for reading - with open(file, 'rb') as file: - chunk_number = 0 - - while True: - # Read a chunk of the file - chunk = file.read(max_chunk_size) - - # If the chunk is empty, we've reached the end of the file - if not chunk: - break - - # Create a dictionary with the file content for multipart encoding - files = { - 'file': ('blob', chunk, 'application/octet-stream'), - 'chunk': (None, str(chunk_number)), - 'chunks': (None, str(expected_chunks)), # Include the expected number of chunks - 'clientFilename': (None, file_name), - 'filesize': (None, str(file_size)) - } - - # If we have an upload key, add it to the form data - if upload_key: - files['uploadKey'] = (None, upload_key) - - # Make a POST request to upload the chunk using multipart encoding - if proxy_list == []: - raw_req = requests.post(url=upload_url, files=files, headers={"User-Agent": ua}) - else: - raw_req = requests.post(url=upload_url, files=files, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)) - - print(raw_req.text) - - # Handle the response - if raw_req.status_code == 308: - print(f"Chunk {chunk_number} uploaded successfully") - - # Extract the uploadKey from the JSON response using the get() method - response_data = raw_req.json() - upload_key = response_data.get('result', {}).get('uploadKey') - print(upload_key) - else: - print(f"Failed to upload chunk {chunk_number}. Status code: {raw_req.status_code}") - - chunk_number += 1 - - # Close the file when done - file.close() - - response = raw_req.json() - file_url = response.get("result", {}).get("public_url", "") - - if raw_req.status_code == 201: - return {"status": "ok", "file_name": file_name, "file_url": file_url} - else: - raise Exception(f"Status code: {raw_req.status_code}") - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/upvid.py b/modules/deprecated/upvid.py deleted file mode 100644 index c5d405e..0000000 --- a/modules/deprecated/upvid.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "UpVid" - -""" -Last Checked 24/03/2024 -""" - -""" - -"UpVid": { - "apiKey": False, - "url": "https://api.upvid.cc/upload", - "api_url": "https://api.upvid.cc/", - "download_url_base": "https://upvid.cc/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class UpVid: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/vshare.py b/modules/deprecated/vshare.py deleted file mode 100644 index 2b6f16c..0000000 --- a/modules/deprecated/vshare.py +++ /dev/null @@ -1,55 +0,0 @@ -import requests -import os -import random - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * - -site = "vShare" - -""" -Last Checked 24/03/2024 -""" - -""" - -"vShare": { - "apiKey": False, - "url": "https://api.vshare.is/upload", - "api_url": "https://api.vshare.is/", - "download_url_base": "https://vshare.is/", - "size_limit_human": 20, - "size_limit_bytes": 21474836480, - "size_unit": "GB" -}, - -""" - -class vShare: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - if calc_size == "OK": - files_data = {'file': (os.path.basename(file), open(str(file), 'rb'), 'multipart/form-data')} - - if proxy_list == []: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}).json() - else: - req = requests.post(url=upload_url, files=files_data, headers={"User-Agent": ua}, proxies=random.choice(proxy_list)).json() - return {"status": "ok", "file_name": file_name, "file_url": req.get("data").get("file").get("url").get("short")} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} \ No newline at end of file diff --git a/modules/deprecated/wetransfer.py b/modules/deprecated/wetransfer.py deleted file mode 100644 index b8cd70d..0000000 --- a/modules/deprecated/wetransfer.py +++ /dev/null @@ -1,189 +0,0 @@ -import requests -import os -import random -import string -import hashlib -from time import sleep - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from .logger import Logger - -from main import DEBUG - -site = "WeTransfer" - -""" -Last Checked 24/03/2024 -""" - -""" - -"WeTransfer": { - "apiKey": False, - "url": "{server}", - "api_url": "https://wetransfer.com/", - "download_url_base": "https://wetransfer.com/downloads/{file_id}/{security_hash}", - "announce_url": "https://wetransfer.com/api/v4/transfers/link", - "initialize_url": "https://storm-eu-west-1.wetransfer.net/api/v2/batch/preflight", - "prepare_blocks_url": "https://storm-eu-west-1.wetransfer.net/api/v2/blocks", - "check_status_url": "https://storm-eu-west-1.wetransfer.net/api/v2/batch", - "finalize_url": "https://wetransfer.com/api/v4/transfers/{file_id}/finalize", - "size_limit": 2, - "size_unit": "GB" -}, - -""" - -class WeTransfer: - - def Uploader(file, proxy_list, user_agents, api_keys): - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - base_url = sites_data_dict[site]["download_url_base"] - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '') if len(file_name) > 240 else file_name # Changed from 255 to 15 as an additional safety net. - file_name_normal = file_name - file_name = file_name.replace(" ", "_") - - # Announce the upload to the server - announce_url = sites_data_dict[site]["announce_url"] - announce_data = { - "message": "Uploaded using Mul-Tor on Github!", - "display_name": file_name, - "ui_language": "en", - "files": [ - { - "name": file_name, - "size": file_size, - "item_type": "file" - } - ] - } - headers = {"User-Agent": ua, "Content-Type": "application/json", "Accept": "application/json"} - announce = requests.post(url=announce_url, json=announce_data, headers=headers) - - # Extract all needed data - announce_json = announce.json() - file_id = announce_json.get("id", "") - short_url = announce_json.get("shortened_url", "") - security_hash = announce_json.get("security_hash", "") - storm_upload_token = announce_json.get("storm_upload_token", "") - - # Check if everything is okay - initialize_url = sites_data_dict[site]["initialize_url"] - initialize_data = {"items": [ - { - "path": file_name, - "item_type": "file", - "blocks": [{"content_length": file_size}] - } - ]} - headers = {"User-Agent": ua, "Content-Type": "application/json", "Accept": "application/json", "Authorization": f"Bearer {storm_upload_token}"} - preflight = requests.post(url=initialize_url, json=initialize_data, headers=headers) - - # Requests upload server. It also needs an md5 hash - - # Create an MD5 hash object - md5_hash = hashlib.md5() - - # Open the file in binary mode and read it in chunks - with open(file, 'rb') as md5_file: - while True: - # Read a chunk of data from the file - chunk = md5_file.read(8192) # You can adjust the chunk size as needed - - # If the chunk is empty, we've reached the end of the file - if not chunk: - break - - # Update the hash object with the chunk of data - md5_hash.update(chunk) - - # Get the hexadecimal representation of the MD5 hash - md5_hex = md5_hash.hexdigest() - - prepare_blocks_url = sites_data_dict[site]["prepare_blocks_url"] - blocks_data = {"blocks": [ - { - "content_length": file_size, - "content_md5_hex": f"{str(md5_hex)}" - } - ]} - headers = {"User-Agent": ua, "Content-Type": "application/json", "Accept": "application/json", "Authorization": f"Bearer {storm_upload_token}"} - blocks = requests.post(url=prepare_blocks_url, json=blocks_data, headers=headers) - - # Extract all needed data again - blocks_json = blocks.json() - server_url = blocks_json.get("data", {}).get("blocks", [])[0].get("presigned_put_url", "") - block_id = blocks_json.get("data", {}).get("blocks", [])[0].get("block_id", "") - print(block_id) - server_md5 = blocks_json.get("data", {}).get("blocks", [])[0].get("put_request_headers", {}).get("Content-MD5", "") - x_uploader = blocks_json.get("data", {}).get("blocks", [])[0].get("put_request_headers", {}).get("X-Uploader", "") - - headers = { - "Content-Type": "application/octet-stream", - "User-Agent": ua, - "X-Uploader": x_uploader, - "Content-MD5": server_md5 - } - - - files = {'file': (os.path.basename(file), open(str(file), 'rb'), 'application/octet-stream')} - if proxy_list == []: - req = requests.put(url=server_url, files=files, headers=headers) - else: - req = requests.put(url=server_url, files=files, headers=headers, proxies=random.choice(proxy_list)) - - - check_status_url = sites_data_dict[site]["check_status_url"] - check_data = {"items": [ - { - "path": file_name, - "item_type": "file", - "block_ids": [block_id] - } - ]} - - headers = {"User-Agent": ua, "Content-Type": "application/json", "Accept": "application/json", "Authorization": f"Bearer {storm_upload_token}"} - check = requests.post(url=check_status_url, json=check_data, headers=headers) - print(check.text) - - check_json = check.json() - - while True: - if check_json.get("ok", "") == False: - print("Rechecking") - sleep(15) - check = requests.post(url=check_status_url, json=check_data, headers=headers) - check_json = check.json() - print(check.text) - else: - print("should be good now") - break - - check_json = check.json() - final_id = check_json.get("data", {}).get("batch_after_mutation", {}).get("foreign_id", "") - - finalize_url = sites_data_dict[site]["finalize_url"].format(file_id=final_id) - headers = {"User-Agent": ua, "Content-Type": "application/json", "Accept": "application/json"} - finalize = requests.put(url=initialize_url, json=check_data, headers=headers) - - finalize_json = finalize.json() - - file_id = finalize_json.get("id", "") - state = finalize_json.get("state", "") - security_hash = finalize_json.get("security_hash", "") - - download_url = sites_data_dict[site]["download_url_base"].format(file_id=final_id, security_hash=security_hash) - - if state == "downloadable": - return {"status": "ok", "file_name": file_name_normal, "file_url": download_url} - else: - raise Exception("Fuck me it failed somehow") - - except Exception as e: - return {"status": "error", "file_name": file_name_normal, "exception": str(e), "extra": req} \ No newline at end of file diff --git a/modules/deprecated/yourfilestore.py b/modules/deprecated/yourfilestore.py deleted file mode 100644 index b8da2f9..0000000 --- a/modules/deprecated/yourfilestore.py +++ /dev/null @@ -1,84 +0,0 @@ -import requests -import os -import random -import string -import re - -from .site_data import Site_Data_CLSS, sites_data_dict -from .pretty_print import * -from main import DEBUG - -""" -Last Checked 24/03/2024 -""" - -""" - -"YourFileStore": { - "apiKey": False, - "url": "https://yourfilestore.com/upload", - "api_url": "https://yourfilestore.com/upload", - "download_url_base": "https://yourfilestore.com/download/", - "size_limit": 500, - "size_unit": "MB" -}, - -""" - -""" -This worked perfectly before but they changed something in the uploading system. -I tried to figure it out for half an hour or more but i was unable to figure it out. -It says "some error occured" and that's it. Uploading on the site works but it can't be recreated in insomnia. -Further Testing is needed. Maybe it can be fixed. -""" - -site = "YourFileStore" - -class YourFileStore: - - def Uploader(file, proxy_list, user_agents, api_keys): - req = "which one of you maggots ate the fucking request huh?" - try: - ua = random.choice(user_agents) - upload_url = sites_data_dict[site]["url"] - size_limit = f'{sites_data_dict[site]["size_limit"]} {sites_data_dict[site]["size_unit"]}' - - - file_size = os.stat(file).st_size - file_name = os.path.basename(file) - file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name # Changed from 255 to 240 as an additional safety net. - - calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - - headers = {"User-Agent": ua} - proxies = random.choice(proxy_list) if proxy_list else None - - if calc_size == "OK": - - characters = string.ascii_lowercase + string.digits + string.ascii_uppercase - random_string = ''.join(random.choice(characters) for i in range(32)) - - # This site has problems with certain characters in file names - safe_file_name = os.path.basename(file).replace("(", ""). replace(")", "").replace("[", "").replace("]", "") - - form_data = { - 'UPLOAD_IDENTIFIER': random_string, - 'userfile': (safe_file_name, open(str(file), 'rb'), 'application/octet-stream') - } - - raw_req = requests.post(url=upload_url, files=form_data, headers=headers, proxies=proxies, stream=True) - - print(raw_req.text) - - url_pattern = r'https://yourfilestore\.com/download/\d+/[^"]+' - - match = re.search(url_pattern, raw_req.text) - download_url = match.group() - - return {"status": "ok", "file_name": file_name, "file_url": download_url} - else: - return {"status": "size_error", "file_name": file_name, "exception": "SIZE_ERROR", "size_limit": f"{str(size_limit)}"} - - except Exception as e: - return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req} -