We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1da4067 commit 04ebcb9Copy full SHA for 04ebcb9
crawler/index.js
@@ -95,11 +95,12 @@ class Crawler {
95
const regex = /!\[[^\]]*\]\((?<filename>.*?)(?=\"|\))(?<optionalpart>\".*\")?\)/g;
96
97
body = body.replace(regex, (_, url) => {
98
- const filename = url.replace(/\/\s*$/,'').split('/').slice(-2).join('-');
99
- const path = join('backup', 'images', filename);
+ const filename = url.replace(/\/\s*$/,'').split('/').slice(-2).join('-').trim();
+ const path = join('backup', 'images', decodeURI(filename));
100
+
101
axios({
102
method: 'get',
- url: encodeURI(url),
103
+ url: encodeURI(decodeURI(url)),
104
responseType: 'stream',
105
})
106
.then(resp => resp.data.pipe(fs.createWriteStream(path)))
0 commit comments