mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-01 01:12:39 +00:00
Merge branch 'main' of https://github.com/VueTubeApp/VueTube
This commit is contained in:
commit
4797e1ba02
11 changed files with 68 additions and 156 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -106,7 +106,7 @@ jobs:
|
|||
CODE_SIGNING_ALLOWED="NO"
|
||||
CODE_SIGN_ENTITLEMENTS=""
|
||||
- name: Make IPA
|
||||
run: mkdir Payload && mv ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Debug-iphoneos/App.app Payload && zip -r Payload.zip Payload && mv Payload.zip VueTube.ipa
|
||||
run: mkdir Payload && mv ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Debug-maccatalyst/App.app/ Payload && zip -r Payload.zip Payload && mv Payload.zip VueTube.ipa
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
141
.github/workflows/nightly-release.yml
vendored
141
.github/workflows/nightly-release.yml
vendored
|
@ -1,141 +0,0 @@
|
|||
name: nightly-release
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
# Triggers the workflow on on a schedule
|
||||
schedule:
|
||||
# Runs "at 0:00 UTC every day" (see https://crontab.guru)
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
NODE_VERSION: 16
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
name: Build web assets
|
||||
runs-on: ubuntu-latest
|
||||
needs: check_date
|
||||
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: main
|
||||
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: npm i; cd NUXT; npm i
|
||||
- name: Set App Version
|
||||
working-directory: NUXT
|
||||
run: sed -i 's/dev-local/${{ github.sha }}/' nuxt.config.js
|
||||
- name: Build web assets
|
||||
working-directory: NUXT
|
||||
run: npm run generate
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
android:
|
||||
name: Build Android platform
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Copy web assets to native platform
|
||||
run: npx cap copy android
|
||||
- name: Update native platform
|
||||
run: npx cap update android
|
||||
- name: Build with Gradle
|
||||
working-directory: android
|
||||
run: chmod +x gradlew; ./gradlew clean assembleRelease -x test -Pandroid.injected.signing.store.file=/home/runner/work/VueTube/VueTube/android/key.jks -Pandroid.injected.signing.store.password=${{ secrets.ANDROID_STORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.ANDROID_KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: android
|
||||
path: android/app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
ios:
|
||||
name: Build iOS platform
|
||||
runs-on: macos-latest
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
- name: Copy web assets to native platform
|
||||
run: npx cap copy ios
|
||||
- name: Update native platform
|
||||
run: npx cap update ios
|
||||
- name: Add empty `GoogleService-Info.plist`
|
||||
run: echo "$GOOGLE_SERVICE_INFO_PLIST" > ios/App/App/GoogleService-Info.plist
|
||||
env:
|
||||
GOOGLE_SERVICE_INFO_PLIST: ${{secrets.GOOGLE_SERVICE_INFO_PLIST}}
|
||||
- name: Build and archive with xcodebuild
|
||||
working-directory: ios
|
||||
run: xcodebuild
|
||||
-workspace App/App.xcworkspace
|
||||
-scheme App
|
||||
-archivePath App/build/App.xarchive
|
||||
clean build archive
|
||||
CODE_SIGN_IDENTITY=""
|
||||
CODE_SIGNING_REQUIRED=NO
|
||||
CODE_SIGNING_ALLOWED="NO"
|
||||
CODE_SIGN_ENTITLEMENTS=""
|
||||
- name: Make IPA
|
||||
run: mkdir Payload && mv ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Debug-iphoneos/App.app Payload && zip -r Payload.zip Payload && mv Payload.zip VueTube.ipa
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: iOS
|
||||
path: VueTube.ipa
|
||||
|
||||
check_date:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check latest commit
|
||||
outputs:
|
||||
should_run: ${{ steps.should_run.outputs.should_run }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: print latest_commit
|
||||
run: echo ${{ github.sha }}
|
||||
|
||||
- id: should_run
|
||||
continue-on-error: true
|
||||
name: check latest commit is less than a day
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
|
|
@ -213,6 +213,21 @@ export default {
|
|||
this.vidSrc = this.sources[this.sources.length - 1].url;
|
||||
// TODO: detect orientation change and enter fullscreen
|
||||
// TODO: detect video loading state and send this.loading to play button :loading = loading
|
||||
|
||||
|
||||
this.$youtube.getSponsorBlock(this.$route.query.v, (data) => {
|
||||
sponsorBlock = data.segment;
|
||||
});
|
||||
|
||||
this.$refs.player.ontimeupdate = () => {
|
||||
let vidTime = this.$refs.player.currentTime;
|
||||
for (let i = 0; i < sponsorBlock.length; i++) {
|
||||
if (vidTime > sponsorBlock[i][0] && vidTime < sponsorBlock[0][i]) {
|
||||
this.$refs.player.currentTime = sponsorBlock[i][0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.isFullscreen) this.exitFullscreen();
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
fab
|
||||
text
|
||||
small
|
||||
color="white"
|
||||
style="position: absolute; bottom: 0.25rem; right: 3rem"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
active
|
||||
style="width: 100%; background: #ffffff22"
|
||||
background-opacity="0.5"
|
||||
background-color="primary"
|
||||
background-color="white"
|
||||
:buffer-value="buffered"
|
||||
:value="percent"
|
||||
color="primary"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
fab
|
||||
text
|
||||
small
|
||||
color="white"
|
||||
style="position: absolute; bottom: 0.25rem; right: 6rem"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
|
|
|
@ -159,22 +159,26 @@ export default {
|
|||
return;
|
||||
} // No text found, no point in calling API
|
||||
|
||||
const isLink = linkParser(text);
|
||||
if (!isLink) {
|
||||
//--- Auto Suggest ---//
|
||||
this.$youtube.autoComplete(text, (res) => {
|
||||
const data = res.replace(/^.*?\(/, "").replace(/\)$/, ""); //Format Response
|
||||
this.response = JSON.parse(data)[1];
|
||||
console.log(this.response);
|
||||
});
|
||||
|
||||
} else {
|
||||
//--- User Pastes Link, Direct Them To Video ---//
|
||||
const isLink = linkParser(text);
|
||||
if (isLink) {
|
||||
this.response = [
|
||||
[
|
||||
`Watch Video from ID: ${isLink.searchParams.get("v")}`,
|
||||
{ id: isLink.searchParams.get("v") },
|
||||
],
|
||||
];
|
||||
console.log("this.response: ", this.response);
|
||||
return;
|
||||
}
|
||||
//--- End User Pastes Link, Direct Them To Video ---//
|
||||
}
|
||||
},
|
||||
|
||||
youtubeSearch(item) {
|
||||
|
|
|
@ -32,7 +32,9 @@ const module = {
|
|||
|
||||
}),
|
||||
|
||||
addPlugin(content) {
|
||||
|
||||
async addPlugin(content) {
|
||||
|
||||
await ensureStructure();
|
||||
new Promise(async (resolve, reject) => {
|
||||
const fileName = require("./utils").getCpn(); // Im not sure what this is actually meant for but im using it as a random string generator
|
||||
|
|
|
@ -150,6 +150,22 @@ const module = {
|
|||
const returntext = levels.join(":");
|
||||
|
||||
console.log("Human Time:", returntext);
|
||||
while (returntext.startsWith(":00")) {
|
||||
returntext = returntext.substring(3);
|
||||
} // Remove Prepending 0s (eg. 00:00:00:01:00)
|
||||
if (returntext.startsWith(":0")) {
|
||||
returntext = returntext.substring(2);
|
||||
} else {
|
||||
returntext = returntext.substring(1);
|
||||
} // Prevent Time Starting With 0 (eg. 01:00)
|
||||
|
||||
if (!returntext.includes(":")) {
|
||||
if (returntext.length == 1) {
|
||||
returntext = "0" + returntext; // Make tens digit in seconds always visible (eg. 0:09)
|
||||
}
|
||||
returntext = "0:" + returntext; // Make minutes visible as 0 when sub 60 seconds (eg. 0:51)
|
||||
}
|
||||
|
||||
return returntext;
|
||||
},
|
||||
//--- End Convert Time To Human Readable String ---//
|
||||
|
|
|
@ -64,6 +64,21 @@ const searchModule = {
|
|||
callback(err);
|
||||
});
|
||||
},
|
||||
getSponsorBlock(id, callback) {
|
||||
Http.request({
|
||||
method: "GET",
|
||||
url: `https://sponsor.ajay.app/api/skipSegments`,
|
||||
params: { videoID: id },
|
||||
})
|
||||
.then((res) => {
|
||||
logger("sponsorBlock", res.data);
|
||||
callback(res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger("codeRun", err, true);
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//--- Recommendations ---//
|
||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 7.7 KiB |
Loading…
Reference in a new issue