error proofing fetch-later

This commit is contained in:
Lionel Dricot 2023-08-31 20:39:13 +02:00
parent 4c328e32aa
commit 446c940820
1 changed files with 6 additions and 3 deletions

View File

@ -1836,10 +1836,13 @@ def main():
if args.url:
gc.sync_only = True
for u in args.url:
if netcache.is_cache_valid(u):
gc.list_add_line("tour",u)
if looks_like_url(u):
if netcache.is_cache_valid(u):
gc.list_add_line("tour",u)
else:
gc.list_add_line("to_fetch",u)
else:
gc.list_add_line("to_fetch",u)
print("%s is not a valid URL to fetch"%u)
else:
print("--fetch-later requires an URL (or a list of URLS) as argument")
elif args.sync: