Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hl2guide opened this issue Mar 11, 2021 · 18 comments
Closed

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

hl2guide opened this issue Mar 11, 2021 · 18 comments

Comments

@hl2guide
Copy link

hl2guide commented Mar 11, 2021

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
Copy link
Contributor

ajayyy commented Mar 11, 2021

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
Copy link
Author

@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
Copy link
Contributor

ajayyy commented Mar 16, 2021

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

@ghost
Copy link

ghost commented Mar 27, 2021

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
Copy link
Owner

po5 commented Mar 27, 2021

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
Copy link
Author

hl2guide commented Mar 27, 2021

@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
Copy link
Owner

po5 commented Mar 27, 2021

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
Copy link

tsudoko commented Mar 31, 2021

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 #31 (comment). 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
Copy link
Contributor

ajayyy commented Mar 31, 2021

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

@ajayyy
Copy link
Contributor

ajayyy commented Mar 31, 2021

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
Copy link
Contributor

ajayyy commented Apr 18, 2021

The CSV export is now working

@po5
Copy link
Owner

po5 commented Apr 19, 2021

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
Copy link
Contributor

ajayyy commented Apr 23, 2021

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
Copy link

Happen to have any updates on this?

@ghost
Copy link

ghost commented Dec 9, 2021

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
Copy link

I'm also having the same issue.

@kaistian
Copy link

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
Copy link

pek0d commented Jan 1, 2022

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)

tsudoko added a commit to tsudoko/mpv_sponsorblock that referenced this issue Jan 20, 2022
<po5#31 (comment)>:
> 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.

Apart from not making redundant requests, this change also prevents
an issue where you request the dump list but the dump you want to
download becomes inaccessible (removed most likely?) even before
you start downloading it.

This reverts commit 355c8b3.
@po5 po5 closed this as completed in d05c6e7 Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants