Make Usage in Scripts Easy | Pipe friendly for scipt integrations #1493

Closed
opened 2026-02-20 22:12:14 -05:00 by deekerman · 5 comments
Owner

Originally created by @sirinath on GitHub (Dec 5, 2013).

Since YDL is a command line tool YDL can ideally used in scripts. So it might be helpful to make YDL more friendly to be used in scripts.

The usage can be in batch files, power shell files, shell scripts, etc.

This can be achieved by:

  1. pipe in command options to execute
  2. load option from file
  3. pipe output for other programs
  4. save file to be used for processing in other programs scripts

To achieve 1 ability to pipe in commands similar to command line option but through stdin. If multiple lines are present it is same as executing YDL multiple times with the different options.

To achieve 2 give ability to have a settings file(s) specified at command line. If multiple lines are present it is same as executing YDL multiple times with the different options.

To achieve 3 is simple. Specify the file in 4 to console.

To achieve 4 implement.
https://github.com/rg3/youtube-dl/issues/1896
https://github.com/rg3/youtube-dl/issues/1897

Originally created by @sirinath on GitHub (Dec 5, 2013). Since YDL is a command line tool YDL can ideally used in scripts. So it might be helpful to make YDL more friendly to be used in scripts. The usage can be in batch files, power shell files, shell scripts, etc. This can be achieved by: 1) pipe in command options to execute 2) load option from file 3) pipe output for other programs 4) save file to be used for processing in other programs scripts To achieve 1 ability to pipe in commands similar to command line option but through stdin. If multiple lines are present it is same as executing YDL multiple times with the different options. To achieve 2 give ability to have a settings file(s) specified at command line. If multiple lines are present it is same as executing YDL multiple times with the different options. To achieve 3 is simple. Specify the file in 4 to console. To achieve 4 implement. https://github.com/rg3/youtube-dl/issues/1896 https://github.com/rg3/youtube-dl/issues/1897
Author
Owner

@phihag commented on GitHub (Dec 8, 2013):

If the program you're writing is nontrivial, you should consider writing it in Python and using youtube-dl as a library. In any case, you can pipe in commands via xargs or so, so there's no need to replicate that in youtube-dl.

@phihag commented on GitHub (Dec 8, 2013): If the program you're writing is nontrivial, you should consider writing it in Python and using youtube-dl as a library. In any case, you can pipe in commands via `xargs` or so, so there's no need to replicate that in youtube-dl.
Author
Owner

@sirinath commented on GitHub (Dec 8, 2013):

Only trouble is I am on windows. Any way with command line arguments you cannot do run as a command loop. What I have been thinking about is to get a set of CMD files to replicate some of the interesting features in GUI clients.

@sirinath commented on GitHub (Dec 8, 2013): Only trouble is I am on windows. Any way with command line arguments you cannot do run as a command loop. What I have been thinking about is to get a set of CMD files to replicate some of the interesting features in GUI clients.
Author
Owner

@phihag commented on GitHub (Dec 8, 2013):

As I wrote above, this is probably better solved in a "real" programming language. I am not sure why you would want to load a number of arguments dynamically from a file in the first place. As I wrote in my email, it would be very helpful to have context here.

@phihag commented on GitHub (Dec 8, 2013): As I wrote above, this is probably better solved in a "real" programming language. I am not sure why you would want to load a number of arguments dynamically from a file in the first place. As I wrote in my email, it would be very helpful to have context here.
Author
Owner

@sirinath commented on GitHub (Dec 8, 2013):

I am looking to do this interactively in some cases.

  1. Request one of more set of info on a URL or playlist
  2. Apply formatting (use enhanced templating support I requested) to each request
  3. pass this to the relevant application(s) or user
  4. wait for next command
  5. in receiving this take appropriate action on the file play list
  6. repeat
@sirinath commented on GitHub (Dec 8, 2013): I am looking to do this interactively in some cases. 1) Request one of more set of info on a URL or playlist 2) Apply formatting (use enhanced templating support I requested) to each request 3) pass this to the relevant application(s) or user 4) wait for next command 5) in receiving this take appropriate action on the file play list 6) repeat
Author
Owner

@phihag commented on GitHub (Dec 8, 2013):

Sounds like you should really do this in a real programming language where you have full control.

@phihag commented on GitHub (Dec 8, 2013): Sounds like you should really do this in a real programming language where you have full control.
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#1493
No description provided.