DIYgod / DIYgod/download-webhook
代码中对文件名缺少处理&引号包裹,导致有的视频下载失败
- Dominant language
- JavaScript
- Stars
- 217
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
比如:当文件名存在 `|` 或空格
引起问题的代码
https://github.com/DIYgod/download-webhook/blob/b82a58002da77255b3613f4d6052e8093c986d41/lib/engines/you-get.js#L11
https://github.com/DIYgod/download-webhook/blob/b82a58002da77255b3613f4d6052e8093c986d41/lib/engines/bilili.js#L15
可能的修正:
```js
op += ` -O '${options.name}'`;
```
更好的修正:
https://www.npmjs.com/package/sanitize-filename
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with lib/engines/you-get.js at line 11 and lib/engines/bilili.js at line 15, then trace how options.name is incorporated into the download command. Reproduce the failure with a filename containing a space or | and verify that downloads succeed with such names without breaking command construction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100