Closed Morrigan-Ship closed 11 months ago
Save-Restricted-Bot-main>.\main.py Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run self.start() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap return loop.run_until_complete(coroutine) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start is_authorized = await self.connect() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect await self.load_session() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session raise AttributeError("The API key is required for new authorizations. " AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth C:\Users\ddr7\Desktop\Save-Restricted-Bot-main>.\main.py Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run self.start() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap return loop.run_until_complete(coroutine) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start is_authorized = await self.connect() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect await self.load_session() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session raise AttributeError("The API key is required for new authorizations. " AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth C:\Users\ddr7\Desktop\Save-Restricted-Bot-main>.\main.py Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run self.start() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap return loop.run_until_complete(coroutine) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start is_authorized = await self.connect() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect await self.load_session() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session raise AttributeError("The API key is required for new authorizations. " AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth
ENVs are not set
im in windows not linux
It doesn't matter where you are, you have to ENVs, even windows have that
yeah i fixed environment problem
but i got new error
new error:
Traceback (most recent call last):
File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 18, in
This is not the problem from my code, it's asking for more space maybe access is denied for the process
process and ram in space is available and is hight
i tested on my windows 11 and test again on VPS(windows server) both same error
Your error is directly related to the API key, which is required for authorization: "AttributeError: The API key is required for new authorizations" In what form do you specify api-hash, api-id, and do you specify them at all?
yes i created string session and fill the variables currectly HASH ID TOKEN STRING they all filled currect i dont know why error
did you tested on windows your self? if not please test it
yes i created string session and fill the variables currectly HASH ID TOKEN STRING they all filled currect i dont know why error
Can you show an example starting with variable declaration without the keys if here? And yes, it's working for me, just today I checked it out.
Your problem is related to the fact that you specify API_HASH and API_ID incorrectly. The standard example is described below:
app = Client(
"0xwebmilk",
api_id = <your api id>,
api_hash = <your api hash>
)
More details can be found at: https://docs.pyrogram.org/
Closing it
yeah i fixed environment problem
but i got new error
new error: Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 18, in acc.start() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap return loop.run_until_complete(coroutine) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start is_authorized = await self.connect() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect await self.load_session() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 616, in load_session await self.storage.open() File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\storage\memory_storage.py", line 59, in open dc_id, api_id, test_mode, auth_key, user_id, is_bot = struct.unpack( ^^^^^^^^^^^^^^ struct.error: unpack requires a buffer of 271 bytes `
I am getting this error too
Save-Restricted-Bot-main>.\main.py Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session
raise AttributeError("The API key is required for new authorizations. "
AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth
C:\Users\ddr7\Desktop\Save-Restricted-Bot-main>.\main.py Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session
raise AttributeError("The API key is required for new authorizations. "
AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth
C:\Users\ddr7\Desktop\Save-Restricted-Bot-main>.\main.py Traceback (most recent call last): File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session
raise AttributeError("The API key is required for new authorizations. "
AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth