Skip to content

Instantly share code, notes, and snippets.

@natyusha
natyusha / NyaaCopyReleaseDate.user.js
Created November 8, 2025 20:53
Copy the release date of a torrent on nyaa to the clipboard (great for adding files to anidb)
// ==UserScript==
// @name Nyaa - Copy Release Date (YYYY-MM-DD)
// @namespace https://gist.github.com/natyusha
// @version 1.0
// @description Copy the release date of a torrent on nyaa to the clipboard (great for adding files to anidb)
// @match https://*.nyaa.si/*
// @grant GM_setClipboard
// ==/UserScript==
(function () {
@natyusha
natyusha / external-assfonts-dir.lua
Last active November 7, 2025 08:21
Autoload external ASS font files for subtitles in mpv
--[[
* external-assfonts-dir.lua v.2025-11-07
* Autoload external ASS font files for subtitles in mpv
* Author: natyusha
* Link: https://gist.github.com/natyusha/96a11b9e29c243c851e92add1ac42744
--]]
local msg = require 'mp.msg'
local utils = require 'mp.utils'
local opt = require 'mp.options'
@natyusha
natyusha / external-chapters-xml.lua
Last active November 7, 2025 07:52
Autoload external Matroska XML chapter files (.xml) for mpv
--[[
* external-chapters-xml.lua v.2025-11-07
* Autoload external Matroska XML chapter files (.xml) for mpv
* Based on chapter-make-read.lua by dyphire
* Author: natyusha
* Link: https://gist.github.com/natyusha/2c33e54dce3a0136d39c10e1178c7d5b
--]]
local msg = require 'mp.msg'
local utils = require 'mp.utils'
@natyusha
natyusha / 23.975fps-to-24fps-chapters.pyw
Last active September 7, 2025 14:11
A utility that automatically compresses timestamps for mkv chapter xml files from 23.976fps sources that have been converted to 24fps (only affects ChapterTimeStart as other timestamps can be removed)
import os, sys
import tkinter as tk
import xml.etree.ElementTree as ET
try:
from tkinterdnd2 import TkinterDnD, DND_FILES
except ImportError:
print('Please install tkinterdnd2: pip install tkinterdnd2')
sys.exit(1)
@natyusha
natyusha / 23.976fps-to-24fps-subtitles.lua
Last active September 6, 2025 10:29
An Aegisub macro which automatically compresses timestamps for 23.976fps sources that have been converted to 24fps
script_name = "23.976fps to 24fps Subtitles"
script_description = "Automatically compress timestamps for 23.976fps sources that have been converted to 24fps"
script_author = "natyusha"
script_version = "1.0"
function f23_976fps_to_24fps(subs)
-- Scale factor for 23.976fps to 24fps conversion (23.976 / 24)
local scale_factor = 23.976 / 24 -- Approximately 0.999 (999 / 1000)
-- Process all subtitle lines
@natyusha
natyusha / autovsr.lua
Last active July 12, 2025 05:04 — forked from azumukupoe/autovsr.lua
AutoVSR for MPV w/ HEVC Main 10 Support
local mp = require 'mp'
-- Configuration
local autovsr_enabled = true -- Default to VSR enabled
-- Function to apply VSR with dynamic scaling
local function apply_vsr()
-- Get video and display properties
local video_width = mp.get_property_number("width")
local video_height = mp.get_property_number("height")
@natyusha
natyusha / LuaRenamer-NN.lua
Last active October 3, 2025 17:07
Shoko Anime Lua Renamer Config
-- ###### Shoko LuaRenamer NN ######
-- ### Table Manipulation Functions ###
function append(t, s)
s = string.lower(s)
custom_tags = {}
for i = 1,#t do
if(s:match("%[" .. t[i] .. "%]")) then table.insert(custom_tags, s:match("%[" .. t[i] .. "%]")) end
end
return " " .. table.concat(custom_tags, " ")
@natyusha
natyusha / anidb_tmdb_xrefs.csv
Last active November 7, 2025 06:26
Shoko: AniDB → TMDB Mappings
AnidbAnimeId AnidbEpisodeId TmdbMovieId Rating
5 163129 969850 UserVerified
7 6585 128 UserVerified
28 10063 149 UserVerified
43 257 919 FirstAvailable
44 19968 62182 UserVerified
61 378 9323 FirstAvailable
66 399 15999 UserVerified
78 472 9606 FirstAvailable
83 11614 823 UserVerified
@natyusha
natyusha / anidb_tmdb_xrefs+comments.csv
Last active November 7, 2025 06:26
Shoko: AniDB → TMDB Mappings (Comments)
We can't make this file beautiful and searchable because it's too large.
#---------------------------------------------
# AniDB/TMDB Movie Cross-References
AnidbAnimeId,AnidbEpisodeId,TmdbMovieId,Rating
#---------------------------------------------
# AniDB: TV ``Seikai no Senki II`` (a5) S01 (e163129) ``Banner of the Stars II Movie`` (e163129) → TMDB: ``Banner of the Stars II Movie`` (m969850)
5,163129,969850,UserVerified
# AniDB: MV ``Mononoke-hime`` (a7) 001 (e6585) ``Complete Movie`` (e6585) → TMDB: ``Princess Mononoke`` (m128)
@natyusha
natyusha / pairedmuxing.py
Last active November 7, 2025 07:53
This script takes a raw video file and muxes it together with another video file. It will retain chapters/subtitles/attachments from the old file and sync them if there is a delay. Options are included for simply formatting a new file, adding extra audio tracks, and exporting subtitles/attachments/chapters to go along with raws.
#!/usr/bin/env python3
import os, re, sys, json, time, shutil, argparse, subprocess
from xml.etree import ElementTree
r"""
Description:
- This script takes a raw video file and muxes it together with another video file
- It will retain chapters/subtitles/attachments from the old file and sync them if there is a delay
- This script has not been tested on linux and likely won't run there without significant changes
Author: