bipinkrish / Save-Restricted-Bot

A Telegram Bot, Which can send you restricted content by it's post link
192 stars 397 forks source link

error auth #16

Closed Morrigan-Ship closed 11 months ago

Morrigan-Ship commented 1 year 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

bipinkrish commented 1 year 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

Morrigan-Ship commented 1 year ago

im in windows not linux

bipinkrish commented 1 year ago

It doesn't matter where you are, you have to ENVs, even windows have that

Morrigan-Ship commented 1 year ago

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 `

bipinkrish commented 1 year ago

This is not the problem from my code, it's asking for more space maybe access is denied for the process

Morrigan-Ship commented 1 year ago

process and ram in space is available and is hight

Morrigan-Ship commented 1 year ago

i tested on my windows 11 and test again on VPS(windows server) both same error

0xWEBMILK commented 1 year ago

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?

Morrigan-Ship commented 1 year ago

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

0xWEBMILK commented 1 year ago

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.

0xWEBMILK commented 1 year ago

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/

bipinkrish commented 11 months ago

Closing it

Noob0005 commented 8 months ago

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