Filter livestreams #171
Comments
Livestream results don't have a duration, so you can filter the results as follows: from youtubesearchpython import *
search = VideosSearch("whatever")
results = search.result()["result"]
results_without_livestreams = [r for r in results if r["duration"]] |
Works perfect. Thanks! |
We've recently added You can use it within |
@mytja I tested it out and it seems to be working great. However it doesn't appear there is a way to issue a query and exclude live streams from the (video) result set. I can't find a way to do this through the regular YouTube interface anyway, and some Googling shows that people recommend filtering out results manually, e.g. YouTube Data API: Exclude livestreams from Search.list result set. |
So glad it's working for you. 💙
If it isn't available in YouTube web app, we sadly cannot do anything... |
Could you add a way to filter whether a search returns a livestream or not? When searching, I don't want any livestream results.
The text was updated successfully, but these errors were encountered: