|
@@ -22,7 +22,7 @@ import os
|
|
|
import sys
|
|
|
import subprocess
|
|
|
|
|
|
-from lib_stov.outputhelper import printf
|
|
|
+from lib_stov import stov_exceptions
|
|
|
|
|
|
|
|
|
class video(object):
|
|
@@ -41,19 +41,13 @@ class video(object):
|
|
|
self.__targetdir = self.__conf.values["downloaddir"] + "/" + directory
|
|
|
if os.access(self.__targetdir, os.F_OK) is False:
|
|
|
try:
|
|
|
- printf(_("Creating directory %s") % self.__targetdir,
|
|
|
- outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
|
|
|
os.makedirs(self.__targetdir, 0o750)
|
|
|
except os.error:
|
|
|
- printf(_("Download directory does not exist \
|
|
|
-and can't be created. Please check your configuration and try again"),
|
|
|
- outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
|
|
|
+ raise stov_exceptions.DirectoryCreationFailedException()
|
|
|
|
|
|
os.chdir(self.__targetdir)
|
|
|
if self.downloaded == 0:
|
|
|
try:
|
|
|
- printf(_('Downloading video "%s"') % self.title,
|
|
|
- outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
|
|
|
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],
|