|
@@ -47,9 +47,18 @@ and can't be created. Please check your configuration and try again"),
|
|
|
os.chdir(self.__targetdir)
|
|
|
if self.downloaded == 0:
|
|
|
try:
|
|
|
- subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
|
|
|
- "http://www.youtube.com/watch?v=%s" % self.ytid],
|
|
|
- stderr=sys.stderr, stdout=open("/dev/null", "w"))
|
|
|
+ if self.__conf.outputlevel == "default":
|
|
|
+ subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
|
|
|
+ "http://www.youtube.com/watch?v=%s" % self.ytid],
|
|
|
+ stderr=sys.stderr, stdout=open("/dev/null", "w"))
|
|
|
+ elif self.__conf.outputlevel == "verbose":
|
|
|
+ subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
|
|
|
+ "http://www.youtube.com/watch?v=%s" % self.ytid],
|
|
|
+ stderr=sys.stderr, stdout=sys.stdout)
|
|
|
+ elif self.__conf.outputlevel == "quiet":
|
|
|
+ subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
|
|
|
+ "http://www.youtube.com/watch?v=%s" % self.ytid],
|
|
|
+ stderr=open("/dev/null", "w"), stdout=open("/dev/null", "w"))
|
|
|
try:
|
|
|
self.__database = sqlite3.connect(self.__conf.dbpath)
|
|
|
except sqlite3.OperationalError:
|