"Search Title or ASIN" field unescaped character #156

Closed
opened 2026-04-24 22:59:37 +02:00 by adam · 6 comments
Owner

Originally created by @Nullrogue on GitHub (Dec 30, 2021).

Running version 1.6.45_amd64 on a debian 11 host.

Attempted to use the match feature on a book titled A Brother’s Price
Received the following errors for each available provider:

[GoogleBooks] Volume search error TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
at new ClientRequest (_http_client.js:147:13)
at Object.request (https.js:316:10)
at RedirectableRequest._performRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:265:24)
at new RedirectableRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:61:8)
at Object.request (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:456:14)
at dispatchHttpRequest (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:195:25)
at new Promise ()
at httpAdapter (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:46:10)
at dispatchRequest (/snapshot/audiobookshelf/node_modules/axios/lib/core/dispatchRequest.js:52:10)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
code: 'ERR_UNESCAPED_CHARACTERS'
}

Failed TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
at new ClientRequest (_http_client.js:147:13)
at Object.request (https.js:316:10)
at RedirectableRequest._performRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:265:24)
at new RedirectableRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:61:8)
at Object.request (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:456:14)
at dispatchHttpRequest (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:195:25)
at new Promise ()
at httpAdapter (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:46:10)
at dispatchRequest (/snapshot/audiobookshelf/node_modules/axios/lib/core/dispatchRequest.js:52:10)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
code: 'ERR_UNESCAPED_CHARACTERS'
}
ERROR: OpenLib Search Error 404

ERROR: [Audible] search error TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
at new ClientRequest (_http_client.js:147:13)
at Object.request (https.js:316:10)
at RedirectableRequest._performRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:265:24)
at new RedirectableRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:61:8)
at Object.request (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:456:14)
at dispatchHttpRequest (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:195:25)
at new Promise ()
at httpAdapter (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:46:10)
at dispatchRequest (/snapshot/audiobookshelf/node_modules/axios/lib/core/dispatchRequest.js:52:10)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
code: 'ERR_UNESCAPED_CHARACTERS'
}

Culprit seems to be the character which is identified as U+2019 : RIGHT SINGLE QUOTATION MARK {single comma quotation mark}.

Originally created by @Nullrogue on GitHub (Dec 30, 2021). Running version [1.6.45_amd64](https://github.com/advplyr/audiobookshelf-ppa/blob/master/audiobookshelf_1.6.45_amd64.deb) on a debian 11 host. Attempted to use the match feature on a book titled `A Brother’s Price` Received the following errors for each available provider: > [GoogleBooks] Volume search error TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters > at new ClientRequest (_http_client.js:147:13) > at Object.request (https.js:316:10) > at RedirectableRequest._performRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:265:24) > at new RedirectableRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:61:8) > at Object.request (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:456:14) > at dispatchHttpRequest (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:195:25) > at new Promise (<anonymous>) > at httpAdapter (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:46:10) > at dispatchRequest (/snapshot/audiobookshelf/node_modules/axios/lib/core/dispatchRequest.js:52:10) > at processTicksAndRejections (internal/process/task_queues.js:97:5) { > code: 'ERR_UNESCAPED_CHARACTERS' > } > Failed TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters > at new ClientRequest (_http_client.js:147:13) > at Object.request (https.js:316:10) > at RedirectableRequest._performRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:265:24) > at new RedirectableRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:61:8) > at Object.request (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:456:14) > at dispatchHttpRequest (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:195:25) > at new Promise (<anonymous>) > at httpAdapter (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:46:10) > at dispatchRequest (/snapshot/audiobookshelf/node_modules/axios/lib/core/dispatchRequest.js:52:10) > at processTicksAndRejections (internal/process/task_queues.js:97:5) { > code: 'ERR_UNESCAPED_CHARACTERS' > } > ERROR: OpenLib Search Error 404 > ERROR: [Audible] search error TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters > at new ClientRequest (_http_client.js:147:13) > at Object.request (https.js:316:10) > at RedirectableRequest._performRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:265:24) > at new RedirectableRequest (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:61:8) > at Object.request (/snapshot/audiobookshelf/node_modules/follow-redirects/index.js:456:14) > at dispatchHttpRequest (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:195:25) > at new Promise (<anonymous>) > at httpAdapter (/snapshot/audiobookshelf/node_modules/axios/lib/adapters/http.js:46:10) > at dispatchRequest (/snapshot/audiobookshelf/node_modules/axios/lib/core/dispatchRequest.js:52:10) > at processTicksAndRejections (internal/process/task_queues.js:97:5) { > code: 'ERR_UNESCAPED_CHARACTERS' > } Culprit seems to be the `’` character which is identified as [`U+2019 : RIGHT SINGLE QUOTATION MARK {single comma quotation mark}`](https://www.babelstone.co.uk/Unicode/whatisit.html?string=%E2%80%99).
adam closed this issue 2026-04-24 22:59:37 +02:00
Author
Owner

@Nullrogue commented on GitHub (Dec 30, 2021):

The standard javascript function escape() seems like it might be a candidate for a fix.
escape("’") => '%u2019'

@Nullrogue commented on GitHub (Dec 30, 2021): The standard javascript function [`escape()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/escape) seems like it might be a candidate for a fix. `escape("’") => '%u2019'`
Author
Owner

@Nullrogue commented on GitHub (Dec 30, 2021):

This behavior is also present in the cover art provider search resulting in the same errors.

@Nullrogue commented on GitHub (Dec 30, 2021): This behavior is also present in the cover art provider search resulting in the same errors.
Author
Owner

@mx03 commented on GitHub (Dec 30, 2021):

I create a pull request for this.

@mx03 commented on GitHub (Dec 30, 2021): I create a pull request for this.
Author
Owner

@Nullrogue commented on GitHub (Dec 30, 2021):

Tested this PR and it fixes all the cases I am aware of with this issue. It is also almost the exact same fix I had staged. Beat me to it!

@Nullrogue commented on GitHub (Dec 30, 2021): Tested this PR and it fixes all the cases I am aware of with this issue. It is also almost the exact same fix I had staged. Beat me to it!
Author
Owner

@advplyr commented on GitHub (Dec 30, 2021):

Awesome, thanks for working that out. I just patched the current version.
Just realized you are using the debian package, are you using the PPA? I'm going to update the deb now, I hope to automate that process soon.

@advplyr commented on GitHub (Dec 30, 2021): Awesome, thanks for working that out. I just patched the current version. Just realized you are using the debian package, are you using the PPA? I'm going to update the deb now, I hope to automate that process soon.
Author
Owner

@advplyr commented on GitHub (Dec 30, 2021):

Just pushed the latest version to the PPA https://github.com/advplyr/audiobookshelf-ppa

@advplyr commented on GitHub (Dec 30, 2021): Just pushed the latest version to the PPA https://github.com/advplyr/audiobookshelf-ppa
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#156