@@ -12,14 +12,15 @@ parser = argparse.ArgumentParser(prog='jwb-index',
12
12
usage = '%(prog)s [options] [DIR]' ,
13
13
description = 'Index or download media from tv.jw.org' )
14
14
15
+ # The commented out options would only be valid with a --config file
15
16
add_arguments (parser , ['--quiet' ,
16
17
'--mode' ,
17
18
'--lang' ,
18
19
'--quality' ,
19
20
'--subtitles' ,
20
- '--no-subtitles' ,
21
+ # '--no-subtitles',
21
22
'--download' ,
22
- '--checksum' ,
23
+ # '--checksum',
23
24
'--no-checksum' ,
24
25
'--no-warning' ,
25
26
'--free' ,
@@ -51,12 +52,17 @@ parser.add_argument('--curl-path',
51
52
default = 'curl' ,
52
53
metavar = 'PATH' ,
53
54
help = 'path to the curl binary' )
55
+ parser .add_argument ('--clean-symlinks' ,
56
+ dest = 'clean' ,
57
+ action = 'store_true' ,
58
+ help = 'remove all old symlinks (only valid with --mode=filesystem)' )
54
59
55
60
jwb = JWBroadcasting ()
56
61
# Default values, not set by JWBroadcasting
57
62
jwb .work_dir = '.'
58
63
jwb .mode = None
59
64
jwb .warn = False
65
+ jwb .clean = False
60
66
jwb .exclude_category = 'VODSJJMeetings'
61
67
parser .parse_args (namespace = jwb )
62
68
@@ -87,7 +93,7 @@ elif mode == 'm3u':
87
93
elif mode == 'm3ucompat' :
88
94
jo .output_m3u (r , wd , subdir , flat = True )
89
95
elif mode == 'filesystem' :
90
- jo .clean_symlinks (os .path .join (wd , subdir ), quiet = jwb .quiet )
96
+ jo .clean_symlinks (os .path .join (wd , subdir ), quiet = jwb .quiet , clean_all = jwb . clean )
91
97
jo .output_filesystem (r , wd , subdir )
92
98
elif mode == 'html' :
93
99
jo .output_html (r , wd , subdir )
0 commit comments