Skip to content

[Bug] When downloading Big files/videos, constantly get ERRORS #1146

@harshbhardwaj77

Description

@harshbhardwaj77

Describe the bug

When downloading Big files/videos, constantly get ERRORS like this --

Adda(Q):21445 -> C:\tdl\download\Q_21445_train-003.4K.mp4 error: post file: rename file: rename C:\tdl\download\Q_21445_train-003.4K.mp4.tmp C:\tdl\download\Q_21445_train-003.4K.mp4: The process cannot access the file because it is being used by another process

This usually happens for videos/files ABOVE 100MB. This write/rename issue happens a LOT & because of this File starts to download again from the start. Which is a waste of time.

I hope you guys can fix this Bug

To Reproduce

tdl -n Q dl -f Q.json --pool 2 -t 4 -l 2 --delay 20s -d C:/tdl/download --group --template "{{ .DialogID }}{{ .MessageID }}{{ filenamify .FileName }}" --skip-same --continue --takeout --debug --ntp pool.ntp.org --reconnect-timeout 3m

Expected behavior

Large files should just be downloaded without this write/rename issue which happpens when the file is 100% complete while it is getting saved this ERROR shows up. This should not happen.

Version

Version: 0.20.1
Commit: 742da1b
Date: 2025-12-14T16:19:18Z

go1.23.10 windows/amd64

Which OS are you running tdl on?

Windows

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions