2020-11-17 10:45:35 +05:30
|
|
|
<template>
|
2021-07-20 20:15:17 +05:30
|
|
|
<div class="uk-flex uk-flex-between uk-flex-middle">
|
2021-08-22 15:57:09 +05:30
|
|
|
<button class="uk-button uk-button-text" @click="$router.go(-1) || $router.push('/')">
|
2021-08-26 01:25:30 +05:30
|
|
|
<font-awesome-icon icon="chevron-left" /> {{ $t("actions.back") }}
|
2021-08-22 15:57:09 +05:30
|
|
|
</button>
|
2021-10-09 00:22:51 +05:30
|
|
|
<span><h1 v-t="'titles.preferences'" class="uk-text-bold uk-text-center"/></span>
|
2021-07-20 20:15:17 +05:30
|
|
|
<span />
|
|
|
|
</div>
|
2020-11-22 10:04:27 +05:30
|
|
|
<hr />
|
2021-02-25 20:10:40 +05:30
|
|
|
<h2>SponsorBlock</h2>
|
2021-08-26 01:25:30 +05:30
|
|
|
<p>{{ $t("actions.uses_api_from") }}<a href="https://sponsor.ajay.app/">sponsor.ajay.app</a></p>
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkEnableSponsorblock"><b v-t="'actions.enable_sponsorblock'"/></label>
|
2021-02-25 20:10:40 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<input
|
|
|
|
id="chkEnableSponsorblock"
|
|
|
|
v-model="sponsorBlock"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipSponsors"><b v-t="'actions.skip_sponsors'"/></label>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkSkipSponsors" v-model="skipSponsor" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipIntro"><b v-t="'actions.skip_intro'"/></label>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkSkipIntro" v-model="skipIntro" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipOutro"><b v-t="'actions.skip_outro'"/></label>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkSkipOutro" v-model="skipOutro" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipPreview"><b v-t="'actions.skip_preview'"/></label>
|
2021-07-19 01:23:17 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkSkipPreview" v-model="skipPreview" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-07-19 01:23:17 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipInteraction"><b v-t="'actions.skip_interaction'"/></label>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<input
|
|
|
|
id="chkSkipInteraction"
|
|
|
|
v-model="skipInteraction"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipSelfPromo"><b v-t="'actions.skip_self_promo'"/></label>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<input
|
|
|
|
id="chkSkipSelfPromo"
|
|
|
|
v-model="skipSelfPromo"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkSkipNonMusic"><b v-t="'actions.skip_non_music'"/></label>
|
2021-02-25 20:48:59 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<input
|
|
|
|
id="chkSkipNonMusic"
|
|
|
|
v-model="skipMusicOffTopic"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
2021-05-06 23:00:02 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="ddlTheme"><b v-t="'actions.theme'"/></label>
|
2021-06-29 01:15:03 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<select id="ddlTheme" v-model="selectedTheme" class="uk-select uk-width-auto" @change="onChange($event)">
|
|
|
|
<option v-t="'actions.auto'" value="auto" />
|
|
|
|
<option v-t="'actions.dark'" value="dark" />
|
|
|
|
<option v-t="'actions.light'" value="light" />
|
2021-06-29 01:15:03 +05:30
|
|
|
</select>
|
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkAutoPlayVideo"><b v-t="'actions.autoplay_video'"/></label>
|
2021-05-06 23:00:02 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<input
|
|
|
|
id="chkAutoPlayVideo"
|
|
|
|
v-model="autoPlayVideo"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
2021-06-08 02:05:45 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkAudioOnly"><b v-t="'actions.audio_only'"/></label>
|
2021-06-08 02:05:45 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkAudioOnly" v-model="listen" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-06-22 01:33:11 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="ddlDefaultQuality"><b v-t="'actions.default_quality'"/></label>
|
2021-06-22 01:33:11 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<select id="ddlDefaultQuality" v-model="defaultQuality" class="uk-select uk-width-auto" @change="onChange($event)">
|
|
|
|
<option v-t="'actions.auto'" value="0" />
|
|
|
|
<option v-for="resolution in resolutions" :key="resolution" :value="resolution">{{ resolution }}p</option>
|
2021-06-22 01:33:11 +05:30
|
|
|
</select>
|
2021-06-22 16:24:20 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="txtBufferingGoal"><b v-t="'actions.buffering_goal'"/></label>
|
2021-06-22 16:24:20 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<input
|
|
|
|
id="txtBufferingGoal"
|
|
|
|
v-model="bufferingGoal"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-input uk-width-auto"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="text"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
2021-07-05 18:48:54 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="ddlCountrySelection"><b v-t="'actions.country_selection'"/></label>
|
2021-07-05 18:48:54 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<select
|
|
|
|
id="ddlCountrySelection"
|
|
|
|
v-model="countrySelected"
|
|
|
|
class="uk-select uk-width-auto"
|
|
|
|
@change="onChange($event)"
|
|
|
|
>
|
|
|
|
<option v-for="country in countryMap" :key="country.code" :value="country.code">{{ country.name }}</option>
|
2021-07-05 18:48:54 +05:30
|
|
|
</select>
|
2021-07-19 01:50:35 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="ddlDefaultHomepage"><b v-t="'actions.default_homepage'"/></label>
|
2021-07-19 01:50:35 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<select
|
|
|
|
id="ddlDefaultHomepage"
|
|
|
|
v-model="defaultHomepage"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-select uk-width-auto"
|
2021-09-16 23:49:37 +05:30
|
|
|
@change="onChange($event)"
|
|
|
|
>
|
2021-10-09 00:22:51 +05:30
|
|
|
<option v-t="'titles.trending'" value="trending" />
|
|
|
|
<option v-t="'titles.feed'" value="feed" />
|
2021-07-19 01:50:35 +05:30
|
|
|
</select>
|
2021-07-19 01:57:34 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkShowComments"><b v-t="'actions.show_comments'"/></label>
|
2021-07-19 01:57:34 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkShowComments" v-model="showComments" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-07-30 14:33:16 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkMinimizeDescription"><b v-t="'actions.minimize_description_default'"/></label>
|
|
|
|
<br />
|
|
|
|
<input
|
|
|
|
id="chkMinimizeDescription"
|
|
|
|
v-model="minimizeDescription"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
|
|
|
<br />
|
|
|
|
<label for="chkStoreWatchHistory"><b v-t="'actions.store_watch_history'"/></label>
|
|
|
|
<br />
|
|
|
|
<input
|
|
|
|
id="chkStoreWatchHistory"
|
|
|
|
v-model="watchHistory"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-checkbox"
|
2021-09-16 23:49:37 +05:30
|
|
|
type="checkbox"
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
/>
|
|
|
|
<br />
|
|
|
|
<label for="ddlLanguageSelection"><b v-t="'actions.language_selection'"/></label>
|
|
|
|
<br />
|
|
|
|
<select
|
|
|
|
id="ddlLanguageSelection"
|
|
|
|
v-model="selectedLanguage"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-select uk-width-auto"
|
2021-09-16 23:49:37 +05:30
|
|
|
@change="onChange($event)"
|
|
|
|
>
|
2021-10-09 00:22:51 +05:30
|
|
|
<option v-for="language in languages" :key="language.code" :value="language.code">{{ language.name }}</option>
|
2021-08-25 22:00:21 +05:30
|
|
|
</select>
|
2021-08-27 13:03:55 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="ddlEnabledCodecs"><b v-t="'actions.enabled_codecs'"/></label>
|
2021-08-27 13:03:55 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<select
|
|
|
|
id="ddlEnabledCodecs"
|
|
|
|
v-model="enabledCodecs"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-select uk-width-auto"
|
2021-09-16 23:49:37 +05:30
|
|
|
multiple
|
2021-10-09 00:22:51 +05:30
|
|
|
@change="onChange($event)"
|
2021-09-16 23:49:37 +05:30
|
|
|
>
|
2021-08-27 13:03:55 +05:30
|
|
|
<option value="av1">AV1</option>
|
|
|
|
<option value="vp9">VP9</option>
|
|
|
|
<option value="avc">AVC (h.264)</option>
|
|
|
|
</select>
|
2021-09-02 19:16:27 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkDisableLBRY"><b v-t="'actions.disable_lbry'"/></label>
|
2021-09-02 19:16:27 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkDisableLBRY" v-model="disableLBRY" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-09-02 19:16:27 +05:30
|
|
|
<br />
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="chkEnableLBRYProxy"><b v-t="'actions.enable_lbry_proxy'"/></label>
|
2021-09-02 19:16:27 +05:30
|
|
|
<br />
|
2021-10-09 00:22:51 +05:30
|
|
|
<input id="chkEnableLBRYProxy" v-model="proxyLBRY" class="uk-checkbox" type="checkbox" @change="onChange($event)" />
|
2021-08-26 01:25:30 +05:30
|
|
|
<h2 v-t="'actions.instances_list'" />
|
2020-11-17 10:45:35 +05:30
|
|
|
<table class="uk-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2021-09-05 18:38:26 +05:30
|
|
|
<th>{{ $t("preferences.instance_name") }}</th>
|
|
|
|
<th>{{ $t("preferences.instance_locations") }}</th>
|
|
|
|
<th>{{ $t("preferences.has_cdn") }}</th>
|
|
|
|
<th>{{ $t("preferences.ssl_score") }}</th>
|
2020-11-17 10:45:35 +05:30
|
|
|
</tr>
|
|
|
|
</thead>
|
2021-10-09 00:22:51 +05:30
|
|
|
<tbody v-for="instance in instances" :key="instance.name">
|
2020-11-17 10:45:35 +05:30
|
|
|
<tr>
|
|
|
|
<td>{{ instance.name }}</td>
|
|
|
|
<td>{{ instance.locations }}</td>
|
2021-09-16 23:49:37 +05:30
|
|
|
<td>{{ instance.cdn == "Yes" ? $t("actions.yes") : $t("actions.no") }}</td>
|
2020-11-30 12:09:40 +05:30
|
|
|
<td>
|
2021-09-22 03:28:25 +05:30
|
|
|
<a :href="sslScore(instance.apiurl)" target="_blank"> {{ $t("actions.view_ssl_score") }}</a>
|
2020-11-30 12:09:40 +05:30
|
|
|
</td>
|
2020-11-17 10:45:35 +05:30
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2020-11-22 10:04:27 +05:30
|
|
|
<hr />
|
|
|
|
|
2021-09-16 23:49:37 +05:30
|
|
|
<label for="ddlInstanceSelection"
|
|
|
|
><b>{{ $t("actions.instance_selection") }}:</b></label
|
|
|
|
>
|
|
|
|
<br />
|
|
|
|
<select
|
|
|
|
id="ddlInstanceSelection"
|
|
|
|
v-model="selectedInstance"
|
2021-10-09 00:22:51 +05:30
|
|
|
class="uk-select uk-width-auto"
|
2021-09-16 23:49:37 +05:30
|
|
|
@change="onChange($event)"
|
|
|
|
>
|
2021-10-09 00:22:51 +05:30
|
|
|
<option v-for="instance in instances" :key="instance.name" :value="instance.apiurl">
|
2020-11-17 10:45:35 +05:30
|
|
|
{{ instance.name }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-09-22 01:54:21 +05:30
|
|
|
import CountryMap from "@/utils/CountryMaps/en.json";
|
2020-11-17 10:45:35 +05:30
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
selectedInstance: null,
|
2021-02-25 20:10:40 +05:30
|
|
|
instances: [],
|
2021-02-25 20:48:59 +05:30
|
|
|
sponsorBlock: true,
|
|
|
|
skipSponsor: true,
|
|
|
|
skipIntro: false,
|
|
|
|
skipOutro: false,
|
2021-07-19 01:23:17 +05:30
|
|
|
skipPreview: false,
|
2021-02-25 20:48:59 +05:30
|
|
|
skipInteraction: true,
|
|
|
|
skipSelfPromo: true,
|
2021-04-07 17:15:40 +05:30
|
|
|
skipMusicOffTopic: true,
|
2021-06-29 01:15:03 +05:30
|
|
|
selectedTheme: "dark",
|
2021-05-06 23:00:02 +05:30
|
|
|
autoPlayVideo: true,
|
2021-07-04 00:54:09 +05:30
|
|
|
listen: false,
|
2021-06-22 01:55:38 +05:30
|
|
|
resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320],
|
2021-06-22 01:33:11 +05:30
|
|
|
defaultQuality: 0,
|
2021-06-22 16:24:20 +05:30
|
|
|
bufferingGoal: 10,
|
2021-09-22 01:54:21 +05:30
|
|
|
countryMap: CountryMap,
|
2021-10-09 00:22:51 +05:30
|
|
|
countrySelected: "US",
|
2021-07-19 01:50:35 +05:30
|
|
|
defaultHomepage: "trending",
|
2021-07-19 01:57:34 +05:30
|
|
|
showComments: true,
|
2021-07-30 14:33:16 +05:30
|
|
|
minimizeDescription: false,
|
2021-08-22 15:57:09 +05:30
|
|
|
watchHistory: false,
|
2021-08-25 22:00:21 +05:30
|
|
|
selectedLanguage: "en",
|
|
|
|
languages: [
|
2021-09-06 12:38:15 +05:30
|
|
|
{ code: "bn", name: "বাংলা" },
|
|
|
|
{ code: "de", name: "Deutsch" },
|
|
|
|
{ code: "el", name: "Ελληνικά" },
|
2021-09-16 23:49:37 +05:30
|
|
|
{ code: "es", name: "Español" },
|
|
|
|
{ code: "en", name: "English" },
|
|
|
|
{ code: "fa", name: "فارسی" },
|
2021-09-24 04:07:40 +05:30
|
|
|
{ code: "fi", name: "Suomi" },
|
2021-09-16 23:49:37 +05:30
|
|
|
{ code: "fr", name: "français" },
|
2021-09-16 23:59:48 +05:30
|
|
|
{ code: "hr", name: "Hrvatski" },
|
2021-09-16 23:49:37 +05:30
|
|
|
{ code: "it", name: "italiano" },
|
2021-11-12 19:31:07 +05:30
|
|
|
{ code: "ja", name: "日本語" },
|
2021-09-06 12:38:15 +05:30
|
|
|
{ code: "lt", name: "lietuvių kalba" },
|
|
|
|
{ code: "ml", name: "മലയാളം" },
|
2021-08-26 17:18:23 +05:30
|
|
|
{ code: "nb_NO", name: "Norwegian Bokmål" },
|
2021-09-16 23:59:48 +05:30
|
|
|
{ code: "pl", name: "polski" },
|
2021-11-01 00:17:24 +05:30
|
|
|
{ code: "ru", name: "русский" },
|
2021-09-06 12:38:15 +05:30
|
|
|
{ code: "tr", name: "Türkçe" },
|
2021-11-15 15:47:49 +05:30
|
|
|
{ code: "uk", name: "українська" },
|
2021-09-16 23:59:48 +05:30
|
|
|
{ code: "zh_Hant", name: "繁體中文" },
|
2021-09-24 04:07:40 +05:30
|
|
|
{ code: "zh_Hans", name: "简体中文" },
|
2021-08-25 22:00:21 +05:30
|
|
|
],
|
2021-08-27 13:03:55 +05:30
|
|
|
enabledCodecs: ["av1", "vp9", "avc"],
|
2021-09-02 19:16:27 +05:30
|
|
|
disableLBRY: false,
|
|
|
|
proxyLBRY: false,
|
2020-11-17 10:45:35 +05:30
|
|
|
};
|
|
|
|
},
|
2021-07-21 16:29:53 +05:30
|
|
|
activated() {
|
2021-08-25 22:00:21 +05:30
|
|
|
document.title = this.$t("titles.preferences") + " - Piped";
|
2021-07-21 16:29:53 +05:30
|
|
|
},
|
2021-09-22 01:54:21 +05:30
|
|
|
async mounted() {
|
2021-07-04 00:54:09 +05:30
|
|
|
if (Object.keys(this.$route.query).length > 0) this.$router.replace({ query: {} });
|
|
|
|
|
2021-04-07 17:15:40 +05:30
|
|
|
fetch("https://raw.githubusercontent.com/wiki/TeamPiped/Piped-Frontend/Instances.md")
|
2020-11-17 10:45:35 +05:30
|
|
|
.then(resp => resp.text())
|
|
|
|
.then(body => {
|
|
|
|
var skipped = 0;
|
|
|
|
const lines = body.split("\n");
|
|
|
|
lines.map(line => {
|
|
|
|
const split = line.split("|");
|
2021-11-12 19:25:30 +05:30
|
|
|
if (split.length == 5) {
|
2020-11-17 10:45:35 +05:30
|
|
|
if (skipped < 2) {
|
|
|
|
skipped++;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.instances.push({
|
|
|
|
name: split[0].trim(),
|
|
|
|
apiurl: split[1].trim(),
|
|
|
|
locations: split[2].trim(),
|
2021-04-07 17:15:40 +05:30
|
|
|
cdn: split[3].trim(),
|
2020-11-17 10:45:35 +05:30
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2021-08-26 01:25:30 +05:30
|
|
|
if (this.instances.filter(instance => instance.apiurl == this.apiUrl()).length == 0)
|
|
|
|
this.instances.push({
|
|
|
|
name: "Custom Instance",
|
|
|
|
apiurl: this.apiUrl(),
|
|
|
|
locations: "Unknown",
|
|
|
|
cdn: "Unknown",
|
|
|
|
});
|
2020-11-17 10:45:35 +05:30
|
|
|
});
|
|
|
|
|
2021-08-28 17:30:17 +05:30
|
|
|
if (this.testLocalStorage) {
|
2021-07-05 18:48:54 +05:30
|
|
|
this.selectedInstance = this.getPreferenceString("instance", "https://pipedapi.kavin.rocks");
|
2021-02-25 20:10:40 +05:30
|
|
|
|
2021-07-04 00:54:09 +05:30
|
|
|
this.sponsorBlock = this.getPreferenceBoolean("sponsorblock", true);
|
2021-04-21 19:08:50 +05:30
|
|
|
if (localStorage.getItem("selectedSkip") !== null) {
|
2021-02-25 20:48:59 +05:30
|
|
|
var skipList = localStorage.getItem("selectedSkip").split(",");
|
2021-07-19 01:23:17 +05:30
|
|
|
this.skipSponsor = this.skipIntro = this.skipOutro = this.skipPreview = this.skipInteraction = this.skipSelfPromo = this.skipMusicOffTopic = false;
|
2021-02-25 20:48:59 +05:30
|
|
|
skipList.forEach(skip => {
|
|
|
|
switch (skip) {
|
|
|
|
case "sponsor":
|
|
|
|
this.skipSponsor = true;
|
|
|
|
break;
|
|
|
|
case "intro":
|
|
|
|
this.skipIntro = true;
|
|
|
|
break;
|
|
|
|
case "outro":
|
|
|
|
this.skipOutro = true;
|
|
|
|
break;
|
2021-07-19 01:23:17 +05:30
|
|
|
case "preview":
|
|
|
|
this.skipPreview = true;
|
|
|
|
break;
|
2021-02-25 20:48:59 +05:30
|
|
|
case "interaction":
|
|
|
|
this.skipInteraction = true;
|
|
|
|
break;
|
|
|
|
case "selfpromo":
|
|
|
|
this.skipSelfPromo = true;
|
|
|
|
break;
|
|
|
|
case "music_offtopic":
|
|
|
|
this.skipMusicOffTopic = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
console.log("Unknown sponsor type: " + skip);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2021-05-06 23:00:02 +05:30
|
|
|
|
2021-07-04 00:54:09 +05:30
|
|
|
this.selectedTheme = this.getPreferenceString("theme", "dark");
|
2021-09-18 02:04:51 +05:30
|
|
|
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
|
2021-07-04 00:54:09 +05:30
|
|
|
this.listen = this.getPreferenceBoolean("listen", false);
|
2021-06-22 01:33:11 +05:30
|
|
|
this.defaultQuality = Number(localStorage.getItem("quality"));
|
2021-06-22 16:24:20 +05:30
|
|
|
this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10);
|
2021-10-09 00:22:51 +05:30
|
|
|
this.countrySelected = this.getPreferenceString("region", "US");
|
2021-07-19 01:50:35 +05:30
|
|
|
this.defaultHomepage = this.getPreferenceString("homepage", "trending");
|
2021-07-19 01:57:34 +05:30
|
|
|
this.showComments = this.getPreferenceBoolean("comments", true);
|
2021-07-30 14:33:16 +05:30
|
|
|
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
|
2021-08-22 15:57:09 +05:30
|
|
|
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
|
2021-09-24 04:27:26 +05:30
|
|
|
this.selectedLanguage = this.getPreferenceString("hl", this.defaultLangage);
|
2021-08-27 13:03:55 +05:30
|
|
|
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "av1,vp9,avc").split(",");
|
2021-09-02 19:16:27 +05:30
|
|
|
this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false);
|
|
|
|
this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false);
|
2021-09-22 01:54:21 +05:30
|
|
|
if (this.selectedLanguage != "en") {
|
|
|
|
try {
|
2021-09-24 04:07:40 +05:30
|
|
|
this.CountryMap = await import("@/utils/CountryMaps/" + this.selectedLanguage + ".json").then(
|
|
|
|
val => {
|
|
|
|
this.countryMap = val;
|
|
|
|
},
|
|
|
|
);
|
2021-09-22 01:54:21 +05:30
|
|
|
} catch (e) {
|
|
|
|
console.error("Countries not translated into " + this.selectedLanguage);
|
|
|
|
}
|
|
|
|
}
|
2021-02-25 20:10:40 +05:30
|
|
|
}
|
2020-11-17 10:45:35 +05:30
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChange() {
|
2021-08-28 17:30:17 +05:30
|
|
|
if (this.testLocalStorage) {
|
2021-06-29 01:15:03 +05:30
|
|
|
var shouldReload = false;
|
|
|
|
|
2021-08-22 15:57:09 +05:30
|
|
|
if (
|
|
|
|
this.getPreferenceString("theme", "dark") !== this.selectedTheme ||
|
2021-08-25 22:00:21 +05:30
|
|
|
this.getPreferenceBoolean("watchHistory", false) != this.watchHistory ||
|
2021-09-24 04:27:26 +05:30
|
|
|
this.getPreferenceString("hl", this.defaultLangage) !== this.selectedLanguage ||
|
2021-08-27 13:03:55 +05:30
|
|
|
this.getPreferenceString("enabledCodecs", "av1,vp9,avc") !== this.enabledCodecs.join(",")
|
2021-08-22 15:57:09 +05:30
|
|
|
)
|
|
|
|
shouldReload = true;
|
2021-06-29 01:15:03 +05:30
|
|
|
|
2020-11-17 10:45:35 +05:30
|
|
|
localStorage.setItem("instance", this.selectedInstance);
|
2021-02-25 20:10:40 +05:30
|
|
|
localStorage.setItem("sponsorblock", this.sponsorBlock);
|
2021-02-25 20:48:59 +05:30
|
|
|
|
|
|
|
var sponsorSelected = [];
|
|
|
|
if (this.skipSponsor) sponsorSelected.push("sponsor");
|
|
|
|
if (this.skipIntro) sponsorSelected.push("intro");
|
|
|
|
if (this.skipOutro) sponsorSelected.push("outro");
|
2021-07-19 01:23:17 +05:30
|
|
|
if (this.skipPreview) sponsorSelected.push("preview");
|
2021-02-25 20:48:59 +05:30
|
|
|
if (this.skipInteraction) sponsorSelected.push("interaction");
|
|
|
|
if (this.skipSelfPromo) sponsorSelected.push("selfpromo");
|
2021-04-07 17:15:40 +05:30
|
|
|
if (this.skipMusicOffTopic) sponsorSelected.push("music_offtopic");
|
2021-02-25 20:48:59 +05:30
|
|
|
localStorage.setItem("selectedSkip", sponsorSelected);
|
2021-05-06 23:00:02 +05:30
|
|
|
|
2021-06-29 01:15:03 +05:30
|
|
|
localStorage.setItem("theme", this.selectedTheme);
|
2021-05-06 23:00:02 +05:30
|
|
|
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
|
2021-07-04 00:54:09 +05:30
|
|
|
localStorage.setItem("listen", this.listen);
|
2021-06-22 01:33:11 +05:30
|
|
|
localStorage.setItem("quality", this.defaultQuality);
|
2021-06-22 16:24:20 +05:30
|
|
|
localStorage.setItem("bufferGoal", this.bufferingGoal);
|
2021-10-09 00:22:51 +05:30
|
|
|
localStorage.setItem("region", this.countrySelected);
|
2021-07-19 01:50:35 +05:30
|
|
|
localStorage.setItem("homepage", this.defaultHomepage);
|
2021-07-19 01:57:34 +05:30
|
|
|
localStorage.setItem("comments", this.showComments);
|
2021-07-30 14:33:16 +05:30
|
|
|
localStorage.setItem("minimizeDescription", this.minimizeDescription);
|
2021-08-22 15:57:09 +05:30
|
|
|
localStorage.setItem("watchHistory", this.watchHistory);
|
2021-08-25 22:00:21 +05:30
|
|
|
localStorage.setItem("hl", this.selectedLanguage);
|
2021-08-27 13:03:55 +05:30
|
|
|
localStorage.setItem("enabledCodecs", this.enabledCodecs.join(","));
|
2021-09-02 19:16:27 +05:30
|
|
|
localStorage.setItem("disableLBRY", this.disableLBRY);
|
|
|
|
localStorage.setItem("proxyLBRY", this.proxyLBRY);
|
2021-06-29 01:15:03 +05:30
|
|
|
|
|
|
|
if (shouldReload) window.location.reload();
|
2021-02-25 20:10:40 +05:30
|
|
|
}
|
2020-11-30 12:09:40 +05:30
|
|
|
},
|
|
|
|
sslScore(url) {
|
2021-04-07 17:15:40 +05:30
|
|
|
return "https://www.ssllabs.com/ssltest/analyze.html?d=" + new URL(url).host + "&latest";
|
|
|
|
},
|
|
|
|
},
|
2020-11-17 10:45:35 +05:30
|
|
|
};
|
|
|
|
</script>
|