Comments (3)
Hi there @Themis3000 !
Yeah, you pointed it out right.
Playlist.get
is really new in this library, so next
attribute isn't added to it yet.
I'll see how I can do that.
Thanks for your positive comment.
Greetings 🍀
from youtube-search-python.
Hi there @Themis3000 ! 👋
Hope you're doing great 😃. Sorry, it took me a lot of time to get to this one. I had kinda busy schedule & this project in general takes a lot of study for adding/fixing features. So, here I am with what you asked for.
Now you can get more than 100 videos from a playlist. I have made everything very simple to use.
playlist = Playlist('https://www.youtube.com/playlist?list=PLRBp0Fe2GpgmsW46rJyudVFlY6IYjFBIK')
print(f'Videos Retrieved: {len(playlist.videos)}')
if playlist.hasMoreVideos:
print('Getting more videos...')
playlist.getNextVideos()
else:
print('Found all the videos.')
print(f'Videos Retrieved: {len(playlist.videos)}')
if playlist.hasMoreVideos:
print('Getting more videos...')
playlist.getNextVideos()
else:
print('Found all the videos.')
print(f'Videos Retrieved: {len(playlist.videos)}')
if playlist.hasMoreVideos:
print('Getting more videos...')
playlist.getNextVideos()
else:
print('Found all the videos.')
Now hasMoreVideos
will indicate if more videos are present, and getNextVideos
will give you more videos of the playlist.
Result:
Videos Retrieved: 100
Getting more videos...
Videos Retrieved: 200
Getting more videos...
Videos Retrieved: 209
Found all the videos.
If above example seems bit spread out, you can simply use a loop as follows (looks elegant I guess) to get all the videos:
from youtubesearchpython import *
playlist = Playlist('https://www.youtube.com/playlist?list=PLRBp0Fe2GpgmsW46rJyudVFlY6IYjFBIK')
print(f'Videos Retrieved: {len(playlist.videos)}')
while playlist.hasMoreVideos:
print('Getting more videos...')
playlist.getNextVideos()
print(f'Videos Retrieved: {len(playlist.videos)}')
print('Found all the videos.')
Greetings. ✨
from youtube-search-python.
Perfect! Thank you so much! I'm happy this is now implemented, I will be making use of it
Have a great day, I appreciate your work!
from youtube-search-python.
Related Issues (20)
- [Feature request] youtube music search HOT 1
- Age-restricted videos not deciphering in StreamURLFetcher HOT 2
- Retrieve channel info & search with a specific time span HOT 8
- Search for videos with multiple hashtags HOT 1
- Errors on Video.getInfo HOT 2
- Issues with fetching age-restricted videos
- Filter livestreams HOT 5
- Total views of a channel HOT 2
- about video information retrieved, miss "how many likes/dislike" properties HOT 1
- [Feature Request] get list of Playlists created by a user HOT 1
- ChannelSearch not working on "* - topic" channels
- got repeted result in playlist HOT 3
- Passing cookies to requests
- Different calls to Comments.get keeps comments from previous calls HOT 1
- Transcriptions are blank HOT 2
- error when getting videos from channel id HOT 2
- Title and desc HOT 1
- Include like count for video info HOT 2
- Questions rather than issue: how to add some values to the result? HOT 2
- An important anouncement about this library HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youtube-search-python.