Skip to content

Commit f5b7eac

Browse files
complete 1.5.0
feat: buzzheavier support feat: print info if a known sites causes issues to avoid reports fix: #20
2 parents a860c05 + 7136748 commit f5b7eac

33 files changed

+205
-78
lines changed

main.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#
2525
###
2626

27-
version = "1.4.1"
27+
version = "1.5.0"
2828
owd = os.getcwd()
2929
platform = sys.platform
3030

@@ -225,7 +225,8 @@ def selection(config, available, user_agents_list, proxy_list=""):
225225
"WDHO": WDHO,
226226
"Filesadmin": Filesadmin,
227227
"Fastupload": Fastupload,
228-
"CyberFile": CyberFile
228+
"CyberFile": CyberFile,
229+
"Buzzheavier": Buzzheavier
229230
}
230231

231232
if site in uploader_classes:
@@ -251,9 +252,12 @@ def selection(config, available, user_agents_list, proxy_list=""):
251252
formatted_links_file.close()
252253

253254
elif status == "error":
254-
print(f"{error} An error occurred while uploading the file {colored(file_name, 'light_blue')} to {colored(site, 'yellow')}! Please report this. Exception: {colored(exception_str, 'red')}")
255-
error_str = f"An error occurred while uploading the file {file_name} to {site}! Please report this. Exception: {exception_str}"
256-
Logger.log_event(error_str, extra)
255+
if site in ["Transfer", "Keep"]:
256+
print(f"{error} {colored(site, 'yellow')} fucked up again while uploading the file {colored(file_name, 'light_blue')}. Don't Report this! Its a known issue they need to fix.")
257+
else:
258+
print(f"{error} An error occurred while uploading the file {colored(file_name, 'light_blue')} to {colored(site, 'yellow')}! Please report this. Exception: {colored(exception_str, 'red')}")
259+
error_str = f"An error occurred while uploading the file {file_name} to {site}! Please report this. Exception: {exception_str}"
260+
Logger.log_event(error_str, extra)
257261

258262
elif status == "size_error":
259263
print(f"{error} File size of {colored(file_name, 'light_blue')} to big for {colored(site, 'yellow')}! Compress it to fit the max size of {colored(size_limit, 'yellow')}")

modules/__init__.py

+46-45
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
1-
from .user_agents import UserAgentManager
1+
# Here are the main program files
2+
from .user_agents import *
23
from .pretty_print import *
3-
from .availability_checker import Availability_Checker
4-
from .site_data import Site_Data_CLSS, sites_data_dict
5-
from .proxy_scraper import ProxyScraper
6-
from .config_manager import Config_Manager
7-
from .logger import Logger
8-
from .auto_update import AutoUpdate
9-
from .preset_manager import Preset_Manager
10-
4+
from .availability_checker import *
5+
from .site_data import *
6+
from .proxy_scraper import *
7+
from .config_manager import *
8+
from .logger import *
9+
from .auto_update import *
10+
from .preset_manager import *
1111

1212
# Here are all modules for the sites that are supported
13-
from .pixeldrain import PixelDrain
14-
from .gofile import GoFile
15-
from .oshi import Oshi
16-
from .filebin import FileBin
17-
from .delafil import Delafil
18-
from .files_dp_ua import Files_dp_ua
19-
from .filesfm import FilesFM
20-
from .krakenfiles import Krakenfiles
21-
from .transfer import Transfer
22-
from .tmpfiles import TmpFiles
23-
from .mixdrop import MixDrop
24-
from .onefichier import OneFichier
25-
from .fileio import Fileio
26-
from .easyupload import EasyUpload
27-
from .anontransfer import AnonTransfer
28-
from .onecloudfile import OneCloudFile
29-
from .anonymfile import AnonymFile
30-
from .filesi import FileSi
31-
from .fileupload import FileUpload
32-
from .clicknupload import ClicknUpload
33-
from .bowfile import BowFile
34-
from .hexupload import HexUpload
35-
from .usercloud import UserCloud
36-
from .doodrive import DooDrive
37-
from .ufile import uFile
38-
from .downloadgg import DownloadGG
39-
from .catbox import CatBox
40-
from .litterbox import LitterBox
41-
from .keep import Keep
42-
from .tempsend import TempSend
43-
from .usersdrive import UsersDrive
44-
from .rapidgator import Rapidgator
45-
from .wdho import WDHO
46-
from .filesadmin import Filesadmin
47-
from .fastupload import Fastupload
48-
from .cyberfile import CyberFile
13+
from .anontransfer import *
14+
from .anonymfile import *
15+
from .bowfile import *
16+
from .buzzheavier import *
17+
from .catbox import *
18+
from .clicknupload import *
19+
from .cyberfile import *
20+
from .delafil import *
21+
from .doodrive import *
22+
from .downloadgg import *
23+
from .easyupload import *
24+
from .fastupload import *
25+
from .filebin import *
26+
from .fileio import *
27+
from .filesadmin import *
28+
from .filesfm import *
29+
from .filesi import *
30+
from .files_dp_ua import *
31+
from .fileupload import *
32+
from .gofile import *
33+
from .hexupload import *
34+
from .keep import *
35+
from .krakenfiles import *
36+
from .litterbox import *
37+
from .mixdrop import *
38+
from .onecloudfile import *
39+
from .onefichier import *
40+
from .oshi import *
41+
from .pixeldrain import *
42+
from .rapidgator import *
43+
from .tempsend import *
44+
from .tmpfiles import *
45+
from .transfer import *
46+
from .ufile import *
47+
from .usercloud import *
48+
from .usersdrive import *
49+
from .wdho import *

