r/learnmath • New User • Oct 04 '20

I wrote a python program to sum the duration of every Khan Acadamy video on YouTube. It would supposedly take 1003 hours, 53 minutes, and 43 seconds to watch all 7864 videos on the Khan Acadamy YouTube channel.

I just want to thank Sal Khan--and the rest of the Khan Academy team--for devoting so much time to provide free, high-quality educational content for millions of people. These videos have certainly helped me understand some math concepts, so I highly recommend checking them out if you haven't already.

https://www.khanacademy.org/

https://www.youtube.com/c/khanacademy

Edit: Here is the mediafire link for the python file. It works for any channel/playlist you want, not just Khan Academy. You need a YouTube Data API v3 key and credentials from https://console.developers.google.com/ to run it. Paste your API key into the code into the variable called api_key. When you run the program, it will simply prompt you to paste the URL of a youtube playlist.

Edit2: If you don't already know, or can't figure it out, you can access the playlist with every video on a given channel by going to "videos" and clicking "play all" and then clicking the name of the little playlist window that pops up to the right of the first video that automatically plays (titled something like "Uploads From ChannelName"), which takes you to the actual playlist page that has the playlist URL. The type of URL you want will look something like this, for example: https://www.youtube.com/playlist?list=UU4a-Gbdw7vOaccHmFo40b9g

658 Upvotes

36 comments sorted by

3

u/Electronic_Test Oct 04 '20

Is it possible to see your code? I'm new to python and this sounds interesting.

1

u/_CarbonBasedLifeForm New User Oct 04 '20

Here is the mediafire link for the python file, more info in the original post if you need it. You can simply edit/view the python code in the file directly by right-clicking and hitting "edit" or "edit with notepad" or with whatever text-editor you want; it's not compiled or anything.

You need a YouTube Data API v3 key and credentials from https://console.developers.google.com/ to run it. Paste your API key into the code in the variable called api_key.

2

u/Electronic_Test Oct 04 '20

Thanks man. Its a useful language and I want to explore it to the fullest.

2

u/[deleted] Oct 04 '20

He gave the link in the post, you can get the code there and also some simple web scraping code could do that easily.

120

u/Ringularity New User Oct 04 '20

Once I have a solid job with good pay, there’s no way I’m not donating to khan academy.

74

u/junior_raman New User Oct 04 '20

KH also gave us 3b1b. Grant was an internee at KH before he started his channel

28

u/QuantumKumquat0 New User Oct 04 '20

Huh, TIL.

27

u/WaxingMoon- Oct 04 '20

Grant has a multivariable calculus course on Khan, check it out.

13

u/[deleted] Oct 04 '20

Whoa...grant...and Khan academy...that is just...whoa... That's the first place I am learning Multi variable calculus from

5

u/Ringularity New User Oct 04 '20

Yeah I forgot to mention 3b1b, a fantastic channel even though I don’t understand a lot of it lol. But I want and need to be able to, which is why Khan academy is saving my ass.

9

u/Kinvert_Ed New User Oct 04 '20

Why not just pay more taxes instead bro?

Joking aside, they do great work. I had a bad prof in college and Sal helped get me through Calc 2. Bigly.

I'll still watch his stuff as a quick refresher.

1

u/KaoIo New User Oct 05 '20

I'm going to do the exact same thing

73

u/rahat106 Oct 04 '20

I can bet that if you watch it at 2x speed, you will still get it and the hours will be halved. Yay!

26

u/junior_raman New User Oct 04 '20

his voice is worth watching at 1x speed

20

u/Kinvert_Ed New User Oct 04 '20

His voice makes it so you can clearly hear him at 2x lol

5

u/spideyskeleton Oct 04 '20

1,5 is perfect for me, otherwise I get lost sometimes lol

3

u/Hardcore90skid New User Oct 04 '20

That's what I do on the concepts that I'm pretty solid with but still want to watch the videos in case I'm missing something (and get the energy points)

28

u/[deleted] Oct 04 '20

That's honestly not as much as I would have expected. I have several thousand hours placed into a single video game. Ah, now I'm sad...

14

u/[deleted] Oct 04 '20

several thousand hours??

those are rookie number gotta pump em up

7

u/Surzh New User Oct 04 '20

The factory must grow

1

u/[deleted] Oct 04 '20

I can’t even find a game interesting enough for me to put in that much time, think of it as a good thing bro.

19

u/swanky_swanker New User Oct 04 '20

sees title

challenge accepted.

17

u/weenielands New User Oct 04 '20

At 5-6 hours a day its about half a year. Average 3.5 hours of videos with 2 hours of working through the problems and you could be well versed in a year. That's considering all videos. The time would be shorter if you focus on just the math sections.

9

u/[deleted] Oct 04 '20

Also, I doubt anyone would need to revise kindergarten and maths till grade 5 at least. So it's not really that much ig...

7

u/Yosyp New User Oct 04 '20

I have less hours in my most played game. It would take years for me lol

4

u/junior_raman New User Oct 04 '20

1000 is rookie number

2

u/Yosyp New User Oct 04 '20

I know. High school and uni require far more study time for less subjects than KA has.

In fact, I can't study lol

3

u/Yasshy1 Oct 04 '20

Are the YouTube videos and their app the have the same duration?

2

u/[deleted] Oct 04 '20

Yeah they just embed the yt videos on there

3

u/MoonLightSongBunny New User Oct 04 '20

So 126 days if you watch eight hours every day. Not bad for something that started as a small tutoring session.

3

u/cryptominingmike Oct 05 '20

I never used Kahn academy while I was at uni, but I found it about a year ago and wow! Simply lists out concepts in multiple ways and makes it easy to understand! Thanks to much Sal Kahn

2

u/[deleted] Oct 04 '20

so if we practice and read some extra material and do the challenges on khan academy it'd probably take around 2500 hours which is not bad you'd learn all the high school physics, even some advanced maths and some programming and history, english, chemistry, biology and lots more

4

u/MonocleGentleman Oct 04 '20

You could probably leave out some of the elementary level stuff as well, cutting time down even shorter.

2

u/Head-Examination-819 Oct 04 '20

Alright let's start this binge

1

u/Andthentherewasbacon New User Oct 04 '20

challenge accepted

0

u/[deleted] Oct 04 '20

[deleted]

6

u/_CarbonBasedLifeForm New User Oct 04 '20 edited Oct 04 '20

Here is the mediafire link for the python file

You need a YouTube Data API v3 key to run it, but if you have your own API key and credentials from https://console.developers.google.com/ you can just download the file and paste your API key directly into the code into the variable called api_key. When you run the program, it will simply prompt you to paste the URL of a youtube playlist.

If you don't already know, or can't figure it out, you can access the playlist with every video on a given channel by going to "videos" and clicking "play all" and then clicking the name of the little playlist window that pops up to the right of the first video that automatically plays (titled something like "Uploads From ChannelName"), which takes you to the actual playlist page that has the playlist URL. The type of URL you want will look something like this, for example: https://www.youtube.com/playlist?list=UU4a-Gbdw7vOaccHmFo40b9g