Skip to content

Instantly share code, notes, and snippets.

View noaione's full-sized avatar
🥐
ゆび!ゆび!

noaione

🥐
ゆび!ゆび!
View GitHub Profile
@noaione
noaione / pdf-separation-black.py
Last active December 6, 2025 12:07
force stencil only page in PDF to use separation black
import sys
from pathlib import Path
import pikepdf
from pikepdf import Array, ContentStreamInstruction, Dictionary, Name, Operator
try:
file_path = sys.argv[1]
except IndexError:
print("Usage: python3 pdf-separation-black.py <pdf-file>")
@noaione
noaione / export_poppler_batch.py
Last active November 1, 2025 00:17
batch precalc dpi + exporting (2 files)
# This should be run second
import json
import subprocess as sp
from pathlib import Path
import pydantic
class DpiPrecalculation(pydantic.BaseModel):
@noaione
noaione / ttml_parser.py
Created September 15, 2025 04:16
quick and simple ttml to lrc parser in python, with transliteration replacement support
"""
Needs Python 3.10+
Usage:
```py
from ttml_parser import ttml_to_lrc
ttml_data = "<tt>...</tt>"
@noaione
noaione / uma-pl-gen.py
Last active August 16, 2025 15:33
quick script to generate playlist for Navidrome for my umamusu discography | sorted by the "type" of the album then release date
# /// script
# dependencies = [
# "mutagen",
# ]
# ///
# run with `uv run uma-pl-gen.py` on the same root folder as all the albums folders
from pathlib import Path
@noaione
noaione / comicgr-dl.py
Created August 15, 2025 09:54
quick tools to download stuff since i hate using hakuneko/haruneko because it's bloated with too many stuff (when I just need downloader)
import json
import tomllib
from base64 import b64decode
from datetime import datetime
from io import BytesIO
from pathlib import Path
import requests
import tomli_w
from PIL import Image
@noaione
noaione / amp-retag-jp.py
Last active July 20, 2025 15:19
retag a collection of m4a files in a folders to JP storefront version
"""
Quickly retag multiple m4a files in folders from Apple Music
This is mainly used since my storefront is not JP and I want the original JP metadata
and not translated version of it.
Need to be installed:
- orjson
- requests
- mutagen
@noaione
noaione / settings.json
Last active October 2, 2024 02:46
Rosé Pine Moon VSCode themes with a better Rust integrations | This also mix some color from other Rosé Pine theme
{
// Put this in your settings.json (Ctrl+Shift+P -> Preferences: Open User Settings (JSON))
"editor.tokenColorCustomizations": {
"[Rosé Pine Moon]": {
"textMateRules": [
{
"name": "Rust namespace",
"scope": [
"entity.name.namespace.rust",
"entity.name.namespace",
@noaione
noaione / aone-grab.py
Created July 14, 2024 06:37
use our own custom script to download stuff from asmr.one since their downloader keep OOM-ing for me
import asyncio
import re
import sys
from dataclasses import dataclass
from pathlib import Path
from typing import Literal
import aiofiles
import aiohttp
import orjson
@noaione
noaione / nyaadark.userscript.js
Created June 3, 2024 15:48
can someone turn on the light? no?
// ==UserScript==
// @name Nyaa Always Dark
// @namespace noaione-nyaa-script
// @version 0.1.0
// @description Force always darkmode
// @author N4O
// @match https://nyaa.si/*
// @match https://sukebei.nyaa.si/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=nyaa.si
// @grant GM.getValue
@noaione
noaione / archive.sh
Last active March 4, 2024 23:15
wrap yt-dlp best quality download thingamagic so i can save vtuber stream agane in best quality
#!/bin/bash
yt-dlp --cookies ../cookies.txt -f "bestvideo[ext=mp4]+bestaudio[ext=webm]/bestvideo+bestaudio/best" -o "[%(upload_date)s] %(title)s.%(ext)s" --merge-output-format mkv $1