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

Improving RunVideoDataFetch speed? #35

Open
hswlab opened this issue Jun 27, 2023 · 2 comments
Open

Improving RunVideoDataFetch speed? #35

hswlab opened this issue Jun 27, 2023 · 2 comments

Comments

@hswlab
Copy link

hswlab commented Jun 27, 2023

Hi, is it possible to improve the fetch speed for video information in the following call somehow?
var res = await ytdl.RunVideoDataFetch("https://www.youtube.com/watch?v=_QdPW8JrYzQ");

I was wondering if you could limit the information you want to get.
For example, you wand just search for the title, thumbnail and the format list of a single video.

@alxnull
Copy link
Member

alxnull commented Jul 1, 2023

Hey, I think improving the speed of video information fetching would mainly happen on the yt-dlp side as it is responsible for extracting & parsing the video information and passing it in json format. RunVideoDataFetch() uses yt-dlp's --dump-json for fetching video information, which always returns the full data. I'm not aware of an option that extracts & returns partial data to make it faster. Let me know if you have any suggestions regarding this though.

@Videstra
Copy link

Videstra commented Oct 6, 2024

It may entirely depend on the service, but when I call for data manually with yd-dlp.exe as follows:

yt-dlp -J https://www.youtube.com/watch?v=aJRYG93boKc>yt.txt

It takes 3 seconds.

Getting the same information using RunVideoDataFetch takes about 3.2 seconds - so yeah, it sounds like the delay is in the yt-dlp.exe processing/parsing.

You can limit the data returned using yt-dlp.exe by specifying the output, but it is not any faster. Example::

yt-dlp --print "%(title)s" --print "%(manifest_url)s" --print "%(availability)s" --print "%(is_live)s" --print "%(description)s" https://www.youtube.com/watch?v=aJRYG93boKc>yt.txt

And you will see it still takes about 3 seconds so I'm guessing it's doing the same thing as the full fetch, but only printing what you asked for (but not in JSON - just text).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants