Skip to content

Instantly share code, notes, and snippets.

@jeryjs
jeryjs / compress_epubs.py
Last active March 10, 2024 12:23
Compress epub files in batch. The script works recursively, and maintains the same input directory's file structure in the output directory. Usage: py ./compress_epubs.py 'path/to/epubs/dir' 'path/to/output/dir'
import argparse
import os
import shutil
import zipfile
from PIL import Image
# min filesize threshold in MB
FILE_THRESHOLD = 1.5
# image compression threshold in %
COMPRESSION_QUALITY = 80
@Ellivers
Ellivers / anime-tracker.user.js
Last active September 2, 2024 00:49
AnimePahe Improvements
// ==UserScript==
// @name AnimePahe Improvements
// @namespace https://gist.github.com/Ellivers/f7716b6b6895802058c367963f3a2c51
// @downloadURL https://gist.github.com/Ellivers/f7716b6b6895802058c367963f3a2c51/raw/anime-tracker.user.js
// @match https://animepahe.com/*
// @match https://animepahe.org/*
// @match https://animepahe.ru/*
// @match https://kwik.*/e/*
// @match https://kwik.*/f/*
// @grant GM_getValue