Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement local download from https file url #42

Open
luckydonald opened this issue Jan 5, 2021 · 3 comments
Open

Implement local download from https file url #42

luckydonald opened this issue Jan 5, 2021 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@luckydonald
Copy link
Collaborator

So the original Bot servers lets url uploads be handled by the actual telegram backend.

This means the self hosted version of the API in your network doesn't solve the following use cases:

  • Having the files accessible only in the local network
  • Being able to increase the size limits (5 MB max size for photos and 20 MB max for other types of content.)

The latter being the reason why I looked into self host the API, as 5 MB for images is often not enough.

@MarcoBuster
Copy link
Collaborator

You can disable file limits as described by #3.
I don't think add support to https to the project it's a good idea, use a reverse proxy.

@MarcoBuster MarcoBuster added the help wanted Extra attention is needed label Jan 6, 2021
@luckydonald
Copy link
Collaborator Author

luckydonald commented Jan 6, 2021

No, I think you might have misunderstood what I meant, let me improve my explanation:

What I meant was like

GET /bot1234:abc/sendPhoto?chat_id=1234&photo=http://192.168.178.69:4458/some_image.png

If 192.168.178.69 is a purely local IP address, which is reachable for the bot-api server but not from outside (Telegram servers) it would fail.
Additionally it is not possible to increase those file limits when using urls (instead of manually downloading and re-uploading those yourself or using existing file_ids). Lastly, only https:// seems supported by that.

Which is a bummer, as I actually wanted to increase the size limits with uploads by url, and the fact that you send the API server a url but some other server in some datacenter attempts to download the file instead can be confusing as well.

@tdlight-team tdlight-team deleted a comment from luckydonald Jan 10, 2021
@luckydonald luckydonald changed the title Implement local https file url Implement local download from https file url Jan 30, 2021
@SonicCodes
Copy link

Yes this was what happened to me. but you can try downloading the data as a buffer and send it to the local server, I don't think it'd have that much over-head or latency difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants