1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-14 05:42:51 +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:
Viktor Lindgren 2013-09-21 17:23:12 +02:00
parent c93277812e
commit e071e4cb8f

View File

@ -534,6 +534,10 @@ def _real_main(argv=None):
date = DateRange.day(opts.date)
else:
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:
date = DateRange(conf.read(), opts.datebefore)
else: