Skip to content

Instantly share code, notes, and snippets.

@rohitsahu4
Created May 16, 2021 13:52
Show Gist options
  • Save rohitsahu4/0b40fc1443b9362ea5c6d689a47c17d3 to your computer and use it in GitHub Desktop.
Save rohitsahu4/0b40fc1443b9362ea5c6d689a47c17d3 to your computer and use it in GitHub Desktop.
Udemy course video auto complete bot. ( Finish your udemy course fast by pasting this script in dev console. ) (content like articles may need to be views seperatly ).
copy
var s;
function isArticle(){
return document.querySelector('[class*="curriculum-item-link--is-current"]').querySelector('[class="udi udi-article"]')
}
function foo(){
var video = document.querySelector('video');
try{
if(video){
if(!video.paused){
video.currentTime=video.duration-1;
setTimeout(function(){
foo()
},5000)
}
else{
video.play()
setTimeout(function(){
foo()
},5000)
}
}
else if(document.querySelector('[aria-labelledby="go-to-next-item"]') && !!isArticle()){
setTimeout(function(){
document.querySelector('[aria-labelledby="go-to-next-item"]').click()
foo();
},30000)
}
else{
if(document.querySelector('[data-purpose="next-item"]'))
document.querySelector('[data-purpose="next-item"]').click();
setTimeout(function(){
foo()
},5000)
}
}
catch(e){
console.log(e)
setTimeout(function(){
foo()
},500)
}
}
foo()
@rohitsahu4
Copy link
Author

Dont judge my code i wrote this in frustation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment