From 70eefcc945a20901dc38d04c5920c5c20928f626 Mon Sep 17 00:00:00 2001 From: emijrp Date: Wed, 23 May 2018 14:25:51 +0200 Subject: [PATCH] skiping deleted wikis --- wikispaces.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wikispaces.py b/wikispaces.py index 8d58463..76f85c7 100644 --- a/wikispaces.py +++ b/wikispaces.py @@ -289,9 +289,12 @@ def main(): if not os.path.exists(dirpages): print('Creating directory %s' % (dirpages)) os.makedirs(dirpages) - downloadPagesAndFiles(wikidomain=wikidomain, wikiurl=wikiurl, overwrite=overwrite) sitemapurl = 'https://%s/sitemap.xml' % (wikidomain) downloadSitemap(wikidomain=wikidomain, wikiurl=sitemapurl, overwrite=overwrite) + if not os.path.exists('%s/sitemap.xml' % (wikidomain)): + print('Error, wiki was probably deleted. Skiping wiki...') + continue + downloadPagesAndFiles(wikidomain=wikidomain, wikiurl=wikiurl, overwrite=overwrite) downloadMainPage(wikidomain=wikidomain, wikiurl=wikiurl, overwrite=overwrite) logofilename = downloadLogo(wikidomain=wikidomain, wikiurl=wikiurl, overwrite=overwrite)