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

Python application integration #218

Closed
sajal opened this issue Nov 19, 2011 · 1 comment
Closed

Python application integration #218

sajal opened this issue Nov 19, 2011 · 1 comment

Comments

@sajal
Copy link

@sajal sajal commented Nov 19, 2011

Firstly ive seen #217 and looking forward to API-ification.

In the meantime, im using subprocess to call youtube-dl, but am curious on how my code can get the download progress.

Im running it like so

p = subprocess.Popen([yt_path, "http://www.youtube.com/watch?v=%s" %(ytid),  "-o", filename ], stdout=subprocess.PIPE)
com = p.communicate()

Here after the first line, it executes youtube-dl, only when it finishes the download, the next line is executed with the shell output. Is there a way I can regularly poll the subprocess for the latest shell output so my application can know what the progress is?

I understand this has more to do with subprocess than youtube-dl, but i figured some users may have already figured it out.

@phihag
Copy link
Contributor

@phihag phihag commented Nov 20, 2011

You can simply read from p.stdin asynchronously. We don't make any promises about the output you'll get (that's what #152 would do), but realistically, it won't change much.

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.