Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta #255

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open

Beta #255

Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift click to select a range
a9b0cc2
Bug Fix All
SilentDemonSD Aug 7, 2023
bdb25a7
Add GoFile Leech
SilentDemonSD Aug 11, 2023
abdc800
Add SendCM, DesiUpload, StreamTape
SilentDemonSD Aug 11, 2023
a90e149
fix up
SilentDemonSD Aug 11, 2023
3ca15a7
Add External GoFile DL
SilentDemonSD Aug 11, 2023
7db5dab
New Setup Starts
SilentDemonSD Aug 12, 2023
4f8f5cb
fix
SilentDemonSD Aug 12, 2023
48c2749
fix
SilentDemonSD Aug 12, 2023
4591e76
fix frame
SilentDemonSD Aug 12, 2023
2667230
Add Multi Aria2c
SilentDemonSD Aug 12, 2023
1f64370
fix up
SilentDemonSD Aug 12, 2023
357f0e4
try debug
SilentDemonSD Aug 12, 2023
0c70db2
fix
SilentDemonSD Aug 12, 2023
e611911
fix Single Aria
SilentDemonSD Aug 12, 2023
5aa37e4
Add Index Folder Support
SilentDemonSD Aug 12, 2023
7b618c5
fix
SilentDemonSD Aug 12, 2023
29ab8b5
refix
SilentDemonSD Aug 12, 2023
b39c7fb
Fix Dir prblm
SilentDemonSD Aug 12, 2023
08dd67f
refix dir prblm
SilentDemonSD Aug 12, 2023
99801a5
fix gd issue
SilentDemonSD Aug 12, 2023
bf80a7d
try debug
SilentDemonSD Aug 12, 2023
1aa5c1e
fix
SilentDemonSD Aug 12, 2023
c3339a7
fix
SilentDemonSD Aug 12, 2023
4954d3a
retry
SilentDemonSD Aug 12, 2023
7bb03ee
retry
SilentDemonSD Aug 12, 2023
9da1498
fix !
SilentDemonSD Aug 12, 2023
8329231
try fix auto delete
SilentDemonSD Aug 12, 2023
159010e
final completion
SilentDemonSD Aug 12, 2023
99bfe22
fix recurring status
SilentDemonSD Aug 12, 2023
48347b6
Add Universal filename
SilentDemonSD Aug 12, 2023
9b370a2
fix
SilentDemonSD Aug 12, 2023
8d6841e
Test New GDFLIX DOMAIN
MajnuRangeela Aug 15, 2023
7536c76
Try New ..
SilentDemonSD Aug 20, 2023
c0b9354
improve
jammesop007aha Apr 29, 2024
be27ec4
improve
jammesop007aha Apr 29, 2024
5329832
improve
jammesop007aha Apr 29, 2024
3612779
improve
jammesop007aha Apr 29, 2024
e4b230d
improve
jammesop007aha Apr 29, 2024
5f6a29a
improve
jammesop007aha Apr 29, 2024
2d4f2c3
improve
jammesop007aha Apr 29, 2024
6e86565
improve
jammesop007aha Apr 29, 2024
5803270
improve
jammesop007aha Apr 29, 2024
3f74cbb
improve
jammesop007aha Apr 29, 2024
da982d0
improve
jammesop007aha Apr 29, 2024
6c7f887
improve
jammesop007aha Apr 29, 2024
ea7b23f
improve
jammesop007aha Apr 29, 2024
528db39
improve
jammesop007aha Apr 29, 2024
d3b9984
improve
jammesop007aha Apr 29, 2024
5142334
improve
jammesop007aha Apr 29, 2024
678c43d
improve
jammesop007aha Apr 29, 2024
224a993
improve
jammesop007aha Apr 29, 2024
eab1116
improve
jammesop007aha Apr 29, 2024
5c004e3
improve
jammesop007aha Apr 29, 2024
1fc6779
improve
jammesop007aha Apr 29, 2024
a4d485f
improve
jammesop007aha Apr 29, 2024
c5cfb79
improve
jammesop007aha Apr 29, 2024
01f17e3
improve
jammesop007aha Apr 29, 2024
89ea537
improve
jammesop007aha Apr 29, 2024
b188f0f
improve
jammesop007aha Apr 29, 2024
d118139
improve
jammesop007aha Apr 29, 2024
15c9a80
improve
jammesop007aha Apr 29, 2024
f51e8d4
improve
jammesop007aha Apr 29, 2024
8f4d917
improve
jammesop007aha Apr 29, 2024
4bd3503
improve
jammesop007aha Apr 29, 2024
27939b1
improve
jammesop007aha Apr 29, 2024
f2f86ec
improve
jammesop007aha Apr 29, 2024
beec95f
improve
jammesop007aha Apr 29, 2024
b69d2a0
improve
jammesop007aha Apr 29, 2024
9e36e9b
improve
jammesop007aha Apr 29, 2024
f9b456d
improve
jammesop007aha Apr 29, 2024
40a0429
improve
jammesop007aha Apr 29, 2024
ba6ca81
improve
jammesop007aha Apr 29, 2024
3c5dd17
improve
jammesop007aha Apr 29, 2024
f7ffcd7
improve
jammesop007aha Apr 29, 2024
dbf5501
improve
jammesop007aha Apr 29, 2024
634bdab
improve
jammesop007aha Apr 29, 2024
fb962aa
improve
jammesop007aha Apr 29, 2024
e51c1f7
improve
jammesop007aha Apr 29, 2024
11cfa5f
improve
jammesop007aha Apr 29, 2024
6d28985
improve
jammesop007aha Apr 29, 2024
d15dd67
improve
jammesop007aha Apr 29, 2024
ade7630
improve
jammesop007aha Apr 29, 2024
9cf7158
improve
jammesop007aha Apr 29, 2024
27e1610
improve
jammesop007aha Apr 29, 2024
7d6af0e
improve
jammesop007aha Apr 29, 2024
ad5bd53
improve
jammesop007aha Apr 29, 2024
ec577b5
improve
jammesop007aha Apr 29, 2024
5ac1aad
improve
jammesop007aha Apr 29, 2024
0736539
improve
jammesop007aha Apr 29, 2024
bfed637
improve
jammesop007aha Apr 29, 2024
ffc7e58
improve
jammesop007aha Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve
  • Loading branch information
