Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
youtube-dl output messages mix cr lf with cr confusing string processing utilities #21067
Comments
|
This is expected behavior for progress bar string.
|
|
Thanks for the quick response. --newline was exactly what I should have been using. I didn't notice that there was an extra, non-printing left bracket after the x0a, i.e. a terminal control sequence. |
Checklist
Verbose log
Note, I'm specifically omitting a verbose log since I've only managed to recreate the bug when youtube-dl runs in non-verbose mode.
Description
I automate youtube-dl by executing it in a separate process. Recently my automation routine began to fail. On investigation I noticed that youtube-dl was mixing MS (CRLF) and Mac (CR) newline styles. Ideally youtube-dl would use the newline style of the platform it's being run on, for a GNU/Linux system that would be LF, when outputting messages to the shell. But it is definitely a bug to mix styles. Below is example output for running
from a bash shell. I've listed the first part of output.txt in hexedecimal so the problematic character can be seen. Note that the problem is intermittent and dependent on whether the
"Unknown speed ETA Unknown ETA"
message (which contains the CRLF) is generated.
For example:
but,
The full, first part of the listing in Hex: