Created
February 4, 2023 17:53
-
-
Save ressl/2f1d8ba652f52c4f716f5560c0c01750 to your computer and use it in GitHub Desktop.
Revisions
-
ressl renamed this gist
Feb 4, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ressl created this gist
Feb 4, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ //video // enable video download $('video').removeAttr('controlsList'); var videofiles = document.getElementsByTagName('video'); var videotext = document.getElementsByClassName('icon'); var srcList = []; var i = 0; setInterval(function(){ srcList.push(videofiles[i].src); var link = document.createElement("a"); link.id=i; link.download = `${videotext[i].innerText.replace(/['"]+/g, '')}.mp4`; link.href = videofiles[i].src; console.log(link); link.click(); i++; },1500); //music var audiofiles = document.getElementsByTagName('audio'); var audiotext = document.getElementsByClassName('icon'); var srcList = []; var i = 0; setInterval(function(){ srcList.push(audiofiles[i].currentSrc); var link = document.createElement("a"); link.id=i; link.download = `${audiotext[i].innerText.replace(/['"]+/g, '')}.mp3`; link.href = audiofiles[i].currentSrc; console.log(link); link.click(); i++; },1500);