How to "uncompress" a ZIM file?
Solution 1:
I tried following the answer of @Nicolas Raoul above on a mac but had issues building zimdump
from source and couldn't find any binaries.
After some digging I found from a zimdump
was a binary in alpine so the easiest approach for me was to run zimdump
in docker.
Create a text file called Dockerfile
with this content:
FROM alpine:edge
# add the repository that contains libzim and zim-tools
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
# Installing dependencies
RUN apk update && apk add libzim zim-tools
Then run:
docker build - < Dockerfile
Build docker image:
docker build -t zimdump .
Jump through hoops to mount and run zimpdump:
docker run -v $(pwd):/app -w /app -it zimdump zimdump -D . file.zim
(someone suggests that docker run -v $(pwd):/app -w /app -it zimdump dump --dir=. file.zim
works better)
Solution 2:
The easiest way is to use the zimdump command, part of Zimlib.
Sample output:
zimdump -F wikivoyage_en_all_2015-09.zim
count-articles: 84897
uuid: 9213375a-53f4-819c-47ed-41fc87e7028f
article count: 84897
mime list pos: 80
url ptr pos: 193
title idx pos: 679369
cluster count: 40711
cluster ptr pos: 5169080
checksum pos: 468245393
checksum: 05b9bbf3b6d0c955b6ee74a3f929d911
main page: 44192
layout page: -
Not sure what these all mean but at least article count is available.
The -D
option dumps everything in a directory.
zimdump -D name_of_dir file.zim