Commit 2b47fbaf by murtaugh

don't remove links in fixing on fail

parent 25d839b3
......@@ -20,11 +20,10 @@ def fixurlfilelinks (src, wiki, timestamp=None, phpuploader=None, user=None):
url =
page = upload_url_to_wiki(url, wiki, "{{{{Provenance web|URL={0}|Date={1}]}}}}".format(url, timestamp), phpuploader=phpuploader, user=user)
if page == None:
print ("URL failed {0} removing link: {1}".format(,, file=sys.stderr)
return ""
print ("URL failed {0} leaving link as is: {1}".format(,, file=sys.stderr)
return "[[{0}{1}]]".format(, or "")
return re.sub(r"\[\[(?:File|Fichier|Image)\:(https?\://.+?)(\|.+)?\]\]", linksub, src)
def fixlinks (page, wiki, phpuploader=None, user=None):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment