From e071e4cb8f9ea290390eefdb3bc72f7a565a648c Mon Sep 17 00:00:00 2001 From: Viktor Lindgren Date: Sat, 21 Sep 2013 17:23:12 +0200 Subject: [PATCH] For option --lastrun creates file if not exist... For option --lastrun creates file if not exist and use DATE now. --- youtube_dl/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) 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: