mirror of https://github.com/VueTubeApp/VueTube
youtube is being youtube. im goin to sleep
This commit is contained in:
parent
4cb277c13a
commit
3a1973d281
|
@ -60,10 +60,10 @@ html, body {
|
|||
}
|
||||
|
||||
p, span, div {
|
||||
-webkit-user-select: none; /* Safari */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* IE10+/Edge */
|
||||
user-select: none; /* Standard */
|
||||
/* -webkit-user-select: none; /* Safari */
|
||||
/* -moz-user-select: none; /* Firefox */
|
||||
/* -ms-user-select: none; /* IE10+/Edge */
|
||||
/* user-select: none; /* Standard */
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<video controls :src="vidSrc" width="100%" height="300vh" />
|
||||
<video controls autoplay :src="vidSrc" width="100%" height="300vh" />
|
||||
<p>[DEBUG] Streaming From: {{ vidSrc }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -14,7 +14,9 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.$youtube.getVideo('wykQsTJElD4', (data) => {
|
||||
this.vidSrc = data[data.length-1].url;
|
||||
const formats = data.formats;
|
||||
console.log(data)
|
||||
this.vidSrc = formats[formats.length-1].url;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,15 +123,17 @@ const module = {
|
|||
Http.request({
|
||||
method: 'GET',
|
||||
url: 'https://youtube.com/watch',
|
||||
//headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.7113.93 Safari/537.36' },
|
||||
params: { q: id }
|
||||
})
|
||||
.then((res) => {
|
||||
//--- Get HTML Only ---//
|
||||
let html = res.data;
|
||||
logger("getVideo-html", html);
|
||||
//--- Isolate The Script Containing Video Information ---//
|
||||
html = html.split("var ytInitialPlayerResponse = ")[1].split("';</script>")[0].split(";var meta = document.createElement('meta');")[0];
|
||||
//--- Parse JSON ---//
|
||||
const videoData = JSON.parse(html).streamingData.formats;
|
||||
const videoData = JSON.parse(html).streamingData;
|
||||
callback(videoData);
|
||||
|
||||
})
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
cd .\NUXT\; npm run generate; cd ..; npx cap sync
|
Loading…
Reference in New Issue