andrew-ld/smart-tv-telegram

400 AUTH_BYTES_INVALID

Closed this issue · 7 comments

With the config in the next passage, igot this issue:
pyrogram.errors.exceptions.bad_request_400.AuthBytesInvalid: [400 AUTH_BYTES_INVALID]: The authorization bytes are invalid (caused by "auth.ImportAuthorization")

api_id=1289xxx
api_hash=188843f0a6814389xxxxxxxx
token=509780xxxx:AAEVTmCxYQ0A1xxxxxxxxx
session_name=SmartTVBot
file_fake_fw_wait=0.2

[bot]
admins=[35149xxx]
block_size=1048576
request_gone_timeout=900

[http]
listen_host=192.168.1.2
listen_port=8350

[web_ui]
enabled=0
password=owo

[discovery]
upnp_enabled=1
upnp_scan_timeout=3
chromecast_enabled=0
chromecast_scan_timeout=2
xbmc_enabled=1
xbmc_devices=[{"host": "192.168.178.71", "port": 8080},]
vlc_enabled=0
vlc_devices=[{"host": "127.0.0.1", "port": 4212, "password": "123"},]
device_request_timeout=3

The provided authorization is invalid, should not happen, try to delete the .session file

closed due to inactivity

Actually i sent you another email. But send it here again:

This i tried many times. Nothing changed.

Cheers Daniel

Error 400 means it is an error from your client, you are probably not using a correct app id and hash, token

If it still doesn't work, check if the dependency version is correct (pyrogram)

I double checked the app id and hash, token. Should be correct. And Pyrogram is as well on the correct version:

docker logs 63aed1715c52
Pyrogram v1.2.9, Copyright (C) 2017-2021 Dan https://github.com/delivrance
Licensed under the terms of the GNU Lesser General Public License v3 or later (LGPLv3+)

Traceback (most recent call last):
File "/usr/local/bin/smart_tv_telegram", line 8, in
sys.exit(entry_point())
File "/usr/local/lib/python3.10/site-packages/smart_tv_telegram/main.py", line 93, in entry_point
arg_parser(_devices)
File "/usr/local/lib/python3.10/site-packages/smart_tv_telegram/main.py", line 82, in arg_parser
main(args.config, devices)
File "/usr/local/lib/python3.10/site-packages/smart_tv_telegram/main.py", line 48, in main
loop.run_until_complete(async_main(config, devices))
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/smart_tv_telegram/main.py", line 42, in async_main
await mtproto.start()
File "/usr/local/lib/python3.10/site-packages/smart_tv_telegram/mtproto.py", line 120, in start
await session.send(ImportAuthorization(id=exported_auth.id, bytes=exported_auth.bytes))
File "/usr/local/lib/python3.10/site-packages/pyrogram/session/session.py", line 425, in send
return await self._send(data, timeout=timeout)
File "/usr/local/lib/python3.10/site-packages/pyrogram/session/session.py", line 395, in _send
RPCError.raise_it(result, type(data))
File "/usr/local/lib/python3.10/site-packages/pyrogram/errors/rpc_error.py", line 78, in raise_it
raise getattr(
pyrogram.errors.exceptions.bad_request_400.AuthBytesInvalid: [400 AUTH_BYTES_INVALID]: The authorization bytes are invalid (caused by "auth.ImportAuthorization")

Sorry for my noobie questions. But im using docker and how can i recreate the session with docker?