A HTTP server that serves zip files of directories.
-
Copy
config_example.py
toconfig.py
and open it in a text editor. -
Edit the
route_dirs
variable to point to your directory full of totally legal filesLet's say you have a directory structure like this:
home/rzr/files ├── Memes │ └── pepe └── pr0n
And you set
route_dirs
like this:route_dirs = { '/arr/': '/home/rzr/files' }
You can download a zip of your top level subdirectories:
http://127.0.0.1:8420/arr/Memes.zip (works)
http://127.0.0.1:8420/arr/pr0n.zip (works)but non-top level subdirectories are not allowed:
http://127.0.0.1:8420/arr/Memes/pepe.zip (404) -
If you want to restrict access to only certain directories/give custom names to the files, point
route_dirs
to an empty directory and link your directories inside there.
You probably want to put this behind a reverse proxy instead of hosting it bare. A sample nginx proxy.d config has been provided to get you started.
Use a reverse proxy, see the sample nginx config file.
I don't see any advantages to using only Python. Convince me and maybe I'll switch to pure Python.
- A way to prevent certain directories from being zipped (perhaps a .nozip file in the directory)