jammesop007aha committed Apr 29, 2024
commit 9cf7158788033c3335cbdaa6080fdc923998ccfe
61 changes: 29 additions & 32 deletions bot/modules/gen_pyro_sess.py
Original file line number Diff line number Diff line change
@@ -1,13 1,16 @@
#!/usr/bin/env python3
from time import time
import asyncio
from aiofiles.os import remove as aioremove
from asyncio import sleep, wrap_future, Lock
from asyncio import wrap_future, Lock
from functools import partial

from pyrogram import Client
from pyrogram.filters import command, user, text, private
from pyrogram.handlers import MessageHandler
from pyrogram.errors import SessionPasswordNeeded, FloodWait, PhoneNumberInvalid, ApiIdInvalid, PhoneCodeInvalid, PhoneCodeExpired, UsernameNotOccupied, ChatAdminRequired, PeerIdInvalid
import aiogram
from aiogram.types import Message
from aiogram.filters import command, user, text, private
from aiogram.handlers import MessageHandler
from aiogram.errors import InputUserDeactivated, ChatAdminRequired, PeerIdInvalid
from aiogram.utils.exceptions import Throttled, CantParseEntities, MessageCantBeEdited, MessageToEditNotFound, MessageNotModified, TelegramAPIError, NetworkError, RetryAfter, CantParseMessage, InvalidQueryID, CantParseParam, CantParseHTTPURL, CantParsePhoneNumber, CantParseEmailAddress, CantParseUsername, CantParseHash, CantParseVersion

