A lightweight YouTube data scraper.
Project description
youthon
A lightweight YouTube data scraper.
Installing
pip
To install from PyPI with pip:
$ pip install youthon
poetry
You can add youthon as a dependency with the following command
$ poetry add youthon
Usage Examples
Fetching channels
import youthon
channel = youthon.Channel("https://www.youtube.com/@PewDiePie")
print(channel.name) # PewDiePie
print(channel.description) # I make videos.
print(channel.channel_url) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw
print(channel.profile_photo_url) # https://yt3.googleusercontent.com/5oUY3tashyxfqsjO5SGhjT4dus8FkN9CsAHwXWISFrdPYii1FudD4ICtLfuCw6-THJsJbgoY=s900-c-k-c0x00ffffff-no-rj
print(channel.channel_id) # UC-lHJZR3Gqxm24_Vd_AJ5Yw
# The following two variables may produce different results depending on your geolocation.
print(channel.subscribers_count)
print(channel.video_count)
print(channel.videos_page) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw/videos
print(channel.shorts_page) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw/shorts
print(channel.community_page) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw/community
print(channel.featured_channels_page) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw/channels
print(channel.playlists_page) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw/playlists
print(channel.about_page) # https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw/about
Fetching videos
import youthon
video = youthon.Video("https://youtu.be/XqZsoesa55w")
print(video.title) # Baby Shark Dance | #babyshark Most Viewed Video | Animal Songs | PINKFONG Songs for Children
print(video.description) # a loooong description :)
print(video.author) # Baby Shark - Pinkfong Kids’ Songs & Stories
print(video.video_url) # https://www.youtube.com/watch?v=XqZsoesa55w
print(video.views) # 14941899516
print(video.thumbnail_url) #https://i.ytimg.com/vi/XqZsoesa55w/maxresdefault.jpg
print(video.date_published) # 2016-06-17 16:00:30-07:00
print(video.legth_seconds) # 136
print(video.isLiveContent) # False
print(video.is_private) # False
print(video.genre) # Education
About the project
Authors
Contributing
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
License
The project is MIT licensed.
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
youthon-0.3.0.tar.gz
(5.0 kB
view details)
Built Distribution
File details
Details for the file youthon-0.3.0.tar.gz
.
File metadata
- Download URL: youthon-0.3.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.1 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae218baa98c179ad3c2139b3f072bd47f9bb42d7fbf5fc17669338440570a83a |
|
MD5 | 84f8ca1fee4f6541b26bc642ea7c162a |
|
BLAKE2b-256 | aceb502ca6c77c6d99189bbaed86b185e23f3a3d5e2daac9811f6d399c6c3e63 |
File details
Details for the file youthon-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: youthon-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.1 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f043520272780f355acf0a4e3a3e87938ec48495de8c89c5c96bf4ec7152c5 |
|
MD5 | 8401c35acadc426adbeb14dd0a194e39 |
|
BLAKE2b-256 | e072bba8e1b8e870ec32fecf0f658908cc61d2862866f15db7e3842462e08784 |