Skip to content

Instantly share code, notes, and snippets.

@bhavaniravi
Created March 25, 2020 22:16
Show Gist options
  • Save bhavaniravi/c45e8aa823c78d609dcedefac25529c8 to your computer and use it in GitHub Desktop.
Save bhavaniravi/c45e8aa823c78d609dcedefac25529c8 to your computer and use it in GitHub Desktop.
A script to calculate timestamp of youtube playlist
ele = document.getElementsByClassName("style-scope ytd-thumbnail-overlay-time-status-renderer")
for(i=0, i<ele.length, i+=){
if (ele[i].tagName == "span"){
label = ele[i].getAttribute("aria-label")
times = parseFloat(ele[2].textContent.replace(":", ".").trim())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment