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

@ -37,7 +37,7 @@ URxvt.keysym.C-S-V: eval:paste_clipboard
! Extensions
URxvt.perl-ext-common: resize-font,bell-command,readline,selection,matcher
URxvt.perl-ext-common: resize-font,bell-command,readline,selection
! Changing font size on the fly (extension: resize-font, package: urxvt-resize-font-git)
URxvt.keysym.C-KP_Subtract: resize-font:smaller
@ -55,7 +55,7 @@ urxvt*shading: 30
URxvt.bell-command: play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null
! Open URL in browser (extension: matcher)
URxvt.url-launcher: o
URxvt.matcher.button: 1
URxvt.matcher.rend.0: Uline Bold fg5
! URxvt.url-launcher: o
! URxvt.matcher.button: 1
! URxvt.matcher.rend.0: Uline Bold fg5

4
config/nvim/.netrwhist Normal file
View File

@ -0,0 +1,4 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhist_cnt =2
let g:netrw_dirhist_1='/etc/wpa_supplicant'
let g:netrw_dirhist_2='/home/geoffrey/.gdotfiles/config/task'

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)

View File

@ -4,3 +4,4 @@ Description=Taskwarrior synchronisation
[Service]
Type=oneshot
ExecStart=/usr/bin/task sync
EnvironmentFile=-/home/geoffrey/config/task/env