From cd90d30aaafdf28a5716ae8678a55d70176a3c73 Mon Sep 17 00:00:00 2001 From: emijrp Date: Sun, 6 May 2018 14:15:35 +0200 Subject: [PATCH] ia checking --- wikispaces.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wikispaces.py b/wikispaces.py index 72b4126..939fe3e 100644 --- a/wikispaces.py +++ b/wikispaces.py @@ -260,12 +260,14 @@ def main(): if upload: itemid = 'wiki-%s' % (wikidomain) - iahtml = urllib.request.urlopen('https://archive.org/details/%s' % (itemid)).read().decode('utf-8') - if not re.findall(r'Item cannot be found', iahtml): - if not overwriteia: - print('Warning: item exists on Internet Archive. Skipping upload. Force upload with parameter --overwrite-ia') - continue - + try: + iahtml = urllib.request.urlopen('https://archive.org/details/%s' % (itemid)).read().decode('utf-8') + if not re.findall(r'Item cannot be found', iahtml): + if not overwriteia: + print('Warning: item exists on Internet Archive. Skipping upload. Force upload with parameter --overwrite-ia') + continue + except: + pass print('\nCompressing dump...') wikidir = wikidomain os.chdir(wikidir)