alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
7.06k stars 454 forks source link

Special characters in playlist title causes unexpected behaviour #350

Open CaptainBlagbird opened 1 year ago

CaptainBlagbird commented 1 year ago

How to reproduce:

  1. Set OUTPUT_TEMPLATE to %(playlist_title)s_%(title)s.%(ext)s or similar
  2. Download the following youtube playlist: https://www.youtube.com/playlist?list=PLHhbws8qZazp4u0l_SrdDHOKhjW4g9r4a (it contains only one short video)

Expected behaviour

The playlist title is "A/B" and the video title is "C/D", so I expect the name of the output file to be "A/B_C/D" in the download directory.

Actual behaviour

A file with name "B_C/D" is created in a subdirectory named "A". So apparently the slash is interpreted as directory symbol, however only in the playlist title and not the video title.

Other info

CaptainBlagbird commented 1 year ago

It has probably something to do with this line.

PikuZheng commented 1 year ago

Screenshot_20231128_052025_edit_3447418158797917.jpg

no issue with mine

CaptainBlagbird commented 1 year ago

@PikuZheng In your screenshot the "M/V" and "C/D" are part of %(title)s, this works. However it does not work for %(playlist_title)s, which I can not see in your screenshot.

PikuZheng commented 1 year ago

I see. "/" in %(title)s and %(playlist_title)s is "\u29F8", which is correct in yt-dlp