Skip to content

Instantly share code, notes, and snippets.

View iwalton3's full-sized avatar

Izzie Walton iwalton3

View GitHub Profile

Keybase proof

I hereby claim:

  • I am iwalton3 on github.
  • I am iwalton3 (https://keybase.io/iwalton3) on keybase.
  • I have a public key ASBzhEskQ2k2K7HWtpODJCJcVGYtkXMpMRWmmvhDVf5xngo

To claim this, I am signing this object:

@iwalton3
iwalton3 / raise_mpv.py
Created January 16, 2020 04:17
Raise MPV
# Depends on Python 3 and pywin32.
# https://www.python.org/downloads/
# pip install pywin32
import win32gui
# Mode 5 = Raise to top
# Mode 9 = Unminimize and raise to top
WINDOW_MODE = 5
@iwalton3
iwalton3 / __init__.py
Created February 21, 2020 18:51
Fix for mijofa/jellyfin-mpv-shim pywebview version 3.2.
import threading
import importlib.resources
import webview as webview_module # Python3-webview in Debian, pywebview in pypi
import jinja2 # python3-jinja2 in Debian, Jinja2 in pypi
from ..clients import clientManager
from . import helpers
import threading
@iwalton3
iwalton3 / prompt.bash
Created March 6, 2020 23:17
BASH Prompt and Aliases
#BEGIN prompt code
function makePrompt {
local pred="\[\033[0;31m\]"
local pyellow="\[\033[1;33m\]"
bold=$'\e[1m'; underline=$'\e[4m'; dim=$'\e[2m'; strickthrough=$'\e[9m'; blink=$'\e[5m'; reverse=$'\e[7m'; hidden=$'\e[8m'; normal=$'\e[0m'; black=$'\e[30m'; red=$'\e[31m'; green=$'\e[32m'; orange=$'\e[33m'; blue=$'\e[34m'; purple=$'\e[35m'; aqua=$'\e[36m'; gray=$'\e[37m'; darkgray=$'\e[90m'; lightred=$'\e[91m'; lightgreen=$'\e[92m'; lightyellow=$'\e[93m'; lightblue=$'\e[94m'; lightpurple=$'\e[95m'; lightaqua=$'\e[96m'; white=$'\e[97m'; default=$'\e[39m'; BLACK=$'\e[40m'; RED=$'\e[41m'; GREEN=$'\e[42m'; ORANGE=$'\e[43m'; BLUE=$'\e[44m'; PURPLE=$'\e[45m'; AQUA=$'\e[46m'; GRAY=$'\e[47m'; DARKGRAY=$'\e[100m'; LIGHTRED=$'\e[101m'; LIGHTGREEN=$'\e[102m'; LIGHTYELLOW=$'\e[103m'; LIGHTBLUE=$'\e[104m'; LIGHTPURPLE=$'\e[105m'; LIGHTAQUA=$'\e[106m'; WHITE=$'\e[107m'; DEFAULT=$'\e[49m';
tabChar=$'\t'
#!/usr/bin/env python3
import sys
import subprocess
from align_videos_by_soundtrack.align import SyncDetector, cli_common
remove = []
remove_specified = False
remove_all = False
add = []
add_specified = False
function getMediaTitle(media) {
let parts = media.Part;
for (let k = 0; k < parts.length; k++) {
if (!parts[k].hasOwnProperty("Stream")) continue;
let streams = parts[k].Stream;
for (let l = 0; l < streams.length; l++) {
if (streams[l].streamType == 1 && streams[l].hasOwnProperty("displayTitle")) {
const format = streams[l].displayTitle.match(".* \\((.*)\\)$");
if (format != null) return format[1] + " " + media.container;
else return media.container;
function getMediaTitle(media) {
let parts = media.Part;
for (let k = 0; k < parts.length; k++) {
if (!parts[k].hasOwnProperty("file")) continue;
const format = parts[k].file.match(".*[\\\\/]+([^\\\\/]\+)$");
if (format != null) return format[1];
}
return "Unknown";
}
function getMediaTitle(media) {
let parts = media.Part;
for (let k = 0; k < parts.length; k++) {
if (!parts[k].hasOwnProperty("file")) continue;
const format = parts[k].file.match(".*{([^}]*)}.*$");
if (format != null) return format[1];
}
return "Unknown";
}
@iwalton3
iwalton3 / gpaeq-print.py
Created April 3, 2020 23:49
gpaeq pulseaudio-equalizer, but it is patched to print how many dB you adjust each slider. From: https://github.com/pulseaudio/pulseaudio/blob/master/src/utils/qpaeq
#!/usr/bin/env python3
# qpaeq is a equalizer interface for pulseaudio's equalizer sinks
# Copyright (C) 2009 Jason Newton <nevion@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@iwalton3
iwalton3 / introzapper.sh
Last active January 3, 2023 20:53
Introzapper - Remove intros from videos without a full re-encode. Note by default only 24 seconds can be removed. (License: MIT License)
#!/bin/bash
#[file] [-d detectOnly]
alias ffmpeg="ffmpeg -nostdin"
function shortenVideo {
#[file] [shorten-by] [-d do nothing]
if [[ "$3" == "-d" ]]
then
return