rssVideos dryRun

This commit is contained in:
Geoffrey Frogeye 2019-05-08 17:25:23 +02:00
parent a0d2d3082d
commit 53aab39385
4 changed files with 22 additions and 14 deletions

View file

@ -38,6 +38,8 @@ if __name__ == "__main__":
env_var='RSS_VIDEOS_FEED', required=True)
parser.add('--videos', help='Directory to store videos',
env_var='RSS_VIDEOS_VIDEO_DIR', required=True)
parser.add('-n', '--dryrun', help='Do not download the videos',
action='store_const', const=True, default=False)
# TODO This feature might require additional documentation and an on/off switc
parser.add('--track', help='Directory where download videos are maked (so they are not downloaded twice)',
env_var='RSS_VIDEOS_TRACK', required=False, default='.rssVideos')
@ -167,16 +169,17 @@ if __name__ == "__main__":
os.chdir(args.videos)
# TODO Progressbar one day maybe?
# We have all the info we need to make a reliable one
ydl_opts = {
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
for onlineFilename in videosToDownload:
infos = videosInfos[onlineFilename]
if not args.dryrun:
# TODO Progressbar one day maybe?
# We have all the info we need to make a reliable one
ydl_opts = {
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
for onlineFilename in videosToDownload:
infos = videosInfos[onlineFilename]
# Really download
ydl.process_ie_result(infos, True, {})
# Really download
ydl.process_ie_result(infos, True, {})
markTracked(onlineFilename)
markTracked(onlineFilename)