Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special characters in playlist title causes unexpected behaviour #350

Open
CaptainBlagbird opened this issue Nov 27, 2023 · 4 comments
Open

Comments

@CaptainBlagbird
Copy link

CaptainBlagbird commented Nov 27, 2023

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

  • I created the following python script and ran it in the same docker container:

    from yt_dlp import YoutubeDL
    
    opts = {"outtmpl":{"default":"%(playlist_title)s_%(title)s.%(ext)s"}}
    
    with YoutubeDL(opts) as ydl:
        ydl.download("https://www.youtube.com/playlist?list=PLHhbws8qZazp4u0l_SrdDHOKhjW4g9r4a")

    Here, the problem does not happen and the result is according to the expected behavour.

  • When using option restrictfilenames, the directory A is still created and the file is called "B_C_D". (With the script: No directory and file name "A_B_C_D").

@CaptainBlagbird
Copy link
Author

It has probably something to do with this line.

@PikuZheng
Copy link
Contributor

Screenshot_20231128_052025_edit_3447418158797917.jpg

no issue with mine

@CaptainBlagbird
Copy link
Author

@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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants