aboutsummaryrefslogtreecommitdiff
path: root/misc/piped-preferences.js
blob: a168418d703c38e953475170c889873e9c006443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ==UserScript==
// @name        fill prefs piped
// @namespace   Violentmonkey Scripts
// @match       https://piped.tjkeller.xyz/*
// @grant       none
// @version     1.0
// @author      tjkeller.xyz
// @description 8/16/2024, 6:10:21 PM
// ==/UserScript==

// all skip options (if any are to be set) must be present to avoid player errors
const skipOptionsDefault = {
	sponsor: "auto",
	intro: "no",
	outro: "no",
	preview: "no",
	interaction: "auto",
	selfpromo: "auto",
	music_offtopic: "auto",
	poi_highlight: "no",
	filler: "no"
}

// fill localStorage { key: value } with preferred options
// any preferences not filled will be default
const prefs = {
	bufferGoal: 30,
	dearrow: true,
	enabledCodecs: "avc",
	homepage: "feed",
	quality: 720,
	showWatchOnYouTube: true,
	watchHistory: true,
	skipOptions: JSON.stringify({...skipOptionsDefault, ...{
		intro: "auto",
		poi_highlight: "button",
		filler: "button",
	}}),
}

// setup localStorage
for (const [key, value] of Object.entries(prefs))
	localStorage.setItem(key, value)