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
print(channel.keywords) # pewdiepie pewds gaming "felix arvid ulf" felix kjellberg
print(channel.is_family_safe) # True
# The following two variables may produce different results depending on your geolocation.
print(channel.subscribers_count) # 110M
print(channel.video_count) # 4.6K
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_name) # 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_webp/XqZsoesa55w/maxresdefault.webp
print(video.length_seconds) # 136
print(video.isLiveContent) # False
print(video.is_private) # False
print(video.allowRatings) # True
print(video.keywords) # ['baby shark', 'baby shark dance', 'baby shark song', 'cute dance for children' ...
Fetching playlists
import youthon
playlist = youthon.Playlist("https://www.youtube.com/watch?v=K4DyBUG242c&list=PLRBp0Fe2Gpgm_u2w2a2isHw29SugZ34cD&ab_channel=NoCopyrightSounds")
print(playlist.title) # NCS : The Top 100 Biggest Songs 📈
print(playlist.author.name) # http://www.youtube.com/@NoCopyrightSounds
print(playlist.total_videos) # 100
print(playlist.playlist_id) # PLRBp0Fe2Gpgm_u2w2a2isHw29SugZ34cD
print(playlist.playlist_url) # https://www.youtube.com/playlist?list=PLRBp0Fe2Gpgm_u2w2a2isHw29SugZ34cD
print(playlist.video_urls) # ['https://youtube.com/watch/?v=K4DyBUG242c', 'https://youtube.com/watch/?v=3nQNiWdeH2Q', 'https://youtube.com/watch/?v=J2X5mJ3HDYE', ... ]
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.
Metadata
Release files for youthon 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| youthon-0.5.0.tar.gz | 4.5 kB | Without provenance | Details for youthon-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| youthon-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for youthon-0.5.0-py3-none-any.whl |
Total release size: 10.8 kB
Release files / youthon-0.5.0.tar.gz
| Download URL | youthon-0.5.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55c59ae6576f3811ebf78a28be95889aa9b082db2c768c0e3a07501bc24e7869
|
|
BLAKE2b-256 checksum How to use checksums |
fde5fb4e8bdcf7fa15a9403c00f0593d2c2cfead65c3cb1487d84aa8a2bd1580
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.9 Windows/11
|
Release files / youthon-0.5.0-py3-none-any.whl
| Download URL | youthon-0.5.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
447aaaa9b251b72e3f1c819d2df2f7118738b20de6c845fabbe16681cb98b694
|
|
BLAKE2b-256 checksum How to use checksums |
09ef5a24a709130217b94cc80ffd03df314d08c483910269cc4641bfa05b5d0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.9 Windows/11
|
Security for youthon 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.