Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
@BenMcLean
BenMcLean / extract_audio_dvd.bat
Created June 9, 2026 23:27
Extract 5.1 DTS streams from Audio DVDs (not DVD-Audio, not Blu-Ray, just Audio DVDs) with ffmpeg and mkvtoolnix
@ECHO OFF
cd /d "%~dp0"
python.exe "%~dpn0.py" %*
@PAUSE
@BenMcLean
BenMcLean / Split-FlacCue.bat
Created June 9, 2026 14:31
Split full-disc FLAC images into frame-accurate, lossless individual tracks using EAC .cue sheets and FFmpeg
@ECHO OFF
cd /d "%~dp0"
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1' \"%1\" \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\""
@PAUSE
@BenMcLean
BenMcLean / dtscd.bat
Last active May 18, 2026 20:31
Convert DTS-CD WAV to 16-bit 5.1 FLAC for more reliable playback (Process is lossy AND buggy so retain both your original WAVs AND your physical DTS-CDs just in case)
@ECHO OFF
CD /D "%~dp1"
ffmpeg -err_detect ignore_err -i "%~1" -af "volume=-1.0dB" -ac 6 -c:a flac -sample_fmt s16 -compression_level 5 "%~dp1%~n1.flac"
@PAUSE
@BenMcLean
BenMcLean / matroska_tagger.py
Last active April 28, 2026 14:14
MusicBrainz Picard plugin: Adds support for reading and writing tags in Matroska (.mkv, .mka) files via MKVToolNix.
# -*- coding: utf-8 -*-
PLUGIN_NAME = "Matroska Tagger"
PLUGIN_AUTHOR = "Ben McLean"
PLUGIN_VERSION = "0.1"
PLUGIN_API_VERSIONS = [
"2.0",
"2.1",
"2.2",
"2.3",
@BenMcLean
BenMcLean / ac3.bat
Last active April 13, 2026 21:32
Extract Dolby Digital 5.1 tracks from decrypted Audio DVDs (tested against Weird Al Yankovic's Straight Outta Lynwood)
@ECHO OFF
cd /d "%~dp0"
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1' \"%1\" \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\""
@PAUSE
@BenMcLean
BenMcLean / extract_games_lib.py
Last active March 19, 2026 18:08
Art assets extraction for Muppets Inside (1996, Starwave)
#!/usr/bin/env python3
r"""
extract_games_lib.py — GAMES.LIB extractor for Muppets Inside (1996, Starwave)
===============================================================================
Zero dependencies — stdlib only. DCL decompressor inlined at the bottom.
Usage:
python3 extract_games_lib.py <games_lib> [output_dir] [filter]
games_lib path to GAMES.LIB (absolute or relative)
@BenMcLean
BenMcLean / organize-roms.ps1
Created January 17, 2026 19:57
Organize ROMs into Alphabetical Range Folders
# Organize ROMs into Alphabetical Range Folders
# This script moves ROM files into folders based on alphabetical ranges and truncates long filenames
param(
[string]$Path = ".",
[int]$MaxFilesPerFolder = 256,
[int]$MaxFilenameLength = 99,
[switch]$WhatIf
)
@BenMcLean
BenMcLean / rvz_to_iso.sh
Last active May 16, 2026 02:06
Batch convert RVZ to ISO using Dolphin's command-line tool
#!/bin/bash
# Check if source argument provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <source_directory> [destination_directory]"
echo "Example: $0 /path/to/rvz/archive /path/to/sdcard"
echo ""
echo "If destination is not provided, files will be converted to the script's directory"
exit 1
fi
@BenMcLean
BenMcLean / iso_to_chd.sh
Last active November 2, 2025 23:58
Use mame-tools chdman to mass convert WAV/BIN/cue CD images to CHD format
#!/bin/bash
# Check if directory argument provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <directory>"
echo "Example: $0 /path/to/psx"
exit 1
fi
TARGET_DIR="$1"
@BenMcLean
BenMcLean / organize_movies.sh
Last active July 4, 2025 00:49
Organize Jellyfin movies into folders based on titles from .nfo files
#!/bin/bash
# Jellyfin Movie Organizer Script
# This script organizes movie files into folders based on titles from .nfo files
# Usage: ./organize_movies.sh [--dry-run] /path/to/your/movie/library
set -e
# Check for xmlstarlet dependency
if ! command -v xmlstarlet >/dev/null 2>&1; then