Comments (13)
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/authC:\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/authC:\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.
im in windows not linux
from save-restricted-bot.
It doesn't matter where you are, you have to ENVs, even windows have that
from save-restricted-bot.
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.
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.
process and ram in space is available and is hight
from save-restricted-bot.
i tested on my windows 11 and test again on VPS(windows server) both same error
from save-restricted-bot.
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.
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.
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.
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.
Closing it
from save-restricted-bot.
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)
- Running main.py Error HOT 2
- how to save restricted data from Private Group HOT 1
- Not an issue HOT 2
- #Features Request HOT 3
- add timer in bulk mode. my 1 telegram account banned because of saving .
- struct.error: unpack requires a buffer of 271 bytes
- Error while saving files
- Help HOT 1
- bot cant copy Poll (multiple choice post)
- Error when running the bot HOT 1
- error R15
- yoo i tried literally all night and my brain is bout to exploade!! ill try some more for sure but help :0 HOT 1
- Feature Request HOT 2
- #FeatureRequest HOT 2
- Little bit improvement 😕 HOT 3
- I need help to get ID from bot message HOT 4
- Error ❌
- Please add Cancel button and Logging
- #### ⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.
- Runtime warning in ubuntu , solution please
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from save-restricted-bot.