README 未说明是否需要额外依赖或代理
不用官方 API 和 Selenium 就能抓取 YouTube 频道、播放列表和搜索结果的 Python 库
用 Python 抓取 YouTube 频道、播放列表和搜索结果,绕开官方 API 限制获取视频数据。
核心能力
- 用 get_channel 遍历频道全部视频
- 用 get_playlist 抓取播放列表全部视频
- 用 get_search 按关键词搜索视频
- 无需 YouTube 官方 API 和 Selenium
容易踩的坑
内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README
- v2.6.0最新正式版2025-09-16 · 2025-09-16 17:49 UTC
这个版本没有写更新说明。
- v2.5.12023-09-03 · 2023-09-03 21:54 UTC
查看更新说明
Merge #38
- v2.5.02023-07-14 · 2023-07-14 00:18 UTC
查看更新说明
- fix sort by when getting channel #31
- set lang #10
- get single video #15
- v2.4.02023-06-12 · 2023-06-12 20:19 UTC
查看更新说明
add support for
channel_username - v2.3.12022-11-03 · 2022-11-03 06:27 UTC
查看更新说明
fix #16
用户点评
登录用户的真实使用记录,可按版本和硬件筛选共 0 条
还没有人点评。第一个说出真实体验的人最有价值。
Scrapetube
This module will help you scrape youtube without the official youtube api and without selenium.
With this module you can:
- Get all videos from a Youtube channel.
- Get all videos from a playlist.
- Search youtube.
Installation
pip3 install scrapetube
Usage
Here's a few short code examples.
Get all videos for a channel
import scrapetube
videos = scrapetube.get_channel("UCCezIgC97PvUuR4_gbFUs5g")
for video in videos:
print(video['videoId'])
Get all videos for a playlist
import scrapetube
videos = scrapetube.get_playlist("PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU")
for video in videos:
print(video['videoId'])
Make a search
import scrapetube
videos = scrapetube.get_search("python")
for video in videos:
print(video['videoId'])