Search code examples
python-3.xinterruptyoutube-dl

Youtube-dl module, getting part file instead of mp4 file when interrupting


When I interrupt the download process (by pressing ctrl + c), instead of getting an mp4 file, I get a part file. I also get the following messages :

Exiting normally, received signal 2.
ERROR: ffmpeg exited with code 255

This is the part of the code :

self.ydl_opts = {}
with youtube_dl.YoutubeDL(self.ydl_opts) as ydl:
    ydl.download([self.download_url])

Also I forgot to mention that if change the filename from filename.mp4.part to finemame.mp4 I can watch the video normally.

Any help is much appreciated!


Solution

  • That behaviour is wanted since you should be able to restart the download. It will or at least should then continue downloading from where you stopped.

    You could try to use
    --no-part when using on command line
    or set nopart to True when using embedded youtube-dl
    This will write the output directly.