tdl icon indicating copy to clipboard operation
tdl copied to clipboard

[Feat] Option to preserve or override file modification time for downloads (to ensure Jellyfin showing them in Recently Added sections)

Open s0ren99 opened this issue 4 months ago • 2 comments

Proposal

Add a configuration option (e.g. --update-mtime or --use-upload-time) to let users choose which timestamp to apply when downloading files:

Option 1: --use-upload-time Keep Telegram’s upload time (current behavior)

Option 2: --update-mtime Use the local download time (previous behavior)

This would allow better compatibility with media managers and file indexing tools that rely on local modification times.

Background

After a recent update, I noticed that the downloaded files’ modification time (mtime) now matches the original upload time on Telegram, rather than the time the file was downloaded locally.

This causes an issue with media servers like Jellyfin, which determine “Recently Added” items based on the file’s modification or creation time.

# Before update
$ ls -l video.mp4
-rw-r--r-- 1 user user 100M Nov 2 12:30 video.mp4   ← download time

# After update
-rw-r--r-- 1 user user 100M Oct 25 21:15 video.mp4   ← Telegram upload time

As a result, newly downloaded files no longer appear in Jellyfin’s “Recently Added” section on the home page, and now viewing them requires more time and effort for clicking, typing, and searching, given that there is a number of libraries and folders.

Thanks for considering this feature — it would greatly improve integration with media servers like Jellyfin.

Workarounds

The only workaround I can think of is downgrading to the old version, because Jellyfin (and I assume other media servers as well) checks mtime by defualt.

s0ren99 avatar Nov 02 '25 06:11 s0ren99

I tend to accept this feature request. What's your options? @iyear @Fengzdadi

XMLHexagram avatar Nov 02 '25 06:11 XMLHexagram

LGTM

iyear avatar Nov 09 '25 15:11 iyear