Skip to content

Commit

Permalink
Update الاغاني.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerpq authored Dec 17, 2023
1 parent a8cf326 commit cfba71b
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions repthon/plugins/الاغاني.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,75 +43,75 @@
"320": "لـ البحـث عـن الاغـانـي وتحميـلهـا بـدقـه عـاليـه 320k",
},
"الاسـتخـدام": "{tr}بحث + اسـم الاغنيـه",
"مثــال": "{tr}بحث Dark Beach",
"مثــال": "{tr}.بحث Dark Beach",
},
)
async def _(event):
"لـ تحميـل الاغـانـي مـن يـوتيـوب"
"To search songs"
reply_to_id = await reply_id(event)
reply = await event.get_reply_message()
if event.pattern_match.group(2):
query = event.pattern_match.group(2)
query = f"{query} mp3"
elif reply and reply.message:
query = reply.message
query = f"{query} mp3"
else:
return await edit_or_reply(event, "**⎉╎قم باضافـة الاغنيـه للامـر .. بحث + اسـم الاغنيـه**")
taiba = base64.b64decode("VHdIUHd6RlpkYkNJR1duTg==")
repevent = await edit_or_reply(event, "**╮ جـارِ البحث ؏ـن الاغنيـٓه... 🎧♥️╰**")
cat = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==")
repevent = await edit_or_reply(event, "**╮ جـارِ البحث ؏ـن المقطـٓع الصٓوتـي... 🎧♥️╰**")
video_link = await yt_search(str(query))
if not url(video_link):
return await repevent.edit(
f"⌔∮ عذرا لم استطع ايجاد مقاطع ذات صلة بـ `{query}`"
f"**⎉╎عـذراً .. لـم استطـع ايجـاد** {query}"
)
cmd = event.pattern_match.group(1)
q = "320k" if cmd == "320" else "128k"
song_cmd = song_dl.format(QUALITY=q, video_link=video_link)
name_cmd = name_dl.format(video_link=video_link)
try:
taiba = Get(taiba)
await event.client(taiba)
cat = Get(cat)
await event.client(cat)
except BaseException:
pass
try:
stderr = (await _reputils.runcmd(song_cmd))[1]
await sleep(3)
repname, stderr = (await _reputils.runcmd(name_cmd))[:2]
# if stderr:
# await repevent.edit(f"**Error1 :** `{stderr}`")
catname, stderr = (await _reputils.runcmd(name_cmd))[:2]
if stderr:
return await repevent.edit(f"**خطأ :** `{stderr}`")
await sleep(3)
repname = os.path.splitext(repname)[0]
await sleep(2)
song_file = Path(f"{repname}.mp3")
repname = urllib.parse.unquote(repname)
return await repevent.edit(f"**خطــأ :** `{stderr}`")
catname = os.path.splitext(catname)[0]
song_file = Path(f"{catname}.mp3")
except:
pass
if not os.path.exists(song_file):
return await repevent.edit(
f"**⎉╎عـذراً .. لـم استطـع ايجـاد** {query}"
)
await repevent.edit("**- جـارِ التحميـل انتظـر ▬▭...**")
repthumb = Path(f"{repname}.jpg")
if not os.path.exists(repthumb):
repthumb = Path(f"{repname}.webp")
elif not os.path.exists(repthumb):
repthumb = None
title = repname.replace("./temp/", "").replace("_", "|")
await repevent.edit("**╮ ❐ جـارِ التحميـل انتظـر قليلاً ▬▭... 𓅫╰**")
catthumb = Path(f"{catname}.jpg")
if not os.path.exists(catthumb):
catthumb = Path(f"{catname}.webp")
elif not os.path.exists(catthumb):
catthumb = None
title = catname.replace("./temp/", "").replace("_", "|")
try:
await event.client.send_file(
event.chat_id,
song_file,
force_document=False,
caption=f"**⎉╎البحث :** `{title}`",
thumb=repthumb,
thumb=catthumb,
supports_streaming=True,
reply_to=reply_to_id,
)
await repevent.delete()
for files in (repthumb, song_file):
for files in (catthumb, song_file):
if files and os.path.exists(files):
os.remove(files)
except ChatSendMediaForbiddenError as err:
await repevent.edit("**- الوسائط مغلقـه هنـا ؟؟**")
except ChatSendMediaForbiddenError as err: # Code By T.me/E_7_V
await repevent.edit("**- عـذراً .. الوسـائـط مغلقـه هنـا ؟!**")
LOGS.error(str(err))


Expand All @@ -134,7 +134,7 @@ async def _(event):
query = reply.message
else:
return await edit_or_reply(event, "**⎉╎قم باضافـة الاغنيـه للامـر .. فيديو + اسـم الفيديـو**")
cat = base64.b64decode("VHdIUHd6RlpkYkNJR1duTg==")
cat = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==")
repevent = await edit_or_reply(event, "**╮ جـارِ البحث ؏ـن الفيديـو... 🎧♥️╰**")
video_link = await yt_search(str(query))
if not url(video_link):
Expand Down

0 comments on commit cfba71b

Please sign in to comment.