fabianonline / telegram_backup

Java app to download all your telegram data.
GNU General Public License v3.0
450 stars 91 forks source link

Proxy support #106

Closed 26000 closed 6 years ago

26000 commented 6 years ago

Telegram has been blocked in Russia, and telegram_backup no longer works.

UPD: added the logs for telegram_backup:

11:18:22.912 DEBUG CommandLineController.<init>       : CommandLineOptions.cmd_login: false
11:18:22.912 INFO  CommandLineController.<init>       : Initializing ApiStorage
11:18:22.914 INFO  CommandLineController.<init>       : Initializing TelegramUpdateHandler
11:18:22.917 INFO  CommandLineController.<init>       : Creating Client
Exception in thread "MTProtoWatchdog" java.lang.Error: java.nio.channels.ClosedChannelException
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1155)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.channels.ClosedChannelException
    at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:289)
    at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.register(MTProtoTcpConnection.kt:111)
    at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.run(MTProtoWatchdog.kt:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    ... 2 more
Exception in thread "main" java.util.concurrent.TimeoutException: Request timed out
    at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQueries(DefaultTelegramClient.kt:220)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQueries(DefaultTelegramClient.kt:216)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQueries(DefaultTelegramClient.kt:216)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQuery(DefaultTelegramClient.kt:178)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQuery$default(DefaultTelegramClient.kt:178)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.initConnection(DefaultTelegramClient.kt:109)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.init(DefaultTelegramClient.kt:79)
    at com.github.badoualy.telegram.api.DefaultTelegramClient.<init>(DefaultTelegramClient.kt:58)
    at com.github.badoualy.telegram.api.Kotlogram.getDefaultClient(Kotlogram.kt:29)
    at de.fabianonline.telegram_backup.CommandLineController.<init>(CommandLineController.kt:81)
    at de.fabianonline.telegram_backup.CommandLineRunnerKt.main(CommandLineRunner.kt:41)

I hoped torify will fix the problem, but it complains:

1523875219 WARNING torsocks[13118]: [syscall] Unsupported syscall number 229. Denying the call (in tsocks_syscall() at syscall.c:488)
1523875220 PERROR torsocks[13118]: socks5 libc connect: Address family not supported by protocol (in socks5_connect() at socks5.c:202)

It would be nice if telegram_backup had an option to use a proxy.

26000 commented 6 years ago

Hmm, found out that it works perfectly with proxychains. Will use it. But I think there should either an option to use proxy, or a guide for using telegram_backup with proxychains in README. For Russian users.

fabianonline commented 6 years ago

The library I'm using to talk to Telegram doesn't support proxies. So unfortunately I can't do anything right now.

26000 commented 6 years ago

Thank you anyway.