Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching multiple videos with videoIDs at once #281

Open
triggerfx opened this issue Aug 6, 2024 · 0 comments
Open

Fetching multiple videos with videoIDs at once #281

triggerfx opened this issue Aug 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@triggerfx
Copy link

triggerfx commented Aug 6, 2024

Hi guys,
I don't know if I'm not doing it right, but I have a list with videoIDs where I want to get information such as title, channel name, thumbnail. With increasing numbers of ids it takes a long time to fetch these, thats my issue.
When doing a search request with a specific term, it is MUCH faster. I can get this information very quick.
I want to fetch multiple IDs because I want them in batches (like playlists in-app), but it really takes too much time.
Is there a way to do this faster?

example:

Future fetchVideoDetails() async {
var yt = YoutubeExplode();

var futures = videoIds.map((videoId) async {
  var video = await yt.videos.get('$videoId');
  return {
    'title': video.title,
    'channel': video.author,
  };
}).toList();

var results = await Future.wait(futures);

_videoDetails.addAll(results);

}

@triggerfx triggerfx added the enhancement New feature or request label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant