po5 / mpv_sponsorblock

mpv script to skip sponsored segments of YouTube videos
GNU General Public License v3.0
531 stars 29 forks source link

Fix for "[sponsorblock] database update failed" #31

Closed hl2guide closed 1 year ago

hl2guide commented 3 years ago

For me the last time the database update succeeded was: ‎Friday, ‎26 ‎February ‎2021, ‏‎8:33:45 PM

I'm now getting: "[sponsorblock] database update failed"

ajayyy commented 3 years ago

The public database is down right now since I switched from sqlite to postgres. I plan to setup something to dump the database soon. Probably postgres -> csv, and csv -> sqlite for legacy use at more infrequent intervals.

hl2guide commented 3 years ago

@po5 Please consider adding "https://sb.ltn.fi/database.db" (offical mirror) as a fallback database URI since "https://sponsor.ajay.app/database.db" is unavailable.

ajayyy commented 3 years ago

@hl2guide fyi, that one is "frozen" in the last state of the sqlite db.

ghost commented 3 years ago

This mpv_sponsorblock script can't be used at the time at all as-it-is? I don't happen to have the database stored locally.

po5 commented 3 years ago

Set local_database=no to disable this feature for now. Seems like Ajay won't restore the sqlite db so I may just make this default for the time being.

hl2guide commented 3 years ago

@po5 Does setting local_database=no in the config just make it use the API?

Are there any knockon side effects for setting this?

po5 commented 3 years ago

Yup. It leaks your watched videos to the sponsorblock server, but server_fallback is enabled by default and we now only send a hash prefix of the video ID so it's not like much changes at all for privacy.

tsudoko commented 3 years ago

It's not too hard to adapt the script to use the new CSV dumps but it seems like the last entry is the same as the one in the DB file posted in https://github.com/po5/mpv_sponsorblock/issues/31#issuecomment-799765891. I have a local version with initial CSV dump support but I'm not sure if there's a point in using it if the dumps aren't up to date.

ajayyy commented 3 years ago

Yep, I still haven't got automatic dumps working yet.

ajayyy commented 3 years ago

By the way, this PR will change the CSV file names dynamically, so I suggest first hitting the JSON endpoint to get the url to pull from.

The above is not true anymore

ajayyy commented 3 years ago

The CSV export is now working

po5 commented 3 years ago

Thanks, I'll look into this when I can. The changing filenames are a bit of a pain, wish there were links that redirect to the latest version of each file but I'll deal with it.

ajayyy commented 3 years ago

I now updated it to use redirects. You can now directly request from https://sponsor.ajay.app/database/sponsorTimes.csv, and it will trigger a dump if necessary, and then redirect you to the most recent dump. So, feel free to revert the change to use database.json.

It will not wait for the triggered dump to complete, if that occurred.

Whovian9369 commented 2 years ago

Happen to have any updates on this?

ghost commented 2 years ago

How are you supposed to configure the script now? I cleared the database file recently and only see the [sponsorblock] database update failed error in the console:

local ON_WINDOWS = package.config:sub(1,1) ~= "/"

local options = {
    server_address = "https://sponsor.ajay.app/database.json",

    python_path = ON_WINDOWS and "python" or "python3",

    -- Categories to fetch
    categories = "sponsor,intro,outro,interaction,selfpromo",

    -- Categories to skip automatically
    skip_categories = "sponsor,intro,outro,interaction,selfpromo",

    -- If true, sponsored segments will only be skipped once
    skip_once = false,

    -- Note that sponsored segments may ocasionally be inaccurate if this is turned off
    -- see https://blog.ajay.app/voting-and-pseudo-randomness-or-sponsorblock-or-youtube-sponsorship-segment-blocker
    local_database = true,

    -- Update database on first run, does nothing if local_database is false
    auto_update = true,

    -- How long to wait between local database updates
    -- Format: "X[d,h,m]", leave blank to update on every mpv run
    auto_update_interval = "6h",
ThomasEricB commented 2 years ago

I'm also having the same issue.

kaistian commented 2 years ago

Since the database format has changed, you can't use local database until someone add the code necessary. So set local_database = false, and server_address = "https://sponsor.ajay.app", and it will work.

pek0d commented 2 years ago

Since the database format has changed, you can't use local database until someone add the code necessary. So set local_database = false, and server_address = "https://sponsor.ajay.app", and it will work.

thnx this thing was helpful! And no script is working (macOS 12.1; homebrew)