Skip to content

Instantly share code, notes, and snippets.

@iamandrewluca
Created January 11, 2024 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamandrewluca/72e81efcf2b5b73be91275660412a2b2 to your computer and use it in GitHub Desktop.
Save iamandrewluca/72e81efcf2b5b73be91275660412a2b2 to your computer and use it in GitHub Desktop.
YouTube Watch Later Time
$$('ytd-playlist-video-renderer .style-scope ytd-thumbnail-overlay-time-status-renderer')
.map(e => e.textContent.trim().split(':').reverse())
.map(([s = '0', m = '0', h = '0']) => ({ s: parseInt(s), m: parseInt(m), h: parseInt(h) }))
.map(({ s, m, h }) => s + m * 60 + h * 3600)
.reduce((a, b) => a + b) / 3600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment