Use youtube-dl output template with extension parameter #50 #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solves #50.
When
youtube-dl
downloads the original file from youtube it's using the given output template to name the file.Currently when podsync asks it to download a file and convert it to audio with an output template like
/path/episodeip.mp3
; this causes the original file to be downloaded as/path/episodeip.mp3
. Which leads toffmpeg
using it as both input and output; this causesffmpeg
to exit immediately saying output file already exists.As a result, all the files stay as
webm
video files named as[episodeid].mp3
s. These can't be served by itunes etc.To reproduce:
Example
ffprobe GD5xkdt2vwY.mp3 -hide_banner
output:One can see the output saying "output file exists" by adding a line to
ytdl.go:106
This PR changes causes podsync to use an output template
[episode_id].%(ext)s
which translates to[episode_id.mp3]
or[episode_id.mp4]
depending on the configuration. please note that youtube-dl will usemp3
ormp4
based on--format
which is passed in functionDownload
inytdl.go:41