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

--match-title or --reject-title with UTF-8 coded argument #25504

Closed
greyboxgt opened this issue Jun 2, 2020 · 4 comments
Closed

--match-title or --reject-title with UTF-8 coded argument #25504

greyboxgt opened this issue Jun 2, 2020 · 4 comments
Labels

Comments

@greyboxgt
Copy link

@greyboxgt greyboxgt commented Jun 2, 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

WRITE QUESTION HERE

I am trying to filter out some videos where UTF-8 is used in the title. The key word is also in UTF-8. Here is my example script:

youtube-dl -v --encoding utf-8 --playlist-items 3 --match-title "Смешарики" "https://www.youtube.com/user/TVSmeshariki/videos"

The program does not process the UTF-8 coded argument for --match-title "Смешарики" option for me. Please help!

Verbose log

c:\bat>youtube-dl -v --encoding utf-8 --playlist-items 3 --match-title "Смеш
арики" "https://www.youtube.com/user/TVSmeshariki/videos"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--encoding', 'utf-8', '--playlist-items', '3'
, '--match-title', 'Смешарики', 'https://www.youtube.com/user/TVSmeshar
iki/videos']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref utf-8
[debug] youtube-dl version 2020.05.08
[debug] Python version 3.4.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg git-2020-05-15-b18fd2b
[debug] Proxy map: {}
[youtube:user] TVSmeshariki: Downloading channel page
[youtube:playlist] UU5A-Wp9ujcr5g9sYagAafEA: Downloading webpage
[download] Downloading playlist: Uploads from TVSmeshariki
[youtube:playlist] playlist Uploads from TVSmeshariki: Downloading 1 videos
[download] Downloading video 1 of 1
[download] "╨í╨▓╨╛╨▒╨╛╨┤╨╜╤ï╨╣ ╨╛╨▒╨╝╨╡╨╜ - ╨í╨╝╨╡╤ê╨░╤Ç╨╕╨║╨╕ ╨ƒ╨╕╨╜╨║╨╛╨┤. ╨É╨
╖╨▒╤â╨║╨░ ╤ä╨╕╨╜╨░╨╜╤ü╨╛╨▓╨╛╨╣ ╨│╤Ç╨░╨╝╨╛╤é╨╜╨╛╤ü╤é╨╕ | ╨ƒ╨á╨ò╨£╨¼╨ò╨á╨É 2020!"
title did not match pattern "Смешарики
"
[download] Finished downloading playlist: Uploads from TVSmeshariki

@greyboxgt greyboxgt added the question label Jun 2, 2020
@greyboxgt
Copy link
Author

@greyboxgt greyboxgt commented Jun 2, 2020

Without --encoding utf-8 option it looks a bit different, but still doesn't work properly:

youtube-dl -v --playlist-items 3 --match-title "Смешарики" "https://www.youtube.com/user/TVSmeshariki/videos"

c:\bat>youtube-dl -v --playlist-items 3 --match-title "Смешарики" "http
s://www.youtube.com/user/TVSmeshariki/videos"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--playlist-items', '3', '--match-title', 'Смешарики', 'https://www.youtube.com/user/TVSmeshariki/videos']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.05.08
[debug] Python version 3.4.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg git-2020-05-15-b18fd2b
[debug] Proxy map: {}
[youtube:user] TVSmeshariki: Downloading channel page
[youtube:playlist] UU5A-Wp9ujcr5g9sYagAafEA: Downloading webpage
[download] Downloading playlist: Uploads from TVSmeshariki
[youtube:playlist] playlist Uploads from TVSmeshariki: Downloading 1 videos
[download] Downloading video 1 of 1
[download] "Свободный обмен - Смешарики Пинкод. Азбука финансовой грамотности |
ПРЕМЬЕРА 2020!" title did not match pattern "╨í╨╝╨╡╤ê╨░╤Ç╨╕╨║╨╕"
[download] Finished downloading playlist: Uploads from TVSmeshariki

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 2, 2020

As clearly seen from the log you're not passing UTF-8 in the first place.

@dstftw dstftw closed this Jun 2, 2020
@dstftw dstftw added the invalid label Jun 2, 2020
@greyboxgt
Copy link
Author

@greyboxgt greyboxgt commented Jun 2, 2020

Fine, I will re-word my question if it is not clear enough.

@greyboxgt
Copy link
Author

@greyboxgt greyboxgt commented Jun 7, 2020

In case somebody else runs into a similar problem, here is my batch file for Windows:
TVSmeshariki.bat

chcp 65001
youtube-dl ^
--cookies cookies.txt ^
--download-archive archive-TVSmeshariki.txt ^
--playlist-items 1-5 ^
--reject-title "трейлер|сборник|серии" ^
-f bestvideo+bestaudio ^
--merge-output-format mkv ^
-o %%(title)s.%%(ext)s ^
-i ^
"https://www.youtube.com/user/TVSmeshariki/videos"
pause

And also to avoid "OSError: Failed to write string" error, make sure to configure your cmd (command prompt) properties to use the font that supports UTF-8 (for example, Consolas TTF or Lucida Console TTF).

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.