mirror of
https://github.com/openzim/zimit.git
synced 2025-09-21 19:03:19 -04:00
Adapt to warc2zim2
branch of warc2zim.
`warc2zim2` branch create zim files without service worker.
This commit is contained in:
parent
eab3d1f189
commit
1c58bbe303
@ -9,7 +9,7 @@ RUN apt-get update \
|
||||
# python setup (in venv not to conflict with browsertrix)
|
||||
&& python3 -m venv /app/zimit \
|
||||
&& /app/zimit/bin/python -m pip install --no-cache-dir 'requests==2.31.0' 'inotify==0.2.10' 'tld==0.13' \
|
||||
'git+https://github.com/openzim/warc2zim@main#egg_name=warc2zim' \
|
||||
'git+https://github.com/openzim/warc2zim@warc2zim2#egg_name=warc2zim' \
|
||||
# placeholder (default output location)
|
||||
&& mkdir -p /output \
|
||||
# disable chrome upgrade
|
||||
|
@ -6,9 +6,9 @@ import libzim.reader
|
||||
from warcio import ArchiveIterator
|
||||
|
||||
|
||||
def get_zim_article(zimfile, path):
|
||||
def get_zim_main_entry(zimfile):
|
||||
zim_fh = libzim.reader.Archive(zimfile)
|
||||
return zim_fh.get_entry_by_path(path).get_item().content.tobytes()
|
||||
return zim_fh.main_entry
|
||||
|
||||
|
||||
def test_is_file():
|
||||
@ -20,9 +20,9 @@ def test_zim_main_page():
|
||||
"""Main page specified, http://isago.rskg.org/, was a redirect to https
|
||||
Ensure main page is the redirected page"""
|
||||
|
||||
assert b'"https://isago.rskg.org/"' in get_zim_article(
|
||||
"/output/isago.zim", "A/index.html"
|
||||
)
|
||||
main_entry = get_zim_main_entry("/output/isago.zim")
|
||||
assert main_entry.is_redirect
|
||||
assert main_entry.get_redirect_entry().path == "isago.rskg.org/"
|
||||
|
||||
|
||||
def test_user_agent():
|
||||
|
Loading…
x
Reference in New Issue
Block a user