Damien Elmes 2017-11-17 16:20:33 +10:00
parent 0b3685193d
commit 56444ab967

View File

@ -607,6 +607,8 @@ to a cloze type first, via Edit>Change Note Type."""))
return return
finally: finally:
self.mw.progress.finish() self.mw.progress.finish()
# strip off any query string
url = re.sub("\?.*?$", "", url)
path = urllib.parse.unquote(url) path = urllib.parse.unquote(url)
return self.mw.col.media.writeData(path, filecontents) return self.mw.col.media.writeData(path, filecontents)
@ -645,7 +647,7 @@ to a cloze type first, via Edit>Change Note Type."""))
else: else:
# in external pastes, download remote media # in external pastes, download remote media
if self.isURL(src): if self.isURL(src):
fname = self.urlToFile(src) fname = self._retrieveURL(src)
if fname: if fname:
tag['src'] = fname tag['src'] = fname