Curious as to the best way to grab the number of minutes and seconds in a Playlist on YouTube and add them all together and then print the output? Suggestions welcome .
|
Python
Suggestions for a simple program to calculate the number of numbers and seconds in a |
|
Jun 13, 2022 01:59 PM
(This post was last modified: Jun 13, 2022 02:10 PM by Faith Connors.)
honestly i always just did it in the browser console after loading the page with the playlist and making sure all video thumbnails loaded (no lazy loading)
then get the class name of the timer on each thumbnail, for each isntance of a timer thing, get the data (string) and split it into minutes and seconds add all minutes together, add all seconds together minutes += seconds / 60 seconds %= 60 then you get a minutes:seconds representation, or further simplify to hours if needed. but there's probably a browser plugin somewhere out there that calculates total runtime of a youtube playlist. as for python specifically, probably safer to just use their api instead of making arbitrary requests to the playlist page itself (Jun 13, 2022 01:59 PM)Faith Connors Wrote: honestly i always just did it in the browser console after loading the page with the playlist and making sure all video thumbnails loaded (no lazy loading) Wound up doing it manually to get the answer now learning how to do it programmatically. |
|
|



