umputun / feed-master

Pulls multiple podcast feeds (RSS) and republishes as a common feed, properly sorted and podcast-client friendly.
https://feed-master.umputun.dev
MIT License
118 stars 26 forks source link

Fix yt-dlp output filename template #111

Closed rantanevich closed 1 year ago

rantanevich commented 1 year ago

After upgrading yt-dlp, the target file name is generated as -o {{.Filename}}.tmp + .mp3

$ pip3 freeze | grep yt-dlp
yt-dlp==2023.2.17

$ yt-dlp --extract-audio --audio-format=mp3 --audio-quality=0 -f m4a/bestaudio "https://www.youtube.com/watch?v=hhvNl2a04aM" --no-progress -o 4f92358fcd37f1e117962be5ab69f02cda651d4c.tmp
[youtube] Extracting URL: https://www.youtube.com/watch?v=hhvNl2a04aM
[youtube] hhvNl2a04aM: Downloading webpage
[youtube] hhvNl2a04aM: Downloading android player API JSON
[info] hhvNl2a04aM: Downloading 1 format(s): 140
[download] Destination: 4f92358fcd37f1e117962be5ab69f02cda651d4c.tmp
[download] Download completed
[FixupM4a] Correcting container of "4f92358fcd37f1e117962be5ab69f02cda651d4c.tmp"
[ExtractAudio] Destination: 4f92358fcd37f1e117962be5ab69f02cda651d4c.tmp.mp3
Deleting original file 4f92358fcd37f1e117962be5ab69f02cda651d4c.tmp (pass -k to keep)

But we expect to get {{.Filename}}.mp3 that leads to skipping new entries

https://github.com/umputun/feed-master/blob/0bd1310d05f084e53ed739d0125c87f5608027be/app/youtube/feed/downloader.go#L70-L73

rantanevich commented 1 year ago

My fault I didn't update default value in ./app/config/config.go. So it would allow not to specify c.YouTube.DlTemplate in the config

https://github.com/umputun/feed-master/blob/9be6959e62530be566da90a821ae9c46f0e79db7/app/config/config.go#L169-L171

Should I preparer a new PR or you will fix it yourself?