File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
scripts/youtube_channel_info Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ # Youtube Channel Info
2+ This is a simple script that fetches info about a youtube channel.
3+
4+ ## Usage
5+ - Clone the repo
6+ - download the requirements
7+ - add the api key and channel id
8+ - run python script.py
Original file line number Diff line number Diff line change 1+ from googleapiclient .discovery import build
2+
3+ youtube = build ('youtube' , 'v3' ,
4+ developerKey = 'Enter API key' )
5+
6+ ch_request = youtube .channels ().list (
7+ part = 'statistics' ,
8+ id = 'Enter Channel ID' )
9+
10+ ch_response = ch_request .execute ()
11+
12+ sub = ch_response ['items' ][0 ]['statistics' ]['subscriberCount' ]
13+ vid = ch_response ['items' ][0 ]['statistics' ]['videoCount' ]
14+ views = ch_response ['items' ][0 ]['statistics' ]['viewCount' ]
15+
16+ print ("Total Subscriber:- " , sub )
17+ print ("Total Number of Videos:- " , vid )
18+ print ("Total Views:- " , views )
You can’t perform that action at this time.
0 commit comments