|
@@ -73,6 +73,10 @@ class Connector(object):
|
|
|
def _fetch_videos(self, existing_videos):
|
|
|
"""Retrieves all the relevant videos in a subscription."""
|
|
|
videos_list = []
|
|
|
+ if self._conf.outputlevel == "verbose":
|
|
|
+ stderr = sys.stderr
|
|
|
+ else:
|
|
|
+ stderr = open("/dev/null", "w")
|
|
|
if self._type == "channel" and self._search != "":
|
|
|
try:
|
|
|
video_ids = subprocess.check_output([
|
|
@@ -82,7 +86,7 @@ class Connector(object):
|
|
|
"--match-title",
|
|
|
self._search,
|
|
|
"--get-id",
|
|
|
- self._url]).strip()
|
|
|
+ self._url], stderr=stderr).strip()
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
video_ids = e.output.strip()
|
|
|
else:
|
|
@@ -90,7 +94,7 @@ class Connector(object):
|
|
|
video_ids = subprocess.check_output([
|
|
|
self._conf.values["youtube-dl"], "--max-downloads",
|
|
|
self._conf.values["maxvideos"], "--get-id",
|
|
|
- self._url]).strip()
|
|
|
+ self._url], stderr=stderr).strip()
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
video_ids = e.output.strip()
|
|
|
if len(video_ids) >= 1:
|
|
@@ -105,11 +109,11 @@ class Connector(object):
|
|
|
video_title = subprocess.check_output([
|
|
|
self._conf.values["youtube-dl"], "--get-title",
|
|
|
"https://www.youtube.com/watch?v=%s"
|
|
|
- % video_id]).strip()
|
|
|
+ % video_id], stderr=stderr).strip()
|
|
|
video_description = subprocess.check_output([
|
|
|
self._conf.values["youtube-dl"], "--get-description",
|
|
|
"https://www.youtube.com/watch?v=%s"
|
|
|
- % video_id]).strip()
|
|
|
+ % video_id], stderr=stderr).strip()
|
|
|
except subprocess.CalledProcessError:
|
|
|
raise stov_exceptions.YoutubeDlCallFailed()
|
|
|
else:
|