Piped icon indicating copy to clipboard operation
Piped copied to clipboard

URL-based preferences

Open syboxez opened this issue 1 year ago • 5 comments

Describe the feature

Option to save preferences as a bookmark in addition to using cookies. The URL would save a cookie with the settings specified by the URL, that way not every URL would need to have all of the arguments.

Why would this be useful to add?

For browsers that are always in private mode, it would be nice to be able to bookmark a URL with all of my preferences saved.

Concept(s)

Example: https://piped.video/?autoplay=false&proxy_lbry=true&enabled_codecs=av1,vp9,avc&default_quality=4320 would be set as a browser bookmark, and even if cookies are cleared on close (like in private browsing), the settings would still be saved, and there would be no need to restore preferences on every browser launch.

Additional context

No response

Acknowledgements

  • [X] I have searched the existing issues and this is NOT a duplicate or related to another open issue.
  • [X] I have written a short but informative title.
  • [X] I filled out all of the requested information in this form.

syboxez avatar Jul 15 '23 05:07 syboxez

This is a feature in Invidious that I missed when I switched to Piped.

opusforlife2 avatar Aug 07 '23 19:08 opusforlife2

If your browser which is always in Private Mode (or has its site data cleared regularly) runs uBlock Origin, you can set default preferences by adding filters like these:

piped.video,kavin.rocks,whatever-instances-you-u.se##+js(set-local-storage-item, quality, 1080)

You can find the key-value pairs by inspecting your browser's local storage through its developer tools after configuring your preferred settings. The advantage of this approach is that you are not limited to options supported by URL parameters and you don't have to do any URL rewriting either.

Edit: removed trusted- prefix, see my next comment

kaoneko avatar Nov 03 '23 18:11 kaoneko

@kaoneko Thanks! Could you please edit that to show multiple settings being set?

opusforlife2 avatar Nov 03 '23 19:11 opusforlife2

You have to use one line per setting. Also, I just discovered that per today's update of uBO you can't just use trusted-set-local-storage-item in your personal filters without changing an advanced setting first. Settings that use true, false or a number as the value can be set with set-local-storage-item though. My uBO filters for Piped settings look like this:

piped.video##+js(set-local-storage-item, dearrow, true)
piped.video##+js(trusted-set-local-storage-item, enabledCodecs, avc)
piped.video##+js(set-local-storage-item, minimizeComments, true)
piped.video##+js(set-local-storage-item, minimizeRecommendations, true)
piped.video##+js(set-local-storage-item, playerAutoPlay, false)
piped.video##+js(set-local-storage-item, quality, 1080)
piped.video##+js(set-local-storage-item, showWatchOnYouTube, true)

To be able to use trusted-set-local-storage-item you have to check I am an advanced user in uBO settings, click the cogs and add user- to trustedListPrefixes, separated from other values (probably just ublock-) by a space. This means uBO scriptlets with broader permissions can now be used in your personal filters. Use responsibly (don't just copy paste stuff from the internet to your personal filters without understanding what it does).

See also the uBO wiki.

kaoneko avatar Nov 03 '23 20:11 kaoneko

Settings that use true, false or a number as the value can be set with set-local-storage-item though.

@FireMasterK Are there any downsides to changing the enabledCodecs setting to have numbers as input, which map to the 3 codecs in the list? 1 for AVC, 2 for VP9, 3 for AV1, or something? This way there's no need to enable potentially dangerous permissions.

Edit: @kaoneko Good news. There is now an easy checkbox for allowing trusted scriptlets.

opusforlife2 avatar Nov 15 '23 14:11 opusforlife2