from bot import bot, LOGGER
from bot.helper.ext_utils.bot_utils import new_thread, new_task
Expand All @@ -18,53 21,52 @@
session_lock = Lock()
isStop = False

@new_task
async def genPyroString(client, message):
async def genPyroString(message: Message):
global isStop
session_dict.clear()
sess_msg = await sendMessage(message, """⌬ <u><i><b>Pyrogram String Session Generator</b></i></u>

<i>Send your <code>API_ID</code> or <code>APP_ID</code>.
Get from https://my.telegram.org</i>.
Get from <a href='https://my.telegram.org'>https://my.telegram.org</a></i>.
<b>Timeout:</b> 120s

<i>Send /stop to Stop Process</i>""")
session_dict['message'] = sess_msg
await wrap_future(invoke(client, message, 'API_ID'))
await wrap_future(invoke(message, 'API_ID'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical Code Style issue: No value for argument 'key' in function call

The issue that Pylint is pointing out indicates that the invoke function is being called without providing a required argument. It seems that the invoke function requires a 'key' argument, but in the call within the provided code, only message and 'API_ID' are provided.

Without the full context of what the invoke function signature looks like, it's hard to provide an exact fix. However, assuming that the 'API_ID' string is meant to be the value for the 'key' argument, the line should be corrected to include the 'key' as a named argument.

Here's the suggested fix:

Suggested change
await wrap_future(invoke(message, 'API_ID'))
await wrap_future(invoke(message, key='API_ID'))

This comment was generated by an experimental AI tool.

if isStop:
return
async with session_lock:
try:
api_id = int(session_dict['API_ID'])
except Exception:
return await editMessage(sess_msg, "<i><code>APP_ID</code> is Invalid.</i>\n\n ⌬ <b>Process Stopped.</b>")
await sleep(1.5)
await asyncio.sleep(1.5)
await editMessage(sess_msg, """⌬ <u><i><b>Pyrogram String Session Generator</b></i></u>

<i>Send your <code>API_HASH</code>. Get from https://my.telegram.org</i>.
<i>Send your <code>API_HASH</code>. Get from <a href='https://my.telegram.org'>https://my.telegram.org</a></i>.
<b>Timeout:</b> 120s

<i>Send /stop to Stop Process</i>""")
await wrap_future(invoke(client, message, 'API_HASH'))
await wrap_future(invoke(message, 'API_HASH'))
if isStop:
return
async with session_lock:
api_hash = session_dict['API_HASH']
if len(api_hash) <= 30:
return await editMessage(sess_msg, "<i><code>API_HASH</code> is Invalid.</i>\n\n ⌬ <b>Process Stopped.</b>")
while True:
await sleep(1.5)
await asyncio.sleep(1.5)
await editMessage(sess_msg, """⌬ <u><i><b>Pyrogram String Session Generator</b></i></u>

<i>Send your Telegram Account's Phone number in International Format ( Including Country Code ). <b>Example :</b> 14154566376</i>.
<b>Timeout:</b> 120s

<i>Send /stop to Stop Process</i>""")
await wrap_future(invoke(client, message, 'PHONE_NO'))
await wrap_future(invoke(message, 'PHONE_NO'))
if isStop:
return
await editMessage(sess_msg, f"⌬ <b>Verification Confirmation:</b>\n\n <i>Is {session_dict['PHONE_NO']} correct? (y/n/yes/no):</i> \n\n<b>Send y/yes (Yes) | n/no (No)</b>")
await wrap_future(invoke(client, message, 'CONFIRM_PHN'))
await wrap_future(invoke(message, 'CONFIRM_PHN'))
if isStop:
return
async with session_lock:
Expand All @@ -82,22 84,20 @@ async def genPyroString(client, message):
await pyro_client.connect()
try:
user_code = await pyro_client.send_code(session_dict['PHONE_NO'])
await sleep(1.5)
except FloodWait as e:
await asyncio.sleep(1.5)
except Throttled as e:
return await editMessage(sess_msg, f"<b>Floodwait of {e.value} Seconds. Retry Again</b>\n\n ⌬ <b>Process Stopped.</b>")
except ApiIdInvalid:
return await editMessage(sess_msg, "<b>API_ID and API_HASH are Invalid. Retry Again</b>\n\n ⌬ <b>Process Stopped.</b>")
except PhoneNumberInvalid:
return await editMessage(sess_msg, "<b>Phone Number is Invalid. Retry Again</b>\n\n ⌬ <b>Process Stopped.</b>")
await sleep(1.5)
except (ApiIdInvalid, PhoneNumberInvalid):
return await editMessage(sess_msg, "<b>API_ID, API_HASH, or Phone Number are Invalid. Retry Again</b>\n\n ⌬ <b>Process Stopped.</b>")
await asyncio.sleep(1.5)
await editMessage(sess_msg, """⌬ <u><i><b>Pyrogram String Session Generator</b></i></u>

<i>OTP has been sent to your Phone Number, Enter OTP in <code>1 2 3 4 5</code> format. ( Space between each Digits )</i>
<b>If any error or bot not responded, Retry Again.</b>
<b>Timeout:</b> 120s

<i>Send /stop to Stop Process</i>""")
await wrap_future(invoke(client, message, 'OTP'))
await wrap_future(invoke(message, 'OTP'))
if isStop:
return
async with session_lock:
Expand All @@ -109,7 109,7 @@ async def genPyroString(client, message):
except PhoneCodeExpired:
return await editMessage(sess_msg, "<i> Input OTP has Expired.</i>\n\n ⌬ <b>Process Stopped.</b>")
except SessionPasswordNeeded:
await sleep(1.5)
await asyncio.sleep(1.5)
await editMessage(sess_msg, f"""⌬ <u><i><b>Pyrogram String Session Generator</b></i></u>

<i>Account is being Protected via <b>Two-Step Verification.</b> Send your Password below.</i>
Expand All @@ -118,7 118,7 @@ async def genPyroString(client, message):
<b>Password Hint</b> : {await pyro_client.get_password_hint()}

<i>Send /stop to Stop Process</i>""")
await wrap_future(invoke(client, message, 'TWO_STEP_PASS'))
await wrap_future(invoke(message, 'TWO_STEP_PASS'))
if isStop:
return
async with session_lock:
Expand All @@ -140,9 140,8 @@ async def genPyroString(client, message):
await aioremove(f'WZML-X-{message.from_user.id}.session')
await aioremove(f'WZML-X-{message.from_user.id}.session-journal')
except: pass


async def set_details(_, message, newkey):
async def set_details(_, message: Message, newkey):
global isStop
user_id = message.from_user.id
value = message.text
Expand All @@ -154,21 153,19 @@ async def set_details(_, message, newkey):
isStop = True
return await editMessage(session_dict['message'], '⌬ <b>Process Stopped</b>')


@new_thread
async def invoke(client, message, key):
async def invoke(client, message: Message, key):
global isStop
user_id = message.from_user.id
session_dict[user_id] = True
start_time = time()
handler = client.add_handler(MessageHandler(partial(set_details, newkey=key), filters=user(user_id) & text & private), group=-1)
while session_dict[user_id]:
await sleep(0.5)
await asyncio.sleep(0.5)
if time() - start_time > 120:
session_dict[user_id] = False
await editMessage(message, "⌬ <b>Process Stopped</b>")
isStop = True
client.remove_handler(*handler)


bot.add_handler(MessageHandler(genPyroString, filters=command('exportsession') & private & CustomFilters.sudo))
bot.add_handler(MessageHandler(genPyroString, filters=command('exportsession') & private & CustomFilters.sudo))