Add option to replace download progress overwrite (\r) with newline (\n) #176

Closed
opened 2026-02-20 22:27:19 -05:00 by deekerman · 2 comments
Owner

Originally created by @spidey on GitHub (Dec 17, 2011).

I want to use youtube-dl to download some video with a GUI. I've hoped that I could use the progress reported by youtube-dl to show a graphical progress bar in my GUI.
The problem is that parsing individual bytes is much harder than parsing lines of text. This is why I'd like a switch on youtube-dl to use \n instead of \r when reporting the downloaded status of the video so far.

Originally created by @spidey on GitHub (Dec 17, 2011). I want to use youtube-dl to download some video with a GUI. I've hoped that I could use the progress reported by youtube-dl to show a graphical progress bar in my GUI. The problem is that parsing individual bytes is much harder than parsing lines of text. This is why I'd like a switch on youtube-dl to use \n instead of \r when reporting the downloaded status of the video so far.
Author
Owner

@phihag commented on GitHub (Dec 19, 2011):

Well, if you split by \r instead of \n (or just replace \r with \n), you should already get what you want without any modification. By the way, we're planning on offering a "real" API (see #152) that would be ideal for the use case of a GUI.

Therefore, I don't think an additional option is necessary; as the GUI can just replace \n with \r (if you need any help with that, please post a link to GUI's source code repository).

@phihag commented on GitHub (Dec 19, 2011): Well, if you split by `\r` instead of `\n` (or just replace `\r` with `\n`), you should already get what you want without any modification. By the way, we're planning on offering a "real" API (see #152) that would be ideal for the use case of a GUI. Therefore, I don't think an additional option is necessary; as the GUI can just replace `\n` with `\r` (if you need any help with that, please post a link to GUI's source code repository).
Author
Owner

@spidey commented on GitHub (Dec 19, 2011):

That was what I did. I'm using Qt, so I made an intermediary "buffer" to process \r into \n. But thinking about command line usage, "tr" may do the trick.

@spidey commented on GitHub (Dec 19, 2011): That was what I did. I'm using Qt, so I made an intermediary "buffer" to process \r into \n. But thinking about command line usage, "tr" may do the trick.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#176
No description provided.