safaribooks icon indicating copy to clipboard operation
safaribooks copied to clipboard

There's no instruction to download custom fonts from CSS

Open 0Ky opened this issue 3 years ago • 3 comments

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.

0Ky avatar Nov 15 '21 05:11 0Ky

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

Korred avatar Jan 22 '22 17:01 Korred

@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:

grafik grafik

I will prepare the pull request, with a thorough description on all the changes done, in the upcoming days.

Korred avatar Jan 30 '22 22:01 Korred

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?

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!! 💪🏻💪🏻

lorenzodifuccia avatar Jan 31 '22 14:01 lorenzodifuccia