0

Background

I am having difficulty in implementing you-get in to my python script. I have read up on the documentation, and what I want to do is embed the code into my python script.

Sample Code

import subprocess

print("starting")
subprocess.Popen("you-get \'https://www.youtube.com/watch?v=q1HW6DdBCKw&list=RDx9AcmvHyxN4&index=23\'", stdin = subprocess.PIPE, stdout = subprocess.PIPE)

I've also tried with os to no avail.

Sample Code Error

you-get: [error] oops, something went wrong.
you-get: don't panic, c'est la vie. please try the following steps:
you-get:   (1) Rule out any network problem.
you-get:   (2) Make sure you-get is up-to-date.
you-get:   (3) Check if the issue is already known, on
you-get:         https://github.com/soimort/you-get/wiki/Known-Bugs
you-get:         https://github.com/soimort/you-get/issues
you-get:   (4) Run the command with '--debug' option,
you-get:       and report this issue with the full output.

Research

Read up on the following:

Question

How can I get my python script to run the a you-get command?

3kstc
  • 1,717
  • 2
  • 24
  • 49
  • 1
    What does it say when you run the command with the `--debug` option and get the full output? – Silvio Mayolo Mar 22 '22 at 03:33
  • Have you tried specifying `args` as a list instead of a string? e.g. `subprocess.Popen(["you-get","https://www.youtube.com/watch?v=q1HW6DdBCKw&list=RDx9AcmvHyxN4&index=23"], ...` – jedwards Mar 22 '22 at 03:33
  • I tried a whole array of things, I can list all of them if you like, but there are too many to list. @jedwards yes I tried that - to no avail @SilvioMayolo output is `[DEBUG] get_content: https://www.youtube.com/watch?v=q1HW6DdBCKw` – 3kstc Mar 22 '22 at 03:38
  • Does it work if you use , `shell=True` rather than `stdin = subprocess.PIPE, stdout = subprocess.PIPE`? – David Waterworth Mar 22 '22 at 03:38

0 Answers0