Closed johnstones214 closed 11 months ago
I can’t help you with google cloud. For PC, I need to know
network_mode
in docker-compose.yml
?1)
3) Yes.
4) Yes ,I retried. I got that same error as earlier. At my first try i was asked Telegram code which i got on app and it was authenticated. Then the onedrive link which took to me to a permissions page to which i agreed. and then it redirected to the link in 2) . when i checked bot i saw the error i originally posted and auth failed message in telegram app. Is it because of the 2 factor i have on microsoft account with microsoft authenticator ? Thanks
This is your auth response content
{'error': 'invalid_client', 'error_description': "AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '166d8e2a-55f2-4a26-9838-49d9aefcc445'. Trace ID: 0df4db40-19f6-425d-9e73-311e670b0000 Correlation ID: d28e28c1-5032-4995-9799-701a1b78a78b Timestamp: 2023-12-17 11:42:53Z", 'error_codes': [7000215], 'timestamp': '2023-12-17 11:42:53Z', 'trace_id': '0df4db40-19f6-425d-9e73-311e670b0000', 'correlation_id': 'd28e28c1-5032-4995-9799-701a1b78a78b', 'error_uri': 'https://login.microsoftonline.com/error?code=7000215'}
It seems that your client secret is not correct.
You need to record Value
, not Secret ID
, in Certificates & secrets
step.
Regenerate one and try again.
it worked !! thanks alot
No problem.
im sorry to concern you once again i got an error message when sending a video file which i hadnt downloaded but forwarded from a chat :
Error: Traceback (most recent call last): File "/telegram-onedrive/modules/handlers/transfer.py", line 31, in transfer_handler await multi_parts_uploader(tg_client, message.media.document, name, progress_callback=callback) AttributeError: 'NoneType' object has no attribute 'media'
Oh that's an old problem. I think this may be fixed if you're using the latest telegram. If this not works, the problem is the way of creating group. You need to follow these steps:
New Group
Next
, without adding the bot.And make sure the bot is admin.
I'm using the Telegram Desktop application from the original telegram website and not microsoft store. This is the version it is running:
I can't find the update option in the settings too. I tried the other steps you told that didnt seem to work as well. Should I have stopped the docker container and tried those steps and then again docker-compose up ?
Try it on Telegram Web.
You can try to remove your container and recreate it. I've tried on telegram web, and it works fine.
I need to see your bot's rights. Like this:
An user had the same problem. He said he had to give it all rights, so that it could work.
All the rights given already
He said he had to give the last two rights. Exactly the same situation as yours. It's very weird, but you have to.
Thank you that did it. I have an additional question. Is it possible to run this on a VPS. Asking this because internet speed is less and it takes sometime to completely upload. Thank you very much for all your help !
Yes, you can. My bot is running on a VPS.
May I know how you would use server_uri and the port settings there? Also uri for onedrive too
The same as localhost.
If your VPS's host name is example.com
, and if you want to use port 8000
, make sure you opened port 8000
in your firewall, and use https://example.com:8000
as server_uri
.
On azure portal, use https://example.com:8000/auth
as redirect uri.
If you have your own ssl certification, use them in docker-compose.yml
.
If you don't have host name, use ip address instead.
I'm extremely new to this whole VPS , Docker and networking thing so i dont know how to get there.. is it okay if you can share your telegram id so i can message you personally. if u dont mind
No, I can't. You have to learn this knowledge on your own.
alright thank you for your help
Can i run this from google cloud shell? I tried running it there it worked somewhat but I got stuck on the Telegram code verification. This was the error shown:
127.0.0.1 - - [17/Dec/2023 09:56:09] "POST /tg HTTP/1.1" 400 - telegram-onedrive | Error on request: telegram-onedrive | Traceback (most recent call last): telegram-onedrive | File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 362, in run_wsgi telegram-onedrive | execute(self.server.app) telegram-onedrive | File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 326, in execute telegram-onedrive | write(data) telegram-onedrive | File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 292, in write telegram-onedrive | self.end_headers() telegram-onedrive | File "/usr/local/lib/python3.8/http/server.py", line 537, in end_headers telegram-onedrive | self.flush_headers() telegram-onedrive | File "/usr/local/lib/python3.8/http/server.py", line 541, in flush_headers telegram-onedrive | self.wfile.write(b"".join(self._headers_buffer)) telegram-onedrive | File "/usr/local/lib/python3.8/socketserver.py", line 826, in write telegram-onedrive | self._sock.sendall(b) telegram-onedrive | File "/usr/local/lib/python3.8/ssl.py", line 1204, in sendall telegram-onedrive | v = self.send(byte_view[count:]) telegram-onedrive | File "/usr/local/lib/python3.8/ssl.py", line 1173, in send telegram-onedrive | return self._sslobj.write(data) telegram-onedrive | ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:2485)
is there any fix for this? Also tried running it on my pc where i was able to login to my telegram account but when i got to onedrive auth , the browser shower authorized succesfully while bot says authorization failed. and gave the following error:
Traceback (most recent call last): File "/telegram-onedrive/modules/handlers/auth.py", line 134, in auth_handler onedrive.load_session() File "/telegram-onedrive/modules/onedrive.py", line 105, in load_session self.client.auth_provider.load_session(path=self.session_path) File "/usr/local/lib/python3.8/site-packages/onedrivesdk/auth_provider.py", line 323, in load_session self._session = self._session_type.load_session(**load_session_kwargs) File "/usr/local/lib/python3.8/site-packages/onedrivesdk/session.py", line 111, in load_session with open(path, "rb") as session_file: FileNotFoundError: [Errno 2] No such file or directory: 'session/onedrive.session'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/telegram-onedrive/modules/handlers/auth.py", line 140, in auth_handler onedrive.auth(code) File "/telegram-onedrive/modules/onedrive.py", line 90, in auth self.client.auth_provider.authenticate( File "/usr/local/lib/python3.8/site-packages/onedrivesdk/auth_provider.py", line 206, in authenticate self._session = self._session_type(rcont["token_type"], KeyError: 'token_type'
Can you please help out in both these errors. thank you