Describe the bug
Thumbnails don't load if their filename contains a "%" character.
I have also investigated the issue.
The docker logs are:
0|YoutubeDL-Material | URIError: URI malformed
0|YoutubeDL-Material | at decodeURIComponent (<anonymous>)
0|YoutubeDL-Material | at /app/app.js:1684:21
...(truncated)
So the backend here is actually trying to decode an already valid filepath.
For example with a filepath audio/100%Bug.webp: decodeURIComponent("audio/100%Bug.webp") will return an error.
A solution is to simply remove the decodeURIComponent function if it served no purpose.
To Reproduce
Steps to reproduce the behavior:
Download any video that has a % character or set a custom output name which contains a "%" ("100%Bug" for example)
Go to the main page and see your files
Expected behavior
Your files should display the thumbnail, as usual.
Of course, if you download a single video and put a custom output name which doesn't have any "%" in it, everything work fine, but you can't always do that with subscriptions.
Describe the bug Thumbnails don't load if their filename contains a "%" character. I have also investigated the issue.
The docker logs are:
The error apparently comes when it's trying to decode the URI path parameter. https://github.com/Tzahi12345/YoutubeDL-Material/blob/58f4313e500cfcb17aa801934163f474e7be6172/backend/app.js#L1620-L1621 (The line number in app.js inside the container doesn't correspond with the line in the repo)
But the Express documentation says that req.params is already decoded:
(Source: https://expressjs.com/en/4x/api.html#req.params)
So the backend here is actually trying to decode an already valid filepath. For example with a filepath
audio/100%Bug.webp
:decodeURIComponent("audio/100%Bug.webp")
will return an error.A solution is to simply remove the
decodeURIComponent
function if it served no purpose.To Reproduce Steps to reproduce the behavior:
Expected behavior Your files should display the thumbnail, as usual.
Screenshots
Environment