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.4.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for YTchannel-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bcebf2badceb6dd69676c09e5fc48ba77d4504d4585c65f1d47e0eaff3bcbbc |
|
MD5 | 2e2d2c86d088214a972765d09f0a6896 |
|
BLAKE2b-256 | d41fd761c2d1fe3ec58ddefb1ed0eb8e1224b372d534b26803f713f9f0a75264 |