سورس زيرو - Source Zero
رفتن به کانال در Telegram
➜ 𝙒𝙚𝙡𝙘𝙤𝙢𝙚 𝙏𝙤 𝙎𝙤𝙪𝙧𝙘𝙚 #𝙕𝙀𝙍𝙊 . ┉┅━━━━━━━━━━┅┉ • مرحبا بِـكَم في قناة سورس زيرو الرسميه 🏆 • يدعم مصانع باقوي المميزات . • يدعم المصانع المدفوعه . • للاستفسار › @wx_zc •
نمایش بیشتر560
مشترکین
اطلاعاتی وجود ندارد24 ساعت
+157 روز
+830 روز
آرشیو پست ها
كود تحميل من يوتيوب بالحب اهو
async def download(self, video_id: str, video: bool = False):
DOWNLOAD_SERVER_URL = "http://45.76.130.220:8888"
download_type = "video" if video else "audio"
ext = "mp4" if video else "mp3"
url = f"{DOWNLOAD_SERVER_URL}/download/{download_type}/{video_id}"
folder = "downloads"
if not os.path.exists(folder):
os.makedirs(folder)
file_path = os.path.join(folder, f"{video_id}.{ext}")
if os.path.exists(file_path):
return file_path, True
async with httpx.AsyncClient(timeout=30) as client:
try:
response = await client.get(url)
if response.status_code == 200:
with open(file_path, "wb") as f:
f.write(response.content)
return file_path, True
else:
return None, False
except Exception:
return None, False