Skip to content

Instantly share code, notes, and snippets.

View wlkz's full-sized avatar
😰
Work work

Weiji Zhu wlkz

😰
Work work
View GitHub Profile
@wlkz
wlkz / main.py
Last active February 24, 2022 19:00
import xml.etree.ElementTree as ET
import zipfile
from pathlib import Path
output_path = Path('output')
def parse_container(container_path):
root = ET.fromstring(container_path.open('r').read())
ns = '{urn:oasis:names:tc:opendocument:xmlns:container}'
return [rootfile.attrib['full-path'] for rootfile in root.findall(f'./{ns}rootfiles/{ns}rootfile')]
@wlkz
wlkz / proxy.py
Created December 24, 2020 14:27
from werkzeug.middleware.http_proxy import ProxyMiddleware
from werkzeug.wrappers import Request, Response
from werkzeug.wsgi import get_current_url, get_input_stream
from werkzeug.urls import url_parse
from werkzeug.http import is_hop_by_hop_header
from werkzeug.datastructures import EnvironHeaders
import socket
from http import client
import socks
@wlkz
wlkz / krkr_cg_extractor.py
Last active July 25, 2023 12:43
Krkr cg extractor
# Krkr cg extractor
# Author: wlkz
# Dependency: tlg2png (https://github.com/vn-tools/tlg2png), PIL
# License: WTFPL
import json
import os
import shutil
from pathlib import Path