|
@@ -1,17 +1,17 @@
|
|
|
#
|
|
|
-# This file is part of stov, written by Helmut Pozimski 2012-2013.
|
|
|
+# This file is part of stov, written by Helmut Pozimski 2012-2015.
|
|
|
#
|
|
|
-# stov is free software: you can redistribute it and/or modify
|
|
|
-# it under the terms of the GNU General Public License as published by
|
|
|
-# the Free Software Foundation, version 2 of the License.
|
|
|
+# stov is free software: you can redistribute it and/or modify
|
|
|
+# it under the terms of the GNU General Public License as published by
|
|
|
+# the Free Software Foundation, version 2 of the License.
|
|
|
#
|
|
|
-# stov is distributed in the hope that it will be useful,
|
|
|
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
-# GNU General Public License for more details.
|
|
|
+# stov is distributed in the hope that it will be useful,
|
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
+# GNU General Public License for more details.
|
|
|
#
|
|
|
-# You should have received a copy of the GNU General Public License
|
|
|
-# along with stov. If not, see <http://www.gnu.org/licenses/>.
|
|
|
+# You should have received a copy of the GNU General Public License
|
|
|
+# along with stov. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
# -*- coding: utf8 -*-
|
|
@@ -36,7 +36,7 @@ class video(object):
|
|
|
self.downloaded = downloaded
|
|
|
self.failcnt = int(failcount)
|
|
|
|
|
|
- def DownloadVideo(self, directory, itag_value):
|
|
|
+ def DownloadVideo(self, directory, itag_value, video_codec):
|
|
|
"""Downloads the video by calling youtube-dl as an external process"""
|
|
|
targetdir = self.__conf.values["downloaddir"] + "/" + directory
|
|
|
if os.access(targetdir, os.F_OK) is False:
|
|
@@ -49,21 +49,21 @@ class video(object):
|
|
|
if self.downloaded == 0:
|
|
|
try:
|
|
|
if self.__conf.outputlevel == "default":
|
|
|
- subprocess.check_call(["youtube-dl", "--max-quality=%s"
|
|
|
- % itag_value, "-t",
|
|
|
+ subprocess.check_call(["youtube-dl", "-f %s/%s"
|
|
|
+ % (itag_value, video_codec), "-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",
|
|
|
+ subprocess.check_call(["youtube-dl", "-f %s/%s"
|
|
|
+ % (itag_value, video_codec), "-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",
|
|
|
+ subprocess.check_call(["youtube-dl", "-f %s/%s"
|
|
|
+ % (itag_value, video_codec), "-t",
|
|
|
"http://www.youtube.com/watch?v=%s"
|
|
|
% self.ytid],
|
|
|
stderr=open("/dev/null", "w"),
|