modules/buzzheavier.py

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import requests
2+
import os
3+
import random
4+
5+
from .site_data import Site_Data_CLSS, sites_data_dict
6+
from .pretty_print import *
7+
from main import DEBUG
8+
9+
site = "Buzzheavier"
10+
11+
class Buzzheavier:
12+
def Uploader(file, proxy_list, user_agents, api_keys):
13+
"""
14+
Uploads a file to a specified site using random user agents and proxies.
15+
Args:
16+
file (str): The path to the file to be uploaded.
17+
proxy_list (list): A list of proxy URLs.
18+
user_agents (list): A list of user agent strings.
19+
Returns:
20+
dict: A dictionary containing the status, file name, file URL, and site.
21+
Raises:
22+
Exception: If an error occurs during the upload process.
23+
"""
24+
raw_req = "None :("
25+
try:
26+
# Select a random user agent
27+
ua = random.choice(user_agents)
28+
upload_url = sites_data_dict[site]["url"]
29+
30+
# Get the file size and name
31+
file_name = os.path.basename(file)
32+
33+
# Set the user agent header
34+
headers = {
35+
"User-Agent": "curl/8.4.0",
36+
"Accept": "*/*",
37+
"Content-Length": str(os.path.getsize(file))
38+
}
39+
40+
# Truncate the file name if it is too long
41+
file_name = (file_name[:240] + '..') if len(file_name) > 240 else file_name
42+
43+
# Select a random proxy, if available
44+
proxies = random.choice(proxy_list) if proxy_list else None
45+
46+
# Send the upload request with the form data, headers, and proxies
47+
with open(file, "rb") as file_upload:
48+
raw_req = requests.put(url=f"{upload_url}{file_name}", data=file_upload, headers=headers, proxies=proxies, timeout=300, stream=True)
49+
file_upload.close()
50+
if raw_req.status_code == 200:
51+
52+
try:
53+
raw_req = raw_req.json()
54+
download_url = raw_req.get("url")
55+
56+
except Exception as e:
57+
return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req.text}
58+
59+
return {"status": "ok", "file_name": file_name, "file_url": download_url}
60+
else:
61+
raise Exception(raw_req.status_code)
62+
63+
file_id = raw_req.text
64+
download_url = download_url_base + file_id.replace("&", "_")
65+
66+
# Return successful message with the status, file name, file URL, and site
67+
return {"status": "ok", "file_name": file_name, "file_url": download_url}
68+
69+
except Exception as e:
70+
# Return error message
71+
return {"status": "error", "file_name": file_name, "exception": str(e), "extra": raw_req}

modules/deprecated/anonfiles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .pretty_print import *
77

88
"""
9-
Last Checked 26/01/2024
9+
Last Checked 24/03/2024
1010
"""
1111

1212
"""

modules/deprecated/anonfilesme.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "AnonFilesMe"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/anonymfile-api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "AnonymFile"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
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.
1515
1616
"""

modules/deprecated/anyfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "AnyFile"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/bayfiles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "BayFiles"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/bayfilesio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "BayFilesIo"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/bunkrr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
site = "Bunkrr"
1212

1313
"""
14-
Last Checked 26/01/2024
14+
Last Checked 24/03/2024
1515
"""
1616

1717
# https://github.com/Official-Husko/mul-tor/discussions/13

modules/deprecated/filechan.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "FileChan"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/filemail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
site = "FileMail"
1313

1414
"""
15-
Last Checked 26/01/2024
15+
Last Checked 24/03/2024
1616
"""
1717

1818
"""

modules/deprecated/filestore.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "FileStore"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/filetransfer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "FileTransfer"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/gofilecc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "GoFileCC"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/hotfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "HotFile"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/krakenfiles_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "Krakenfiles"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
# This version is currently not in use because the API docs are outdated. Following the API rules results in a 500 error.

modules/deprecated/letsupload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "LetsUpload"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/lolabits.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "LolaBits"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/megaupload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "MegaUpload"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/myfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "MyFile"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/nitrofile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
site = "NitroFile"
1111

1212
"""
13-
Last Checked 26/01/2024
13+
Last Checked 24/03/2024
1414
"""
1515

1616
"""

modules/deprecated/openload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "OpenLoad"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

modules/deprecated/rapidshare.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
site = "RapidShare"
99

1010
"""
11-
Last Checked 26/01/2024
11+
Last Checked 24/03/2024
1212
"""
1313

1414
"""

0 commit comments

Comments
 (0)