0

There is a playlist on YouTube with almost 1000 videos. Using Python, I would like to go through each video and extract the video description (the bunch of text where a YouTube would usually put links and resources) from all videos uploaded after a certain date. I have tried pytube with little success

Minimal Working Example

from pytube import Playlist
from datetime import datetime

# Grab playlist
BBC = Playlist("https://www.youtube.com/playlist?list=PLG8IrydigQfcRNrWVqNkeZiCJ_DWgXDVX")

start_date = datetime(year=2023, month=4, day=1)

# Generator pipeline
filter_date = (video for video in BBC.videos if video.upload_date >= start_date)
grab_text   = (video.vid_info['videoDetails']['shortDescription'] for video in filter_date)

# Run generators and grab descriptions
descriptions = list(grab_text)

However I get a too many requests error. Is there any way to make this work? I am happy to do this in batch as well. I have tried doing it in batch with generators or lists alike and it did not work. Happy with a scraper solution too.

Physics_Student
  • 556
  • 2
  • 9
  • 2
    Just use [YouTube Data API v3](https://developers.google.com/youtube/v3) [PlaylistItems: list](https://developers.google.com/youtube/v3/docs/playlistItems/list) and [Videos: list](https://developers.google.com/youtube/v3/docs/videos/list) endpoints, as shown in [this answer](https://stackoverflow.com/a/74579030). – Benjamin Loison Aug 10 '23 at 13:48
  • 1
    Does this answer your question? [Getting Video Links from Youtube Channel in Python Selenium](https://stackoverflow.com/questions/74578175/getting-video-links-from-youtube-channel-in-python-selenium) – Linda Lawton - DaImTo Aug 10 '23 at 14:35

0 Answers0