Skip to content
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

Accessing offline simple wikipedia when not on the SD card #29

Open
FabrizioRomanoGenovese opened this issue Apr 15, 2023 · 0 comments
Open

Comments

@FabrizioRomanoGenovese
Copy link

FabrizioRomanoGenovese commented Apr 15, 2023

I've seen this topic pop up a lot in the (still opened) issues. Basically I:

  • Installed wikipedia through toltec;
  • Downloaded a .zim file of the simple English wikipedia nopics (2023-03) in my root folder on the remarkable;
  • Turned off WiFi;
  • Started Wikipedia

...And nothing loaded. Looking a bit around, in the current version of main.qml there is this line:

    property string edition: "fb92b95d083f0cb6a2a17794cf164156"; //"wikipedia_en_simple_all_nopic_2019-05";

Whereas in this file, which is the latest script available before everything got moved to toltech, there was the following snippet of code:

#!/bin/bash

mount /dev/sda /home/root/memcard

if [ -f /home/root/memcard/wikipedia.zim ]; then
  #/usr/bin/kiwix-serve --port=8000 /home/root/memcard/wikipedia.zim
  /usr/bin/zimserver -port 8081 -filename /home/root/memcard/wikipedia.zim
else
  #/usr/bin/kiwix-serve --port=8000 /home/root/wikipedia_en_simple_all_novid_2019-05.zim
  /usr/bin/zimserver -port 8081 -filename /home/root/wikipedia_en_simple_all_nopic_2020-04.zim
fi

In this case it is clear that the script is looking for a file named wikipedia.zim on the SD card and, if the SD card is not present, is looking for a file named wikipedia_en_simple_all_nopic_2020-04.zim.

So I tried to bruteforce, and established symlinks from my downloaded version of the .zim file to:

fb92b95d083f0cb6a2a17794cf164156.zim
wikipedia.zim
wikipedia_en_simple_all_nopic_2019-05.zim`
wikipedia_en_simple_all_nopic_2020-04.zim

...basically exhausting all the known names I found where the code would look for the .zim file. Still, I didn't succeed in making it load. Any suggestions?

BTW, I'm not proficient at all in c++ but a very cheap trick to make things work would be to implement the following workflow:

  • if SD is mounted and wikipedia.zim is present, use it. Else:
  • if wikipedia.zim is present in home/root/, use it. Else
  • fetch stuff from the internet.

This would solve a lot of headaches to many people. They could just upload the simple version on the remarkable, the 'big' version on a SD card, and either name them both wikipedia.zim or simlink them both to wikipedia.zim (in case they want to preserve the name of the original file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant