safaribooks
safaribooks copied to clipboard
There's no instruction to download custom fonts from CSS
The stylesheet file https://learning.oreilly.com/api/v2/epubs/urn:orm:book:9781482252316/files/styles1.css
has many font-face rules that's trying to load custom fonts stored locally, since there's no instructions in the python script to download the custom fonts, they will not be loaded at all. The following book contains all the .otf files that can be downloaded https://learning.oreilly.com/api/v2/epubs/urn:orm:book:9781482252316/files/?limit=10000
although, they are not fetched by the script.
Hey @lorenzodifuccia,
I am currently looking into adding the download procedure based on the information provided by @0Ky.
While checking the /files/
endpoint I noticed that the toc.ncx / content.opf are also part of the file list.
Can you tell me the reason why you have created your own methods ( create_content_opf
and create_toc / parse_toc
) instead of using those files?
Example .ncx and .opf for the book above:
https://learning.oreilly.com/api/v2/epubs/urn:orm:book:9781482252316/files/toc.ncx
https://learning.oreilly.com/api/v2/epubs/urn:orm:book:9781482252316/files/content.opf
@0Ky - It took a while but I have the changes ready. Below are two examples on how the book (9781482252316) looks like with and without the custom fonts:
I will prepare the pull request, with a thorough description on all the changes done, in the upcoming days.
Can you tell me the reason why you have created your own methods (
create_content_opf
andcreate_toc / parse_toc
) instead of using those files?
Honestly, don't know, maybe because they completely changed the API. Add also this on the PR or on the milestone, please 🙏🏻 I really want to give another life to this project, with the help of the community!! 💪🏻💪🏻