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

Using youtube-dl in Windows cmd whilst storing a variable seems to strip non ASCII characters #25585

Closed
crackerbear opened this issue Jun 8, 2020 · 1 comment
Labels

Comments

@crackerbear
Copy link

@crackerbear crackerbear commented Jun 8, 2020

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

Running youtube-dl directly in CMD works as expected:

youtube-dl -e "https://www.youtube.com/watch?v=E_JXrNAxGzM"

It correctly gives the title of the Youtube video: 27/12/2016 晚間新聞 楊家駿直播睇手機

However if I try to store the title as a variable and echo the result, the non ASCII characters are stripped:

FOR /F "delims=" %i IN ('youtube-dl -e "https://www.youtube.com/watch?v=E_JXrNAxGzM"') DO (ECHO %i)

This only gives this result: 27/12/2016

Result of the same code as above but with -v

C:\Users\me>FOR /F "delims=" %i IN ('youtube-dl -e "https://www.youtube.com/watch?v=E_JXrNAxGzM" -v') DO (ECHO %i)
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-e', 'https://www.youtube.com/watch?v=E_JXrNAxGzM', '-v']
[debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252
[debug] youtube-dl version 2020.06.06
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg git-2020-05-25-6268034, ffprobe git-2020-05-25-6268034
[debug] Proxy map: {}

C:\Users\me>(ECHO [debug] Default format spec: bestvideo+bestaudio/best )
[debug] Default format spec: bestvideo+bestaudio/best

C:\Users\me>(ECHO 27/12/2016   )
27/12/2016

(Same example here in image form)

Is it something to do with youtube-dl or Windows cmd storing variables?

@crackerbear crackerbear added the question label Jun 8, 2020
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 8, 2020

Nothing to do with youtube-dl.

@dstftw dstftw closed this Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.