YouTube channel details extractor
Project description
YTchannel
YouTube channel details extractor
Features
Retrieve:-
- Youtube Channel name
- Icon, Channel art
- Subs if not hidden
- List no. of videos
Requirements
You need to install requests module
pip install requests
Installation
pip install YTchannel
Importing
from YTchannel.YTchannel import YTchannel
Creating an Object
yt = YTchannel()
Calling with a Id and API key
The first parameter must be the Channel id Check below example https://www.youtube.com/channel/UC_channel_id here in this example the channel id is UC_channel_id
try:
yt.start(UC_channel_id,YOUR_API_KEY)
except KeyError:
#Invalid channel id
except ConnectionError:
#Connection error
except:
#Something went wrong
Check if the request is success
result = yt.getResult() #this will return all details in a dictionary
if result['result'] == 'OK':
#No problem do your thing
else:
#Something wrong like - no channel found or invalid api key
#use result['code'] to get the error code or result['message'] to know the message
How to get details
title = result['title'] #or use title = yt.title
des = result['des'] #or use des = yt.des
icon = result['icon'] #or use icon = yt.icon
subs = result['subs'] #or use subs = yt.subs
channelArt = result['channelArt'] #or use channelArt = yt.channelArt
videos = result['videos'] #or use videos = yt.videos
subhidden = result['subs_hidden'] #or use subhidden = yt.subhidden
country = result['country'] #or use country = yt.country
Any issues?
Create an issue on github
Contact me
- On twitter https://twitter.com/SanjayDevTech
Happy coding
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
YTchannel-0.0.5.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for YTchannel-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 669ef7c39681118a343f7b5ddc1b4aee57b4269c3f5a98714f37568b093c2fdd |
|
MD5 | 13e618cbc6bcb602f9a409bf3bb22a72 |
|
BLAKE2b-256 | ea85a99256d0c06f0b1ec0445df00489b1445d9798d77f845e47edef667ee4e8 |