Python YouTube API Tutorial: Calculating the Duration of a Playlist

preview_player
Показать описание
In this Python Programming Tutorial, we'll be learning how to calculate the duration of a YouTube playlist. The duration of a playlist is likely one of the first things people will look for before watching, but YouTube doesn't currently have this information available on their site. So we will use the API to calculate this for us. Let's get started...

The code for this video can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python
Рекомендации по теме
Комментарии
Автор

Hope everyone is having a great week so far. In this video we're going to be writing a script that I've personally used a lot to calculate the total duration of YouTube playlists. If you have any more suggestions of what you'd like to see us use the YouTube API for then definitely let me know. I have a few more videos in mind of what I use this for personally, but I'm also interested in hearing your use cases as well. Thanks!

coreyms
Автор

Best Teacher for me all over Internet
This guy is giving all his videos for free ... really appreciate man

HamroMotors
Автор

If anyone else wants to avoid regular expressions, they could do the following.
YouTube duration is in ISO 8601 format, so I used the *isodate* library (pip install isodate) and used its 'parse_duration' method which returns a timedelta.
So the code at that point simply becomes:

for video in video_response['items']:
iso_8601_duration =
dt =
total_seconds += dt.total_seconds()

theanswersixers
Автор

Corey, you are an absolute legend, I came across your tutorial videos a while back and was blown away by how in-depth and non specific they are. Whenever I am looking into a new module or python feature, I check to see if I can find one from you! Keep it up! With your help I have almost mastered API scrapping, working with JSON files and much more! THANK YOU!

Special_Sharpie
Автор

My fav python and programming language course channel on youtube. The video length are right for my attention span. Also the accent is a plus. Definitely recommending it to my colleagues.

sekekeretsu
Автор

A much-needed video. I've been thinking to do this for a long time. Thank you so much for making it. I'll join the membership once I'll have a steady income to support myself. Thank you again for making such content free of cost and available to everyone.

jadia
Автор

You' re doing great job making these tutorials. I really respect people who make quality and usefull stuff for free. Keep it up!

obi
Автор

60:26:37 of my precious life time has been spent with Master Schafer!

hamed
Автор

corey : " i believe that..."
probility calculator : "100%"

mehrabdarvishi
Автор

Recently i just search service for make this calculation.. and now you made guide about it!
Awesome! Thanks!
Like!

bohdan
Автор

60 hours on social medias?: NO
60 hours watching Schafer's videos:

rafasantos
Автор

I’m so happy to see these api videos. To me they are the most useful thing ever. I would love you to cover how to setup an app to maintain local data from an api or scraping. In other words we can pull the data down, but how do I put it in a database and get it to update ever day or so? That would be gold.

justin
Автор

Corey Schafer OOP and also Django literally took my Programming level from beginner to great level,
a level that gave me enough confidence to give my own shot with Python series
Thanks for teaching us a lot Corey,
You are still number 1 in all Python communities that I'm a part of. ;)

jimshapedcoding
Автор

Awesome video as always, Corey. I already programmed a lot in Python throughout college, but your videos made me understand way better a lot of concepts I thought I fully understand, only to realise I missed some details that made a difference later. You're a great teacher, thanks a lot!
May I suggest 2 topics I find it hard to find content about:
- Django REST framework
- Create an executable and GUI for inputs in a Python script (this one would make a big difference to me, as it allows people that are not familiar with programming to use my scripts)
Again, thanks for the quality content and I hope I can contribute to you after I graduate from college. For now, I recommend your videos to everyone that asks me for help learning Python

DanielLavedoniodeLima_DLL
Автор

You and Ahmad Bazzi are my go-to python channels !

netafeliciano
Автор

You are one of my favorite teacher. Thanks man. 👍👍👍

gambomaster
Автор

best channel to learn coding. hats off to you man. you are very good teacher

fvkkdjs
Автор

Hey I just made this youtube playlist time calculator using Selenium and Beautifulsoup . Using selenium and Soup it was little bit tricky but for understanding the web scrapping part it was very essential for me to go with those. And thank you so much sir for uploading this video usin Youtube API because for sure it will be much faster than my selenium and soup script and it removes many corner cases that i was facing in my script.... Again a big thnks for this :)

ramshankarkumar
Автор

Liking and commenting before watching the video is must for this Channel....

tejasvix
Автор

Well articulated tutorial. I used this tutorial to calculate the the total length of all videos on Corey's channel. This is what I found. 77:16:47

dailydevtips