simonmysun / telegram-summarize-bot

BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

[feat] Add timeout and mime type detection while fetching contents #1

Open simonmysun opened 2 months ago

simonmysun commented 2 months ago

I have noticed that there is no need to fetch large files (usually binary, e.g. pdf or media). Additionally, currently it stuck when it is blocked by agressive anti-bot mechanisms. A timeout is required.

simonmysun commented 1 month ago

Timeout implemented in 365f3c6e93ccca0d65a9272077f6f99a73396e12.

Mime type:

import mimetypes
mime = mimetypes.guess_type(file)