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.
Wait for user input after downloading #6522
Comments
|
PS. Use Linux, please. |
|
Just run youtube-dl in opened cmd.exe. |
|
@dstftw you didn't read my request, did you? Your "solution" won't help in my case. As you can see - http://superuser.com/questions/306167/how-to-prevent-the-command-prompt-from-closing-after-execution - it's rather a popular problem, but here every other solution than built-in could change the result. It doesn't matter if it's cmd.exe, start.exe or batch file. It's just different, produces different result, runs application in slightly different env. |
What's the difference? The results should be the same. |
|
@phihag Can this be reopened please? This suggestion was never even discussed properly. I would be really keen on such a feature as well, as it makes it much easier to call youtube-dl from within shell environments. Using batch files is not always desirable, and sometimes even impossible (e.g. they're impossible to use with accented characters). |
|
On Windows this command should make the same effect like --wait:
|
|
Thanks @yan12125, hadn't thought of that. Still, it would make it easier to have such an option available. Is there any reason for not implementing it? I can't imagine it would take a long time to implement. [edit] ... having done some testing, it doesn't always seem to fit the purpose as well. --exec is only executed when a file is actually being downloaded, so '--exec pause' doesn't have any effect when running 'youtube-dl http://abc -F --exec pause'. In this example, no file is being downloaded, so the pause instruction will be ignored. One could work around that, again, by trying some piping ('youtube-dl http://abc -F && pause'), but still, that's a work-around, again. It would by far be easier not having to second-guess the programme's behaviour. |
|
You're right --exec is not the best solution.
Anything wrong with accented characters? |
|
Yes. Try using a word like Löwe in a batch file. The umlauted o will come out in all kinds of shapes and sizes, depending on the character set the user's computer is using. |
|
I see. It's a pity that Windows has awful Unicode support. I guess the reason that this function is not implemented in youtube-dl is that it's totally unrelated to video downloading. Instead, it's more related to process handling of the operating system. To get things like "Wait for a key before exiting" correctly implemented in Python is absolutely difficult, so it's better to leave things handled by the underlying operating system. (for example the "pause" command on Windows)
Could you describe more? Although I have no plan to reopen this, it's always harmless with some brainstorming :) |
Nothing special. Imagine pieces of code where a programmer wants to invoke youtube-dl, for instance with functions like ShellExecute and the likes. Then you may want to need a way to freeze the output of youtube-dl before the execution window disappears, like when you're using the -F parameter. So again, there are ways of engineering around that, but it's easier if you could leave that task up to youtube-dl. |
|
Hmm, I heard that Powershell supports UTF-8 better. How about giving it a try? |
|
Ah don't worry, I was only interested in the --wait option. For the time being, I'll just work around it by adding ' && pause ' to my youtube-dl strings. |
THE CASE. Hello! There's no way in Windows to log all console output or keep command line window opened after executing an application. The workaround - creating batch file with "youtube-dl.exe %*{EOL}pause" - could give different results than direct execute (it's my case*).
THE REQUEST. So my request is the new command line option in "Verbosity / Simulation Options" section to make youtube-dl wait for user input after doing its job, so user could read debug messages. Of course it's not needed when user uses cmd.exe, but when running it externally, it would help a lot.
SIMILAR OPTIONS IN OTHER APPS. I've seen some apps having such switch. The example is TrID. It's there as "-w Wait for a key before exiting".
PROPOSED BEHAVIOR. In youtube-dl there could be like switch like --wait or --user-input or --pause (I think that 1st is the best) with description "wait for user input after completing job" and youtube-dl would show "Press any key to continue..." in a new line after completing all jobs. I thought about description "...after download", but it wouldn't be clear for case when user is downloading whole playlist or other job with more than one download.
Greetings and thanks for your work :)
* youtube-dl gives me an error when I run it from Firefox, but command line window closes and I don't see how it's named. When I'm creating batch file with pause on the end, it works fine, so I can't reproduce it :)