This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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; |