dermasmid / scrapetube

A YouTube scraper for scraping channels, playlists, and searching 🔎
https://scrapetube.readthedocs.io/en/latest/
MIT License
339 stars 49 forks source link

Feature request: Get playlist links? #4

Open Melonadev opened 3 years ago

Melonadev commented 3 years ago

There is already a playlist_id parameter in scrapetube.get_playlist, which gets videos in a playlist:

image

What if I want to get all the playlists from a specific channel, just like I can already get its videos?

dermasmid commented 3 years ago

i will consider adding this feature in the future, but for now you can do something like this:

from scrapetube.scrapetube import get_videos

playlists = get_videos(
    'https://www.youtube.com/c/Cmaj7/playlists',
    'https://www.youtube.com/youtubei/v1/browse',
    'gridPlaylistRenderer',
    None,
    1
)

for playlist in playlists:
    print(playlist['playlistId'])