Данный код не работает. Должен быть пропуск глав (chapters в mpv), но не работает.
```
local mp = require 'mp'
local msg = require 'mp.msg'
local options = {
    enabled = false,
    skip_once = true,
    categories = "",
    skip = "opening;ending;"
}

mp.options = require "mp.options"
mp.options.read_options(options)

local default_categories = {
    prologue = { "^[Pp]rologue", "^[Ii]ntro" },
    opening = { "^OP", "OP$", "^[Oo]pening", "^[Oo]pening$" },
    ending = { "^ED", "ED$", "^[Ee]nding", "^[Ee]nding$" },
    credits = { "^[Cc]redits", "[Cc]redits$" },
    preview = { "[Pp]review$" }
}

local categories = {}
local skip_categories = {}
local compiled_patterns = {}
local skipped = {}

local function compile_patterns()
    -- Инициализация категорий
    for k, v in pairs(default_categories) do
        categories[k] = v
    end

    -- Разбор пользовательских категорий
    for category in string.gmatch(options.categories, "([^;]+)") do
        local name, patterns = category:match(" *([^+>]+) *+>")
        if name and patterns then
            local lower_name = name:lower()
            categories[lower_name] = {}
            for pattern in patterns:gmatch("([^/]+)") do
                table.insert(categories[lower_name], pattern)
            end
        else
            msg.warn("Неверное определение категории: " .. category)
        end
    end

    -- Разбор опции skip и компиляция шаблонов
    for category in options.skip:gmatch("([^;]+)") do
        local lower_category = category:lower()
        if categories[lower_category] then
            skip_categories[lower_category] = categories[lower_category]
            -- Компилируем шаблоны регулярных выражений
            compiled_patterns[lower_category] = {}
            for _, pattern in ipairs(categories[lower_category]) do
                local success, compiled = pcall(string.match, "", pattern)
                if success then
                    table.insert(compiled_patterns[lower_category], pattern)
                else
                    msg.warn("Ошибка в шаблоне: " .. pattern)
                end
            end
        else
            msg.warn("Категория не найдена: " .. category)
        end
    end
end

compile_patterns()

local function matches(title)
    if not title then return false end
    for _, patterns in pairs(compiled_patterns) do
        for _, pattern in ipairs(patterns) do
            if title:match(pattern) then
                return true
            end
        end
    end
    return false
end

local function chapterskip(_, current)
    if not options.enabled then return end
    if not current then current = 0 end

    local chapters = mp.get_property_native("chapter-list") or {}
    local skip_to_time = nil

    for i = current + 1, #chapters do
        local chapter = chapters[i]
        if chapter and chapter.title and matches(chapter.title) then
            if not options.skip_once or not skipped[i] then
                skip_to_time = chapter.time
                skipped[i] = true
            end
        else
            break
        end
    end

    if skip_to_time then
        mp.set_property_number("time-pos", skip_to_time)
    end
end

mp.observe_property("chapter", "number", chapterskip)
mp.register_event("file-loaded", function() skipped = {} end)

```