Python 3 Web Scraping Script to Get Youtube Channel Playlist All Videos Using Youtube Data API V3
0 views
Jun 3, 2025
Buy the full source code of application here:
View Video Transcript
0:00
uh hello guys welcome to this video So
0:02
in this video I will show you a Python
0:04
script or a module which can communicate
0:07
to the YouTube data API to get all the
0:10
videos in a particular playlist So we
0:13
will look at this module first of all
0:15
This module is scrape tube If you go to
0:17
the
0:19
website so this is the command here to
0:21
install this module PIP install scrape
0:24
tube I've already installed it So this
0:26
actually communicates with the YouTube
0:28
data API to fetch the data So we will
0:32
look at this example So first of all you
0:34
just need to import this package scrape
0:38
tube After that we will declare a videos
0:41
and then we will initialize this scrape
0:43
tube dot and it contains this method
0:46
which is get
0:47
playlist So here you need to paste the
0:51
address of the YouTube playlist from
0:53
which you are fetching the videos So
0:54
this method expect you to paste the
0:56
address right here So this will be the
0:59
ID of the playlist So go to any playlist
1:03
in the YouTube Let's suppose I take my
1:06
channel playlist
1:09
So if you open this playlist
1:15
here if I open this in the new tab this
1:19
is actually the playlist ID right here
1:21
So this is the ID you need to simply
1:24
paste it So simply
1:33
copy You can see this playlist ID You
1:36
just need to paste right here in double
1:39
quotes After pasting it it will return
1:43
all the videos So we can loop through
1:46
this array for video and
1:49
videos and we can print
1:52
out the video
1:59
ID and also the title So if you uh run
2:03
this now you will see it will return out
2:05
all the videos which are present in this
2:08
playlist This is the title This is the
2:10
video ID
2:14
So if you just print out this video this
2:17
is actually an object here So it will
2:20
return out
2:21
JSON If I refresh you will see that this
2:24
has returned the JSON array of videos
2:27
Each video has some properties You will
2:30
see So in this easy way guys you can see
2:33
we have video ID thumbnail everything is
2:36
there If you can definitely make a very
2:38
awesome application of playlist
2:41
finder where user will uh input this
2:44
playlist ID and you will return or
2:47
display all the YouTube
2:50
video and there is a second option you
2:53
can pass here limit as well So if you
2:56
only want to return five videos you can
2:58
put this option or restriction limit is
3:00
equal to five So now what
3:02
happens it only returns the five videos
3:10
data See if I only print out video
3:15
ID So now it only returns the five
3:17
videos So you can even filter out
3:19
restrict the results as well So this is
3:22
actually a great package guys You can
3:23
see we haven't used the YouTube any API
3:26
key It's totally free You can do this
3:28
unlimited number of time It's actually
3:30
scraping the results from YouTube
3:33
website and it is using the YouTube data
3:35
API in the web background This is the
3:38
API to collect the data So definitely
3:42
use this module guys It's very popular I
3:44
personally tried this So also check out
3:47
my website freemediatools.com
3:50
uh which contains thousands of tools
#Online Video
#TV Guides & Reference