Skip to content

Instantly share code, notes, and snippets.

View pippim's full-sized avatar

pippim.com pippim

View GitHub Profile
@davidcairuz
davidcairuz / youtube_playlist_time.py
Last active November 13, 2023 15:22
Script that scrolls through all of a YouTube playlist and calculates it's total duration. I'm still learning Python so all of your suggestions will be very appreciated.
from bs4 import BeautifulSoup as soup #used to beautifie the html code
import datetime as dt #sum the video's duration time
from selenium import webdriver #open webdriver for specific browser
from selenium.webdriver.common.keys import Keys #for necessary browser action
import time #used for sleep function
#line 63 must be modified for different languages
#line 35 must be modified for different url
times = []