error opening certain files with special characters in name #2777

Closed
opened 2019-08-22 18:50:11 +02:00 by tzarebczan · 4 comments
tzarebczan commented 2019-08-22 18:50:11 +02:00 (Migrated from github.com)

See lbry://144BlackestNightby01GreenLantern43Prologuecbz#b

There may be other views/characters affected.

error in console: vendors~comicBookViewer.js:1 Can't load archive! file:///C:/Users/thoma/Downloads/144%20Blackest%20Night%20by%2001%20Green%20Lantern%20 net::ERR_FILE_NOT_FOUND vendors~comicBookViewer.js:1 Request failed TypeError: Failed to fetch

See lbry://144BlackestNightby01GreenLantern43Prologuecbz#b There may be other views/characters affected. error in console: ```vendors~comicBookViewer.js:1 Can't load archive! file:///C:/Users/thoma/Downloads/144%20Blackest%20Night%20by%2001%20Green%20Lantern%20 net::ERR_FILE_NOT_FOUND vendors~comicBookViewer.js:1 Request failed TypeError: Failed to fetch```
btzr-io commented 2019-11-25 06:41:08 +01:00 (Migrated from github.com)

lbry://144BlackestNightby01GreenLantern43Prologuecbz#b

I cant open this archive on my pc either, do you have another example?

> lbry://144BlackestNightby01GreenLantern43Prologuecbz#b I cant open this archive on my pc either, do you have another example?
btzr-io commented 2019-11-25 06:47:20 +01:00 (Migrated from github.com)
const regexImage = new RegExp(
  /^[a-zA-Z0-9_@()-][a-zA-Z0-9_.@()-\s]+.(jpeg|jpg|png|bpm|webp)$/
)

ece4aecfce/src/lib/utils.js (L2-L4)

This is the new regex for validation of the files names, it should take care of this in most cases

``` const regexImage = new RegExp( /^[a-zA-Z0-9_@()-][a-zA-Z0-9_.@()-\s]+.(jpeg|jpg|png|bpm|webp)$/ ) ``` https://github.com/btzr-io/Villain/blob/ece4aecfce2c967c19ba1a7cf580cb9299c1a0cd/src/lib/utils.js#L2-L4 This is the new regex for validation of the files names, it should take care of this in most cases
btzr-io commented 2020-01-11 20:30:19 +01:00 (Migrated from github.com)

Is this still an issue ?

Is this still an issue ?
btzr-io commented 2020-05-08 20:16:31 +02:00 (Migrated from github.com)

I found the cause of this bug, we can't use the protocol: file:// with special characters because is interpreted as an actual url.

Creating a stream to read the file fixes the issue.

I found the cause of this bug, we can't use the protocol: `file://` with special characters because is interpreted as an actual `url`. Creating a stream to read the file fixes the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#2777
No description provided.