diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index b47eebbba..983c70c8d 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -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: