Skip to content

Commit

Permalink
Update youtube.html
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro authored Feb 17, 2024
1 parent 094deef commit c4e8eca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
document.getElementsByTagName('video')[0].pause()
document.getElementsByTagName('audio')[0].pause()

fetch('https://api.fsh.plus/'+type+'?id='+document.getElementById('id').value).then(async p => {
let iid = document.getElementById('id').value;
iid = iid.split('v=').slice(-1)[0];
iid = iid.split('&')[0];
iid = iid.split('/').slice(-1)[0];

fetch('https://api.fsh.plus/'+type+'?id='+iid).then(async p => {
p = await p.json();
switch(type) {
case 'video':
Expand All @@ -39,7 +44,7 @@
</script>
<h1>Youtube</h1>
<label for="id">Id:</label>
<input id="id" placeholder="Youtube id here">
<input id="id" placeholder="Youtube id/url here">
<br>
<button onclick="dow('video')">Video/Mp4</button>
<button onclick="dow('audio')">Audio/Mp3</button>
Expand All @@ -48,4 +53,4 @@ <h1>Youtube</h1>
<br>
<audio src="" controls style="display:none;max-width:25vw;"></audio>
</body>
</html>
</html>

0 comments on commit c4e8eca

Please sign in to comment.