-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyuuploader.py
60 lines (48 loc) · 1.77 KB
/
pyuuploader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import requests
import re
session = requests.Session()
# دریافت هش به صورت خودکار
def get_upload_hash():
response = session.get("https://uupload.ir/")
match = re.search(r'name="hash" value="(.*?)"', response.text)
return match.group(1) if match else None
# آدرس آپلود
upload_url = "https://s6.uupload.ir/sv_process.php"
# مسیر فایل برای آپلود
file_path = "test.mp3" # میتونی jpg یا mp3 باشه
# دریافت هش به صورت خودکار
hash_value = get_upload_hash()
if not hash_value:
print("❌ Error: Hash value not found!")
exit()
else:
print("✅ Hash received: ", hash_value)
# تنظیم مدت زمان برای 1 روز (86400 ثانیه)
data = {
"hash": hash_value,
"ittl": "86400"
}
headers = {
"User-Agent": "Mozilla/5.0",
"Referer": "https://uupload.ir/",
"Origin": "https://uupload.ir"
}
# ارسال فایل
with open(file_path, "rb") as file:
files = {"__userfile[]": file}
response = session.post(upload_url, data=data, files=files, headers=headers)
# بررسی پاسخ سرور
if response.status_code == 200:
response_text = response.text
# استخراج لینک مستقیم برای عکس
direct_link_match = re.search(r'https://s\d+.uupload.ir/files/[\w\d_-]+\.(jpg|jpeg|png|gif|bmp|mp3)', response_text)
# استخراج لینک صفحه دانلود (برای mp3)
page_link_match = re.search(r'https://uupload.ir/view/[\w\d_-]+\.(mp3|jpg|jpeg|png|gif|bmp)', response_text)
if direct_link_match:
print("✅ Direct file link:", direct_link_match.group())
elif page_link_match:
print("📌 Download page link:", page_link_match.group())
else:
print("❌ Error: No valid link found in server response!")
else:
print(f"❌ Upload failed! Status code: {response.status_code}")