# Update zim library
2024-01-23T15:15:42Z

If for some reasons you're offline, you still can read wikipedia or other knowledge sources thanks to kiwix project:
=> https://kiwix.org/en/

It uses dumps writen in zim files.
You can find a lot of them here:
=> https://download.kiwix.org/zim

From wikipedia to gutenberg and even french show "C'est pas sorcier" i used to watch when I was a kid.

Most of the times, zim files are big.
To update them one in a while, i wrote a script: zim-update.sh.

It require curl to download zim files, but you can use wget or another tool if you prefer. I strongly suggest to uncomment parts of the script using aria2 to download zim with bittorrent protocol.

In the end, kiwix-manage add new zim to your library, you can read them in a browser thanks to kiwix-serve.
It looks like this:
=> /log/img/kiwix-serve-shot.png

```zim-update.sh
#!/bin/sh
# update zim files
# see https://wiki.kiwix.org/wiki/Content_in_all_languages
# require kiwix-tools and curl

zim_dir=~/docs/zim
zim_library=~/docs/zim/library.xml
zims="wikipedia_fr_all_nopic wiktionary_fr_all_nopic vikidia_fr_all_maxi lesbelleshistoires_fr"

dlurl="https://download.kiwix.org/zim"

cd "${zim_dir}"
for z in ${zims}; do
       # please uncomment to use torrent if you can. Install aria2 to do so
       #zimurl="${dlurl}/${z}.zim"
       #zimtorrent="${zimurl}.torrent"
       #aria2c --seed-time=0 "${zimtorrent}" # disable seed
       #rm *.torrent
       # direct download
       curl -L -O -C - "${zimurl}"
done

# add zims to library
for zim in *.zim; do
       kiwix-manage "${zim_library}" add "${zim}"
done

cat << EOF
You can now run
       kiwix-serve --library ${zim_library} -p 51318
       and open a browser at http://127.0.0.1:51318
EOF


```
---
Comment?

Send it to:
=> mailto:[email protected]?subject=update-zim-library

Find instructions here:
=> https://si3t.ch/log/_commentaires_.txt