Quote:
Originally Posted by ownedbycats
It works
Btw, what should I put for "My Books" in the url when there's a space?
|
After a little more experimentation, and if you are wiling to use Python templates in Calibre, then the standard library function urllib.parse.quote() may be of use to you – here's an example Python template which uses this function to correctly encode a string in the manner I described above:
Code:
python:
def evaluate(book, context):
import urllib.parse
return urllib.parse.quote(book.title)
Example output:
Quote:
To%20Say%20Nothing%20of%20the%20Dog
The%20Poppy%20War
The%20Fifth%20Season
|
(At first I thought the Calibre template function to_hex() might be useful, but it hex-encodes the
entire string, and without the “%” character. Not really what we want here.)