Forwarded from PyCrazy
from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
from youtube_search import YoutubeSearch as B3KKK
import requests
import yt_dlp
import os
app = Client("Test11", 14170449,"03488b3c030fe095667e7ca22fe34954", bot_token = "6189018608")
@app.on_message(filters.command("يوت", [""]))
async def search(app,m:Message):
AssId = m.from_user.id
Msg = m.text.split(None, 1)[1]
B3 = B3KKK(Msg, max_results=4).to_dict()
buttons = []
for i in B3:
buttons.append([
InlineKeyboardButton(
i["title"],callback_data=f"{AssId}Down{i['id']}"
)])
await m.reply(f"-› نتائج بحثك عن {Msg}:",disable_web_page_preview=True,reply_markup=InlineKeyboardMarkup(buttons))
@app.on_callback_query(filters.regex("Down"))
async def get_info(app, query: CallbackQuery):
AssId = query.data.split("Down")[0]
IdVi = query.data.split("Down")[1]
if not query.from_user.id == int(AssId):
return await query.answer("هذا الأمر لا يخصك ", show_alert=True)
await query.message.delete()
B3 = B3KKK(f'https://youtu.be/{IdVi}', max_results=1).to_dict()
title = B3[0]['title']
url = f'https://youtu.be/{IdVi}'
await app.send_message(
query.message.chat.id,
f"[{title}]({url})",
disable_web_page_preview=True,
reply_markup=InlineKeyboardMarkup([[
InlineKeyboardButton ("صوت", callback_data=f'{AssId}MuAu{IdVi}'),],[
InlineKeyboardButton("🧚♀", user_id=5565674333),],]))
@app.on_callback_query(filters.regex("MuAu"))
async def get_audii(Mohamed, query: CallbackQuery):
IdVi = query.data.split("MuAu")[1]
AssId = query.data.split("MuAu")[0]
if not query.from_user.id == int(AssId):
return await query.answer("هذا الأمر لا يخصك ", show_alert=True)
url = f'https://youtu.be/{IdVi}'
await query.edit_message_text("⏳ جاري التحميل ..", reply_markup=InlineKeyboardMarkup ([[InlineKeyboardButton("⏳",callback_data='none')]]))
ydl_ops = {"format": "bestaudio[ext=m4a]"}
with yt_dlp.YoutubeDL(ydl_ops) as ydl:
info_dict = ydl.extract_info(url, download=False)
if int(info_dict['duration']) > 3605:
return await query.edit_message_text("حد التحميل ساعة فقط",reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("⚠️",callback_data='none')]]))
audio_file = ydl.prepare_filename(info_dict)
ydl.process_info(info_dict)
await query.edit_message_text("جاري الإرسال ..", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("🚀",callback_data='none')]]))
response= requests.get(info_dict['thumbnail'])
with open(f"{IdVi}.png", "wb") as file:
file.write(response.content)
user = await app.get_users(int(AssId))
await query.message.reply_audio(audio_file,title=info_dict['title'],duration=int(info_dict['duration']),performer=info_dict['channel'],caption=f'• من طلب -› {user.mention}',thumb=f"{IdVi}.png")
await query.edit_message_text(f"🔗 [{info_dict['title']}]({url})", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Owner",user_id=int(5565674333))]]),disable_web_page_preview=True)
Thu = f"{IdVi}.png"
os.remove(Thu)
os.remove(audio_file)
app.run()
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
from youtube_search import YoutubeSearch as B3KKK
import requests
import yt_dlp
import os
app = Client("Test11", 14170449,"03488b3c030fe095667e7ca22fe34954", bot_token = "6189018608")
@app.on_message(filters.command("يوت", [""]))
async def search(app,m:Message):
AssId = m.from_user.id
Msg = m.text.split(None, 1)[1]
B3 = B3KKK(Msg, max_results=4).to_dict()
buttons = []
for i in B3:
buttons.append([
InlineKeyboardButton(
i["title"],callback_data=f"{AssId}Down{i['id']}"
)])
await m.reply(f"-› نتائج بحثك عن {Msg}:",disable_web_page_preview=True,reply_markup=InlineKeyboardMarkup(buttons))
@app.on_callback_query(filters.regex("Down"))
async def get_info(app, query: CallbackQuery):
AssId = query.data.split("Down")[0]
IdVi = query.data.split("Down")[1]
if not query.from_user.id == int(AssId):
return await query.answer("هذا الأمر لا يخصك ", show_alert=True)
await query.message.delete()
B3 = B3KKK(f'https://youtu.be/{IdVi}', max_results=1).to_dict()
title = B3[0]['title']
url = f'https://youtu.be/{IdVi}'
await app.send_message(
query.message.chat.id,
f"[{title}]({url})",
disable_web_page_preview=True,
reply_markup=InlineKeyboardMarkup([[
InlineKeyboardButton ("صوت", callback_data=f'{AssId}MuAu{IdVi}'),],[
InlineKeyboardButton("🧚♀", user_id=5565674333),],]))
@app.on_callback_query(filters.regex("MuAu"))
async def get_audii(Mohamed, query: CallbackQuery):
IdVi = query.data.split("MuAu")[1]
AssId = query.data.split("MuAu")[0]
if not query.from_user.id == int(AssId):
return await query.answer("هذا الأمر لا يخصك ", show_alert=True)
url = f'https://youtu.be/{IdVi}'
await query.edit_message_text("⏳ جاري التحميل ..", reply_markup=InlineKeyboardMarkup ([[InlineKeyboardButton("⏳",callback_data='none')]]))
ydl_ops = {"format": "bestaudio[ext=m4a]"}
with yt_dlp.YoutubeDL(ydl_ops) as ydl:
info_dict = ydl.extract_info(url, download=False)
if int(info_dict['duration']) > 3605:
return await query.edit_message_text("حد التحميل ساعة فقط",reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("⚠️",callback_data='none')]]))
audio_file = ydl.prepare_filename(info_dict)
ydl.process_info(info_dict)
await query.edit_message_text("جاري الإرسال ..", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("🚀",callback_data='none')]]))
response= requests.get(info_dict['thumbnail'])
with open(f"{IdVi}.png", "wb") as file:
file.write(response.content)
user = await app.get_users(int(AssId))
await query.message.reply_audio(audio_file,title=info_dict['title'],duration=int(info_dict['duration']),performer=info_dict['channel'],caption=f'• من طلب -› {user.mention}',thumb=f"{IdVi}.png")
await query.edit_message_text(f"🔗 [{info_dict['title']}]({url})", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Owner",user_id=int(5565674333))]]),disable_web_page_preview=True)
Thu = f"{IdVi}.png"
os.remove(Thu)
os.remove(audio_file)
app.run()
👌3❤2
Forwarded from PyCrazy
from pyrogram import Client, filters
from getids import get_date_as_string as B3KKK
app = Client("Test11", 14170449,"03488b3c030fe095667e7ca22fe34954", bot_token = "6189018608")
def B3KKK(id: int) -> str:
if str(id)[0] == '5' and str(id)[1] == '9':
return '01/2023'
if len(str(id)) == 10:
if str(id)[0] == '5':
if not str(id)[1] == '0':
return '0{}/2022'.format(str(id).replace("0","")[2])
else:
return '0{}/2022'.format(str(id)[2])
elif str(id)[0] == '1' and str(id)[1] == '0':
if '11' in str(id):
return '11/2020'
if '12' in str(id):
return '12/2020'
else:
return '0{}/2020'.format(str(id).replace("0","")[2])
else:
if '11' in str(id):
return '11/2021'
if '12' in str(id):
return '12/2021'
if '10' in str(id):
return '10/2021'
else:
return '0{}/2021'.format(str(id).replace("0","")[1])
if len(str(id)) == 9:
if str(id)[0] == '9':
return '0{}/2020'.format(str(id).replace("0","")[0])
else:
return B3KKK(id)[1]
else:
return B3KKK(id)[1]
@app.on_message(filters.text)
def TexTMsg(app, message):
chat_id = message.chat.id
text = message.text
if (text == "الانشاء" or text == "انشاء"):
if message.reply_to_message:
id = message.reply_to_message.from_user.id
date = B3KKK(id)
message.reply(f"الانشاء : {date}")
else:
id = message.from_user.id
date = B3KKK(id)
message.reply(f"الانشاء : {date}")Dev : @N0040
Channel : @B3KKK
كود بيظهر ليك انشاء حسابك
❤2
Forwarded from PyCrazy
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1👍1
PyCrazy
Getids.py
ملحوظه
ضيف في الملف
في آخر الملف
ضيف في الملف
Client = Client("B3KKK",api_id=#api_idالخاص بك, api_hash="#api_hash الخاص بك",bot_token="#bot_token الخاص بك")في آخر الملف
Client.run()فيه اي افكار؟
🤩1
Forwarded from PyCrazy
اللي بيفهم بريح
الكود مثال بسيط
ممكن تغييره تخليه تغيير اي كليشه زي السورسات: تغيير الايدي و هكذا
الكود⬇️
الكود مثال بسيط
ممكن تغييره تخليه تغيير اي كليشه زي السورسات: تغيير الايدي و هكذا
الكود
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from PyCrazy
PyCrazy
اللي بيفهم بريح الكود مثال بسيط ممكن تغييره تخليه تغيير اي كليشه زي السورسات: تغيير الايدي و هكذا الكود ⬇️
from pyrogram import Client
from pyrogram import filters
from pyrogram.handlers import MessageHandler
API_ID = 14170449
API_HASH = "03488b3c030fe095667e7ca22fe34954"
TOKEN = "#Token"
app = Client(
"Change the message",
api_id=API_ID,
api_hash=API_HASH,
bot_token=TOKEN
)
# قاموس لتخزين الرسائل
messages = {
'1': 'هذه الرسالة الأولى',
'2': 'هذه الرسالة الثانية',
'3': 'هذه الرسالة الثالثة',
'4': 'هذه الرسالة الرابعة',
'5': 'هذه الرسالة الخامسة'
}
# رسالة البدء
current_message = messages['1']
# متغير لتتبع إدخالات المستخدم
STATE_CHANGE = 1
STATE_NORMAL = 2
state = STATE_NORMAL
# إرسال الرسالة الحالية
@app.on_message(filters.command("send"))
async def send_current_message(client, message):
await message.reply_text(current_message)
@app.on_message(filters.regex("^/[sS]tart"))
async def start_command(client, message):
set_state(STATE_NORMAL)
await message.reply_text("مرحبا! لتغيير الرسالة، يرجى إرسال /change")
@app.on_message(filters.command(["change", "c", "C"]))
async def change_command(client, message):
set_state(STATE_CHANGE)
await message.reply_text("يرجى إدخال رقم الرسالة التي تريد تغييرها (1، 2، 3، 4، 5)")
@app.on_message(filters.regex("^[1-5]$"))
async def number_message(client, message):
if not in_change_state():
return
set_state(STATE_NORMAL)
global current_message
message_number = message.text
if message_number in messages:
current_message = messages[message_number]
await message.reply_text(f"تم تغيير الرسالة الحالية إلى :\n{current_message}")
else:
await message.reply_text("رقم غير صحيح، يرجى المحاولة مرة أخرى")
def set_state(new_state):
global state
state = new_state
def in_change_state():
global state
return state == STATE_CHANGE
app.run()https://t.me/B3KKK/60
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from PyCrazy
كود بسيط عباره عن شرح : رفع مميز و تنزيل مميز = مطور
تخزين sqlite3 امر التثبيت
https://t.me/B3KKK/63
تخزين sqlite3 امر التثبيت
pip install sqlalchemyhttps://t.me/B3KKK/63
👍1
Please open Telegram to view this post
VIEW IN TELEGRAM
سورس البوت :
بدل انو يرد عليك بالترمنال عملته بوت تلجرام
☕ By : M.Hamada
⭐ Chanell : @B3kKK
from OpsAi import Ai
from pyrogram import Client,filters
app = Client("ChatGpt", api_id=14170449,api_hash="03488b3c030fe095667e7ca22fe34954",bot_token="5974150340:")
@app.on_message(filters.command("start"))
async def StartMsg(_,msg):
await msg.reply("Hello: I am ChatGpt Bot")
@app.on_message()
async def echo(bot, msg):
a = msg.text
s = Ai(query = a)
await bot.send_message(chat_id=msg.chat.id, text=s.chat())
app.run()بدل انو يرد عليك بالترمنال عملته بوت تلجرام
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3❤2
redis & pyrogram -V1 (1).py
27.9 KB
🏴☠️ Localhost
redis & pyrogram -V2.py
27.9 KB
🌍 Redis Url
🔗https://app.redislabs.com/
• المميزات :
• تفعيل | تعطيل - التواصل
• تفعيل | تعطيل - الاشتراك
• اذاعة | بالتثبيت - بالتوجيه
• اذاعة | بالتثبيت بالمجموعات - بالمجموعات
• ضع | حذف - قناة الاشتراك
• رفع | تنزيل - ادمن
• المستخدمين - الأدمنية - الجروبات
• نقل ملكية البوت
• الاحصائيات
⭐️ Dev : @DevZaid
⭐️ Ch : @B3KKK
🔗https://app.redislabs.com/
• المميزات :
• تفعيل | تعطيل - التواصل
• تفعيل | تعطيل - الاشتراك
• اذاعة | بالتثبيت - بالتوجيه
• اذاعة | بالتثبيت بالمجموعات - بالمجموعات
• ضع | حذف - قناة الاشتراك
• رفع | تنزيل - ادمن
• المستخدمين - الأدمنية - الجروبات
• نقل ملكية البوت
• الاحصائيات
Please open Telegram to view this post
VIEW IN TELEGRAM
Consle.py
10 KB
اضافه / تنزيل ادمن
اذاعه
وضع / حذف قناه الاشتراك
فتح / تعطيل الاشتراك
فتح / تعطيل التنبيه
حظر / إلغاء حظر عضو
حاله التنبيه / الاشتراك
الاحصائيات
Please open Telegram to view this post
VIEW IN TELEGRAM
👍5❤2
ADMIN.py
17.9 KB
• لوحة مطور انلاين ( sqlite )
• جميع المميزات هنا
• المكاتب:
• أمر تثبيت المكاتب:
⭐️ Dev : @DevZaid
⭐️ Ch : @B3KKK
• جميع المميزات هنا
• المكاتب:
pyrogram - asyncio - kvsqlite • أمر تثبيت المكاتب:
python3 -m pip install pyrogram tgcrypto asyncio kvsqlitePlease open Telegram to view this post
VIEW IN TELEGRAM
🥰2❤1👍1
This media is not supported in your browser
VIEW IN TELEGRAM
الكود عباره عن:
يجلب الصور من البروفايل اذا كانت صور يبعتها و اذا كانت فديو يرسلها ايضا
لم يفعلها احد الا انا و صديق لي
سعر الكود:
5$ دولار
التواصل : @paddington3 .
يجلب الصور من البروفايل اذا كانت صور يبعتها و اذا كانت فديو يرسلها ايضا
لم يفعلها احد الا انا و صديق لي
سعر الكود:
5$ دولار
التواصل : @paddington3 .
👍3❤1