tdlight-team/tdlight-telegram-bot-api

download file doesn't work

limassolsk opened this issue · 4 comments

docker run -p 8081:8081 --env TELEGRAM_API_ID=123 --env TELEGRAM_API_HASH=xyz --env TELEGRAM_ALLOW_USERS=1 --name tdlight tdlight/tdlightbotapi

steps:
http://127.0.0.1:8081/user{token}/getuserprofilephotos?user_id=123 -> {"file_id":"xyz"}
http://127.0.0.1:8081/user{token}/getFile?file_id=xyz -> {"file_path":"photos/file_0.jpg"}
http://127.0.0.1:8081/file/user{token}/photos/file_0.jpg ->{"ok":false,"error_code":404,"description":"Not Found"}

if i attache to container by command docker exec -it tdlight /bin/ash

I can see file /var/lib/telegram-bot-api/123:xyz/photos/file_0.jpg

how to download file by file_path?

@limassolsk files are not served by the botapi, you need yo setup a proxy (eg with nginx)

you need yo setup a proxy (eg with nginx)

how to do it with docker?
why no information about docker image doesn't work with files?

more easy is to change in README.md:

Installation
The simplest way to use it is with this docker command:

by adding -v /var/lib/telegram-bot-api/:/var/lib/telegram-bot-api/ and add somewhere that /file/ - doesn't work.