telegram-upload icon indicating copy to clipboard operation
telegram-upload copied to clipboard

Ipv6 support

Open babyrig opened this issue 3 years ago • 4 comments

It's just a question about it.

I am using a VPS with only Ipv6 there is a support or only to ipv4 networks ?

babyrig avatar Sep 24 '21 20:09 babyrig

It should probably work fine. If it doesn't work let me know.

Nekmo avatar Jan 24 '22 01:01 Nekmo

It should probably work fine. If it doesn't work let me know.

I already tried without success using only ipv6 here, only worked when I made a tunnel between another host with both ipv4/ipv6 and then set as default route to ipv4 to have telegram-upload working.

With just the ipv6 network I got this:

telegram-upload -d *.mp4 --to $VIDEO

Attempt 1 at connecting failed: OSError: [Errno 101] Network is unreachable Attempt 2 at connecting failed: OSError: [Errno 101] Network is unreachable Attempt 3 at connecting failed: OSError: [Errno 101] Network is unreachable Attempt 4 at connecting failed: OSError: [Errno 101] Network is unreachable Attempt 5 at connecting failed: OSError: [Errno 101] Network is unreachable Attempt 6 at connecting failed: OSError: [Errno 101] Network is unreachable Traceback (most recent call last): File "/usr/local/bin/telegram-upload", line 8, in sys.exit(upload_cli()) File "/usr/local/lib/python3.8/dist-packages/telegram_upload/exceptions.py", line 50, in wrap return fn(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1137, in call return self.main(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 763, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/telegram_upload/management.py", line 86, in upload client.start() File "/usr/local/lib/python3.8/dist-packages/telegram_upload/client.py", line 104, in start return super().start(phone=phone, password=password, bot_token=bot_token, force_sms=force_sms, File "/usr/local/lib/python3.8/dist-packages/telethon/client/auth.py", line 133, in start else self.loop.run_until_complete(coro) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/telethon/client/auth.py", line 140, in _start await self.connect() File "/usr/local/lib/python3.8/dist-packages/telethon/client/telegrambaseclient.py", line 513, in connect if not await self._sender.connect(self._connection( File "/usr/local/lib/python3.8/dist-packages/telethon/network/mtprotosender.py", line 127, in connect await self._connect() File "/usr/local/lib/python3.8/dist-packages/telethon/network/mtprotosender.py", line 253, in _connect raise ConnectionError('Connection to Telegram failed {} time(s)'.format(self._retries)) ConnectionError: Connection to Telegram failed 5 time(s)

babyrig avatar Jan 24 '22 10:01 babyrig

I'm afraid it's hard for me to test... I don't have ipv6 at home and my server isn't ipv6 enabled either. At the moment it is not possible for me to solve it.

Nekmo avatar Jun 15 '23 21:06 Nekmo

I might know the answer, when creating telethon client, a pram use_ipv6 can be set to true to use ipv6 to communicate to the TG server. So, you can simply add this to your telegram-upload.json in your ~/.config or where you save your config file, I think this can be added to the first time auth.

murez avatar Mar 03 '24 08:03 murez