Skip to content

Instantly share code, notes, and snippets.

@FiveBoroughs
FiveBoroughs / reorder_xmltv_by_time.py
Created February 28, 2026 18:15
Test scripts for interleaved XMLTV index (Dispatcharr PR #938)
"""Re-order an existing XMLTV file so programmes are sorted by start time.
Uses a two-pass approach to avoid loading the full DOM into memory:
1. First pass: collect (start_time, byte_offset, length) for each programme
2. Sort by start_time
3. Second pass: seek to each offset and write in sorted order
Usage:
python reorder_xmltv_by_time.py input.xml output.xml
"""
@FiveBoroughs
FiveBoroughs / ffmpeg-smart-beta.sh
Last active January 29, 2026 16:01
ffmpeg-smart beta - multi-encoder support
#!/bin/bash
set -euo pipefail
LOG_PREFIX="[ffmpeg-smart]"
# Parse args
AGENT=""
URL=""
# Auto-detect default accel based on available hardware
detect_accel() {
@FiveBoroughs
FiveBoroughs / ffmpeg-smart.sh
Last active February 1, 2026 01:06
Smart HEVC/H.264/MPEG-2 Transcoding
#!/bin/bash
set -euo pipefail
LOG_PREFIX="[ffmpeg-smart]"
# Parse args
AGENT=""
URL=""
while [[ $# -gt 0 ]]; do
if [[ "$1" == "-user_agent" ]]; then