Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
yashdkadam authored Dec 19, 2023
1 parent ef322e0 commit 74fca0a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8" />
<title>YouTube To Audio</title>
<input id="test"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
Expand All @@ -19,7 +20,11 @@
return Math.floor(Math.random() * (max - min)) + min;
}
$(document).ready(() => {
let key = "_-vsHpF4sZo";
function getYouTubeVideoId(url) {
var match = url.match(/[?&]v=([^&]+)/);
return match && match[1] ? match[1] : null;
}
let key = getYouTubeVideoId($('#test').val);
const audioElement = document.getElementById("audio");
const playButton = document.getElementById("play");
const pauseButton = document.getElementById("pause");
Expand All @@ -28,7 +33,7 @@

function next() {
$.get(
"https://corsproxy.io/?https://django-hello-world-nu-jade.vercel.app/nextvideo/?q=" +
"https://django-hello-world-nu-jade.vercel.app/nextvideo/?q=" +
key
).then((data) => {
const random = getRandomInt(0, data['ids'].length - 1);
Expand Down

0 comments on commit 74fca0a

Please sign in to comment.