Skip to content

Instantly share code, notes, and snippets.

@po5
po5 / sub-seek-two.lua
Last active September 4, 2022 11:17
Skip to current subtitle start/end
function sub_seek_two(dir)
if dir == 1 then
target = mp.get_property_number("sub-end")
if target then
mp.commandv("seek", target-0.03, "absolute+exact")
end
else
target = mp.get_property_number("sub-start")
if target then
mp.commandv("seek", target+0.01, "absolute+exact")
function sub_seek_two(dir)
if dir == 1 then
target = mp.get_property_number("sub-end")
if target then
mp.commandv("seek", target-0.03, "absolute+exact")
end
else
target = mp.get_property_number("sub-start")
if target then
mp.commandv("seek", target+0.01, "absolute+exact")
-- This script automatically loads playlist entries before and after the
-- the currently played file. It does so by scanning the directory a file is
-- located in when starting playback. It sorts the directory entries
-- alphabetically, and adds entries before and after the current file to
-- the internal playlist. (It stops if it would add an already existing
-- playlist entry at the same position - this makes it "stable".)
-- Add at most 5000 * 2 files when starting a file (before + after).
--[[
To configure this script use file autoload.conf in directory script-opts (the "script-opts"
import vapoursynth as vs
import math
core = vs.get_core()
def nice_round(x, base=2):
return base * round(x / base)
def resizeroo(clip, max_width, max_height, func):
ratio = min(max_width / clip.width, max_height / clip.height)
clip = func(clip, nice_round(clip.width * ratio), nice_round(clip.height * ratio))
@po5
po5 / universal-torrent-gallery.user.js
Last active April 11, 2024 18:12
Gallery view for trackers
// ==UserScript==
// @name AB search autocomplete
// @namespace https://github.com/po5
// @version 0.2.0
// @description :cool:
// @author Eva
// @homepage https://animebytes.tv/forums.php?action=viewthread&threadid=24689
// @icon https://animebytes.tv/favicon.ico
// @updateURL https://gist.github.com/po5/a56f53567eca72f2f32f2545e0236d39/raw/ab-search-autocomplete.user.js
// @downloadURL https://gist.github.com/po5/a56f53567eca72f2f32f2545e0236d39/raw/ab-search-autocomplete.user.js