mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-19 08:23:22 +08:00
For option --lastrun creates file if not exist...
For option --lastrun creates file if not exist and use DATE now.
This commit is contained in:
parent
c93277812e
commit
e071e4cb8f
@ -534,6 +534,10 @@ def _real_main(argv=None):
|
|||||||
date = DateRange.day(opts.date)
|
date = DateRange.day(opts.date)
|
||||||
else:
|
else:
|
||||||
if opts.lastrun:
|
if opts.lastrun:
|
||||||
|
if not os.path.exists(opts.lastrun):
|
||||||
|
with open(opts.lastrun, "w") as conf:
|
||||||
|
conf.write(date_from_str("now"))
|
||||||
|
|
||||||
with open(opts.lastrun, "r") as conf:
|
with open(opts.lastrun, "r") as conf:
|
||||||
date = DateRange(conf.read(), opts.datebefore)
|
date = DateRange(conf.read(), opts.datebefore)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user