mirror of https://github.com/VueTubeApp/VueTube
watch from url fix
This commit is contained in:
parent
080f085c52
commit
c65d8527e5
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue