New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wallabag can't download some articles #5025
Comments
Wallabag's own export produces the filename Looks like that isn't used at all, but the logic looks sound enough either way: koreader/plugins/wallabag.koplugin/main.lua Lines 300 to 301 in eace8d2
The URL I can confirm I can't properly investigate atm. |
Actually, I think it's not UTF-8 aware, so you get an invalid filename like |
@poire-z You've played around with this UTF-8 stuff a bit. Is there a more elegant solution than this? diff --git a/plugins/wallabag.koplugin/main.lua b/plugins/wallabag.koplugin/main.lua
index a6aeee68..0638f787 100644
--- a/plugins/wallabag.koplugin/main.lua
+++ b/plugins/wallabag.koplugin/main.lua
@@ -298,7 +298,9 @@ function Wallabag:download(article)
local skip_article = false
local item_url = "/api/entries/" .. article.id .. "/export.epub"
local title = util.replaceInvalidChars(article.title)
- local local_path = self.directory .. article_id_preffix .. article.id .. article_id_postfix .. title:sub(1,30) .. ".epub"
+ title = title:sub(1,30)
+ title = util.fixUtf8(title, "")
+ local local_path = self.directory .. article_id_preffix .. article.id .. article_id_postfix .. title .. ".epub"
logger.dbg("Wallabag: DOWNLOAD: id: ", article.id)
logger.dbg("Wallabag: DOWNLOAD: title: ", article.title)
logger.dbg("Wallabag: DOWNLOAD: filename: ", local_path) |
May be using |
Btw, this problem should apply equally to all places where I'm a bit conflicted about it. On the one hand it seems to be outside the scope of the function, while on the other hand any characters after 255 are invalid by definition on the lowest common denominator of FAT32. |
May be another function with a more adequate filename like From some old notes of mine:
|
That scenario doesn't make sense to me. I think the current function should either be renamed as suggested and expanded, or made local to util and then used in the safeFilename function. |
^ fine with me, it indeed seems every place that use |
Fixes koreader#5025 The OPDS browser was doing some fancier stuff in a way that should be abstracted away in util (because it applies anywhere files will be saved): https://github.com/koreader/koreader/blob/eace8d25c1cbf9bd13e98220098494e8fb63c18f/frontend/ui/widget/opdsbrowser.lua#L482-L491
Fixes #5025 The OPDS browser was doing some fancier stuff in a way that should be abstracted away in util (because it applies anywhere files will be saved): https://github.com/koreader/koreader/blob/eace8d25c1cbf9bd13e98220098494e8fb63c18f/frontend/ui/widget/opdsbrowser.lua#L482-L491
Can we reopen this issue? And first article is now downloading fine but the second one : I've even deleted it and re-added (with this application https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche) to my framabag server. |
Is it possible to provide some logs? What does your |
You're probably looking for this: full log: |
Okay, so then it should be detected as FAT. What do your logs say? |
Which logs? Can you paste command? |
Your regular The logic of the |
Also pass path from Wallabag plugin. Fixes koreader#5025.
Also pass path from Wallabag plugin. Fixes #5025.
…der#5026) Fixes koreader#5025 The OPDS browser was doing some fancier stuff in a way that should be abstracted away in util (because it applies anywhere files will be saved): https://github.com/koreader/koreader/blob/eace8d25c1cbf9bd13e98220098494e8fb63c18f/frontend/ui/widget/opdsbrowser.lua#L482-L491
…#5036) Also pass path from Wallabag plugin. Fixes koreader#5025.
Issue
Can download couple articles from wallabag. Names:
Inicjatywa Tato.Net | 22 narzędzia, które pomogą Ci wygrać ojcostwo
» Czy policja może namierzyć sprawców fałszywych alarmów bombowych? -- Niebezpiecznik.pl…
Could it be
|
character in first case? coudn't be stored on fat fs ?but what it could be in second one? I don't think it's
»
as couple similar (same source) were processed e.g. this one was processed:» KeePass — jak zacząć swoją przygodę z managerem haseł? -- Niebezpiecznik.pl --
Steps to reproduce
Add below urls to wallabag :
https://tato.net/czytelnia/22-narzedzia-ktore-pomoga-ci-wygrac-ojcostwo/
https://niebezpiecznik.pl/post/czy-policja-moze-namierzyc-sprawcow-falszywych-alarmow-bombowych/?more
and then try download them on koreader.
The text was updated successfully, but these errors were encountered: