Comments (2)
Hi @dmdoniz !
This module is simply based on web-scraping, it makes similar to following network request for getting results:
request = f"https://www.youtube.com/results?search_query={keyword}&page={offset}&sp={<search-filter>}"
-
The "max_results" parameter is to limit the number of results you are receiving, not exceed the results that YouTube offers in that page..
- I added it in because, assume a user wants only one video in the result, then the script will break the loop just after one video is sorted from the response and will give better performance to the user.
-
We can make the number of results same as the user provided in "max_results", but for that we have to make multiple network requests with different "offset" values, which can affect performance. I haven't planned this, at the moment.
-
Results are not always limited at 20, you can even get somewhere around 35 results too for some queries, it is over YouTube.
At the moment, for getting different videos in result, you can set offset > 1, to get videos on next pages of YouTube.
- "offset" is more like "page" but now I cannot change the name of this parameter as people are using this library now.
Thankyou!
Feel to free to re-open issue or provide feedback, in case you feel it.
from youtube-search-python.
I very strongly recommend updating to v1.2.5 with:
pip3 install youtube-search-python==1.2.5
It has a big fix for a "mistake", I made in v1.2.4.
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.