Skip to content

Instantly share code, notes, and snippets.

View NeraSnow's full-sized avatar

Benjamin Chen NeraSnow

View GitHub Profile
@bagaag
bagaag / change_path.py
Last active September 24, 2024 23:01
Update file system paths in Navidrome's database
# This script changes the path for a folder or file in Navidrome's database, allowing music files to be
# moved or renamed on the file system without losing associated metadata in Navidrome. Since the original
# version, it has been updatd to account for the media_file IDs, which are calculated from the path value
# and referenced in several tables.
#
# This script is based on Navidrome version 0.49.2. If you are running an older version of Navidrom, it
# will likely fail. If you are running a newer version of Navidrome, your mileage may vary.
#
# It does NOT make any modifications to the file system - only to the Navidrome database.
#
@jilljenn
jilljenn / lrc2srt.py
Created April 17, 2022 19:40 — forked from sophana/lrc2srt.py
Convert all LRC files to SRT. With SRT files, you can display lyrics in most media players.
#!/usr/bin/python
import sys
import os
# usage: lrc2srt.py [directory]
# will recusively convert all lrc files to srt in directory
def conv(lrcPath, srtPath):
with open(lrcPath) as lrc:
@AgentOak
AgentOak / youtube_formats.md
Last active November 15, 2024 12:26
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
@oledid
oledid / turn-off-screen.ps1
Created September 24, 2015 07:15
PowerShell: Turn off computer screen
# Source: http://www.powershellmagazine.com/2013/07/18/pstip-how-to-switch-off-display-with-powershell/
# Turn display off by calling WindowsAPI.
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002