Skip to content

Instantly share code, notes, and snippets.

View christosangelopoulos's full-sized avatar

Christos Angelopoulos christosangelopoulos

View GitHub Profile
@alecwbr
alecwbr / icylogger.lua
Last active November 16, 2023 07:53 — forked from garoto/mpvhistory.lua
mpv script that logs metadata from Icecast streams
-- mpv script that logs metadata from Icecast streams.
-- Also adds a key binding to add an explicit current playing item to a favorite file.
-- Other changes are the string format and date format written to the log files
local CONFIG_DIR = (os.getenv("APPDATA") or os.getenv("HOME").."/.config");
local HISTFILE = CONFIG_DIR.."/mpv/icyhistory.log";
local FAVFILE = CONFIG_DIR.."/mpv/icyfavorites.log";
local function append_to_file(file, val)
local logfile;
@garoto
garoto / mpvhistory.lua
Last active March 6, 2025 22:22
Simple media logger Lua script for mpv
-- Not my code: originally from https://redd.it/3t6s7k (author deleted; failed to ask for permission).
-- Only tested on Windows. Date is set to dd/mmm/yy and time to machine-wide format.
-- Save as "mpvhistory.lua" in your mpv scripts dir. Log will be saved to mpv default config directory.
-- Make sure to leave a comment if you make any improvements/changes to the script!
local HISTFILE = (os.getenv('APPDATA') or os.getenv('HOME')..'/.config')..'/mpv/mpvhistory.log';
mp.register_event('file-loaded', function()
local title, logfile;