Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Python - grab video description from every video in a Youtube Playlist

$
0
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 Playlistfrom datetime import datetime# Grab playlistBBC = Playlist("https://www.youtube.com/playlist?list=PLG8IrydigQfcRNrWVqNkeZiCJ_DWgXDVX")start_date = datetime(year=2023, month=4, day=1)# Generator pipelinefilter_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 descriptionsdescriptions = 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.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>