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

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

Closed
sirinath opened this issue Dec 5, 2013 · 5 comments
Closed

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

sirinath opened this issue Dec 5, 2013 · 5 comments

Comments

@sirinath
Copy link

@sirinath sirinath commented 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.
#1896
#1897

@sirinath sirinath mentioned this issue Dec 6, 2013
@phihag
Copy link
Contributor

@phihag phihag commented 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 phihag closed this Dec 8, 2013
@sirinath
Copy link
Author

@sirinath sirinath commented 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.

@phihag
Copy link
Contributor

@phihag phihag commented 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.

@sirinath
Copy link
Author

@sirinath sirinath commented Dec 9, 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
@phihag
Copy link
Contributor

@phihag phihag commented Dec 9, 2013

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

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.