GliderGeek / pocket2rm

get articles from read-later platform pocket to the remarkable paper tablet
MIT License
184 stars 15 forks source link

Images missing #4

Open andypillip opened 4 years ago

andypillip commented 4 years ago

Hi there!

Thanks so much for your app! It's what I was missing on my remarkable. I just installed the services (despite your warning of random restarts). My device restarted once for now, I'll keep an eye on it.

I noticed that images are missing from my articles. The log contains lines like

[05:42.243] Warning: Unable to open file /wp-content/uploads/2020/06/GettyImages
-1247012970.jpeg (:0, )

Am I guessing right that it's the readability package that is causing this error? It seems like some prefix is missing to the path, it's actually quite dangerous that it's trying to store images on root level.

I'll be happy to report the issue over at https://github.com/go-shiori/go-readability/

Thanks!

GliderGeek commented 4 years ago

Hey, thanks for the kind words. I actually think that there are no images extracted at all and only the links are kept.

fedecupe commented 3 years ago

Hey, thanks for the kind words. I actually think that there are no images extracted at all and only the links are kept.

Is this by design or is waiting implementation?

GliderGeek commented 3 years ago

This is not necessarily by design, but haven't really missed it myself so never took the effort. Can imagine that very large images could pose a problem since the storage on the reMarkable is not that large?

fedecupe commented 3 years ago

RM2 has > 6GB, also with only 10 articles...

GliderGeek commented 3 years ago

yeah, maybe not really a problem. i won't mind adding this

andypillip commented 3 years ago

I read some source code, and if I'm not mistaken, Readability will return XHTML with absolute URLs in the src attributes?

newSrc := toAbsoluteURI(src, ps.documentURI)
dom.SetAttribute(media, "src", newSrc)

Hence, it would be up to the epub package to go download that image file and add it to the epub – but it seems that it doesn't. Should it?

Instead, it offers a method addImage which probably we'd need to call ourselves for all media…

What is your understanding?