Skip to content

Instantly share code, notes, and snippets.

@core2duoe6420
core2duoe6420 / rename_sub.py
Created October 28, 2025 12:21
Rename subtitle files for TV series to match the video filename
import os
import re
episodes = {}
regex = re.compile(r"(S(\d+))?EP?(\d+)", re.IGNORECASE)
for root, dirs, files in os.walk("."):
for f in files:
if f.endswith(".mp4") or f.endswith(".mkv"):
m = regex.search(f)
@core2duoe6420
core2duoe6420 / velop_log.py
Created February 5, 2022 07:43
A python script to follow Linksys Velop's log printed by sysinfo.cgi
import requests
import time
from datetime import datetime, timedelta
from requests.auth import HTTPBasicAuth
last_time = datetime.min
last_message = ''
while True:
basic = HTTPBasicAuth('admin', '${velop_password}')