tangyoha / telegram_media_downloader

基于Dineshkarthik的项目, 电报视频下载,电报资源下载,跨平台,支持web查看下载进度 ,支持bot下发指令下载,支持下载已经加入的私有群但是限制下载的资源, telegram media download,Download media files from a telegram conversation/chat/channel up to 2GiB per file
MIT License
2.41k stars 280 forks source link

[Feature]: Getting text from the posts #82

Closed nihelmasell closed 11 months ago

nihelmasell commented 1 year ago

Description

Sometimes (if not always) images without context mean nothing. I would like a feature to be added, so a text file is attached to each downloaded file, using the description used by the uploader. Scraping TG with wget or archivebox is often messy, as you get repeated posts in one page. So if one could have the original description for each file it would be great.

Suggested Solution

I don't know. The telegram posts seem to have a unique html viewable on the web, like 5089.html, after the channel’s url. Maybe that can be used.

Alternatives

No response

Additional Context

I know someone mentioned this before, but I saw no response.

tangyoha commented 1 year ago

You said that someone has said this question which one are you referring to?

nihelmasell commented 1 year ago

You said that someone has said this question which one are you referring to?

This one https://github.com/tangyoha/telegram_media_downloader/issues/77

I think he's pointing out the same enhancement.

tangyoha commented 1 year ago

We can put the caption into file name.But file name have a 255 length limit.just see file_name_prefix which you can configure in config.yaml.

nihelmasell commented 1 year ago

We can put the caption into file name.But file name have a 255 length limit.just see file_name_prefix which you can configure in config.yaml.

Like this, for example?

file_name_prefix:

Or do I need to modify anything else?

tangyoha commented 1 year ago

Nothing else

nihelmasell commented 1 year ago

Nothing else

Well, doesn't seem to work. I still get message ID and filename, and caption is not added. Does it truncate the caption when it's longer than 256 characters or just omits it? The program overall works very well and I didn't have to create python virtual environments, just add all the channel to config.yaml. But, well, this feature would be awesome, mostly when you have to grab images and videos not in a language you know.

tangyoha commented 1 year ago

truncate the caption

tangyoha commented 1 year ago

Might need to save to a file separately?

nihelmasell commented 1 year ago

Might need to save to a file separately?

No, the captions are not saved at all. I backup more than 60 channels and have seen no caption added to the filenames in my latest download batch. You can do that in the future (saving it as a separate file) but now it doesn't even work for me (on macOS) the setting for the captions added to the filename.

tangyoha commented 1 year ago

1.show me your config 2.which program version does you use 3.If you are downloading a group of videos or pictures, you need to download the first one, and the name of the next downloaded file can have the title