Giter VIP home page Giter VIP logo

Comments (13)

bipinkrish avatar bipinkrish commented on August 20, 2024

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

from save-restricted-bot.

Morrigan-Ship avatar Morrigan-Ship commented on August 20, 2024

im in windows not linux

from save-restricted-bot.

bipinkrish avatar bipinkrish commented on August 20, 2024

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

from save-restricted-bot.

Morrigan-Ship avatar Morrigan-Ship commented on August 20, 2024

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
`

from save-restricted-bot.

bipinkrish avatar bipinkrish commented on August 20, 2024

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

from save-restricted-bot.

Morrigan-Ship avatar Morrigan-Ship commented on August 20, 2024

process and ram in space is available and is hight

from save-restricted-bot.

Morrigan-Ship avatar Morrigan-Ship commented on August 20, 2024

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

from save-restricted-bot.

0xWEBMILK avatar 0xWEBMILK commented on August 20, 2024

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?

from save-restricted-bot.

Morrigan-Ship avatar Morrigan-Ship commented on August 20, 2024

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

from save-restricted-bot.

0xWEBMILK avatar 0xWEBMILK commented on August 20, 2024

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.

from save-restricted-bot.

0xWEBMILK avatar 0xWEBMILK commented on August 20, 2024

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/

from save-restricted-bot.

bipinkrish avatar bipinkrish commented on August 20, 2024

Closing it

from save-restricted-bot.

Noob0005 avatar Noob0005 commented on August 20, 2024

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

from save-restricted-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.