mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-27 20:58:01 +02:00
Fixed:
- Blank custom api url - Collapsing .pl-item without art
This commit is contained in:
parent
2b33070a8a
commit
170b4a1f27
7 changed files with 124 additions and 96 deletions
|
@ -1,13 +1,19 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
deploy:
|
build:
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
- npm install
|
- npm install
|
||||||
- npm run build
|
- npm run build
|
||||||
- npm install surge
|
when:
|
||||||
|
event: [push, pull_request]
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: node:alpine
|
||||||
|
commands:
|
||||||
|
- npm install surge && npm audit fix
|
||||||
- cp dist/index.html dist/200.html
|
- cp dist/index.html dist/200.html
|
||||||
- npx surge ./dist hyperpipe.surge.sh
|
- npx surge ./dist hyperpipe.surge.sh
|
||||||
secrets: [ surge_login, surge_token ]
|
secrets: [surge_login, surge_token]
|
||||||
when:
|
when:
|
||||||
branch: main
|
branch: main
|
||||||
event: push
|
event: push
|
|
@ -6,8 +6,8 @@
|
||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="default-src 'self'; img-src *; media-src * blob:; style-src 'unsafe-inline' 'self'; connect-src *" />
|
content="default-src 'self'; img-src *; media-src * blob:; style-src 'unsafe-inline' 'self'; connect-src *" />
|
||||||
<link rel="icon" href="/favicon.svg" />
|
<link rel="icon" href="/favicon.svg" />
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
<meta name="msapplication-TileColor" content="#181818">
|
<meta name="msapplication-TileColor" content="#181818" />
|
||||||
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
|
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
|
||||||
<link rel="preconnect" href="https://hyperpipeapi.onrender.com" />
|
<link rel="preconnect" href="https://hyperpipeapi.onrender.com" />
|
||||||
<link rel="dns-prefetch" href="https://pipedapi.kavin.rocks" />
|
<link rel="dns-prefetch" href="https://pipedapi.kavin.rocks" />
|
||||||
|
@ -20,7 +20,9 @@
|
||||||
<meta property="og:title" content="Hyperpipe" />
|
<meta property="og:title" content="Hyperpipe" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:image" content="/android-maskable.png" />
|
<meta property="og:image" content="/android-maskable.png" />
|
||||||
<meta property="og:description" content="Privacy respecting YouTube Music Frontend." />
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content="Privacy respecting YouTube Music Frontend." />
|
||||||
|
|
||||||
<title>Hyperpipe</title>
|
<title>Hyperpipe</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -34,8 +34,10 @@ function set(page) {
|
||||||
<nav>
|
<nav>
|
||||||
<h1 class="bi" @click="home">
|
<h1 class="bi" @click="home">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||||
<path d="M5.097 13.097a2.904 2.904 0 0 1 5.806 0A2.905 2.905 0 0 1 8 16a2.905 2.905 0 0 1-2.903-2.903Z"/>
|
<path
|
||||||
<path d="M2.194 11.618a1.614 1.614 0 1 0 2.258 1.479c0-.661-.399-1.23-.968-1.479v-4.87l3.097 2.065v-4.31l1.432-2.18 1.406 2.09v4.4l3.097-2.065v4.87a1.614 1.614 0 1 0 2.258 1.479c0-.661-.398-1.23-.968-1.479v-7.27L10.71 6.413v-2.4L7.987 0 5.29 4.116v2.297L2.194 4.348v7.27Z"/>
|
d="M5.097 13.097a2.904 2.904 0 0 1 5.806 0A2.905 2.905 0 0 1 8 16a2.905 2.905 0 0 1-2.903-2.903Z" />
|
||||||
|
<path
|
||||||
|
d="M2.194 11.618a1.614 1.614 0 1 0 2.258 1.479c0-.661-.399-1.23-.968-1.479v-4.87l3.097 2.065v-4.31l1.432-2.18 1.406 2.09v4.4l3.097-2.065v4.87a1.614 1.614 0 1 0 2.258 1.479c0-.661-.398-1.23-.968-1.479v-7.27L10.71 6.413v-2.4L7.987 0 5.29 4.116v2.297L2.194 4.348v7.27Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|
|
@ -83,33 +83,23 @@ async function Stream() {
|
||||||
window.audioPlayer
|
window.audioPlayer
|
||||||
.load(url, 0, mime)
|
.load(url, 0, mime)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
window.audioPlayer.configure('abr.enabled', true);
|
||||||
|
|
||||||
if (quality && quality != 'auto') {
|
if (quality && quality != 'auto') {
|
||||||
window.audioPlayer.configure('abr.enabled', false);
|
window.audioPlayer.configure('abr.enabled', false);
|
||||||
|
|
||||||
const tracks = window.audioPlayer.getVariantTracks();
|
const tracks = window.audioPlayer.getVariantTracks(),
|
||||||
|
bandwidths = tracks.map(i => i.bandwidth);
|
||||||
|
|
||||||
let sel;
|
let sel;
|
||||||
|
|
||||||
if (quality == 'best') {
|
if (quality == 'best') sel = Math.max(...bandwidths);
|
||||||
let best = { bandwidth: 0 };
|
else if (quality == 'worst') sel = Math.min(...bandwidths);
|
||||||
|
|
||||||
tracks.forEach(track => {
|
|
||||||
if (track.bandwidth > best.bandwidth) best = track;
|
|
||||||
});
|
|
||||||
|
|
||||||
sel = best;
|
|
||||||
} else if (quality == 'worst') {
|
|
||||||
let worst = { bandwidth: 10 ** 8 };
|
|
||||||
|
|
||||||
tracks.forEach(track => {
|
|
||||||
if (track.bandwidth < worst.bandwidth) worst = track;
|
|
||||||
});
|
|
||||||
|
|
||||||
sel = worst;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sel) {
|
if (sel) {
|
||||||
window.audioPlayer.selectVariantTrack(sel);
|
window.audioPlayer.selectVariantTrack(
|
||||||
|
tracks[bandwidths.indexOf(sel)],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -56,9 +56,9 @@ defineEmits(['playthis']);
|
||||||
.pl-item {
|
.pl-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
grid-column-gap: 1rem;
|
min-height: 3.55rem;
|
||||||
|
grid-column-gap: 0.4rem;
|
||||||
padding: 0.4rem;
|
padding: 0.4rem;
|
||||||
padding-right: 1rem;
|
|
||||||
margin: 0.125rem;
|
margin: 0.125rem;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
background: var(--color-background);
|
background: var(--color-background);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
|
|
||||||
import { getJson } from '@/scripts/fetch.js';
|
import { getJson } from '@/scripts/fetch.js';
|
||||||
import { SUPPORTED_LOCALES, useI18n } from '@/stores/misc.js';
|
import { SUPPORTED_LOCALES, useI18n } from '@/stores/misc.js';
|
||||||
|
@ -53,6 +53,22 @@ function getStoreBool(key, ele) {
|
||||||
ele.value = getStore(key) || true;
|
ele.value = getStore(key) || true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const verifyApi = computed(() =>
|
||||||
|
hypInstances.value
|
||||||
|
.map(i => i.api_url.replace('https://', '').replace('http://'))
|
||||||
|
.includes(getStore('api') || 'hyperpipeapi.onrender.com'),
|
||||||
|
),
|
||||||
|
verifyPipedApi = computed(() =>
|
||||||
|
instances.value
|
||||||
|
.map(i => i.api_url.replace('https://', ''))
|
||||||
|
.includes(getStore('pipedapi') || 'pipedapi.kavin.rocks'),
|
||||||
|
),
|
||||||
|
verifyAuthApi = computed(() =>
|
||||||
|
instances.value
|
||||||
|
.map(i => i.api_url.replace('https://', ''))
|
||||||
|
.includes(getStore('authapi') || 'pipedapi.kavin.rocks'),
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getStoreBool('next', next);
|
getStoreBool('next', next);
|
||||||
});
|
});
|
||||||
|
@ -143,6 +159,10 @@ onMounted(() => {
|
||||||
:value="i.api_url.replace('https://', '').replace('http://', '')">
|
:value="i.api_url.replace('https://', '').replace('http://', '')">
|
||||||
{{ i.name }}
|
{{ i.name }}
|
||||||
</option>
|
</option>
|
||||||
|
|
||||||
|
<option v-if="!verifyApi">
|
||||||
|
{{ getStore('api') || 'hyperpipeapi.onrender.com' }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<div class="table-wrap">
|
<div class="table-wrap">
|
||||||
|
@ -174,9 +194,13 @@ onMounted(() => {
|
||||||
<option
|
<option
|
||||||
v-for="i in instances"
|
v-for="i in instances"
|
||||||
:key="i.name"
|
:key="i.name"
|
||||||
:value="i.api_url.replace('https://', '').replace('http://', '')">
|
:value="i.api_url.replace('https://', '')">
|
||||||
{{ i.name.replace('Official', 'Default') }}
|
{{ i.name.replace('Official', 'Default') }}
|
||||||
</option>
|
</option>
|
||||||
|
|
||||||
|
<option v-if="!verifyPipedApi">
|
||||||
|
{{ getStore('pipedapi') || 'pipedapi.kavin.rocks' }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<h3>{{ t('instances.auth') }}</h3>
|
<h3>{{ t('instances.auth') }}</h3>
|
||||||
|
@ -188,9 +212,13 @@ onMounted(() => {
|
||||||
<option
|
<option
|
||||||
v-for="i in instances"
|
v-for="i in instances"
|
||||||
:key="i.name"
|
:key="i.name"
|
||||||
:value="i.api_url.replace('https://', '').replace('http://', '')">
|
:value="i.api_url.replace('https://', '')">
|
||||||
{{ i.name.replace('Official', 'Default') }}
|
{{ i.name.replace('Official', 'Default') }}
|
||||||
</option>
|
</option>
|
||||||
|
|
||||||
|
<option v-if="!verifyAuthApi">
|
||||||
|
{{ getStore('authapi') || 'pipedapi.kavin.rocks' }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<div class="table-wrap">
|
<div class="table-wrap">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue