You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make sure the question is worded well enough to be understood
Around a year ago I set up a server to download YouTube videos. The response times used to be quite fast when querying formats for a given video. Since for some Websites updates were required I updated ytdlp from time to time.
The current versions appear to be slower. Is there any particular reason? Or are there ways to run it more performant.
Also the performance varies drastically based on the python version? Any clues on why that could be?
Also back when everything ran on python 3.7 I remembered things to be a lot faster...
Given the simple benchmark script:
import time
from yt_dlp import YoutubeDL
start_time = time.perf_counter()
ydl = YoutubeDL(params={"extractor_args": {"youtube": {"player_client": ["web"]}}})
ydl.extract_info(url=r"https://youtu.be/9BansjPtOn8?feature=shared", download=False)
end_time = time.perf_counter()
elapsed_time = end_time - start_time
print(f"Elapsed time for task(): {elapsed_time} seconds")
On a raspberry pi 4 I get the following results:
Version
Time in s
Python 3.8
38s
Python 3.9
10s
Python 3.11
15s
Small update: the most time seems to be spent in the jsinterp.py
Any ways to speed this up?
Q2: Newbie question but why is jsinterp.py used in the first way? Isn't there an easier way to run a few lines of javascript? Or could someone explain the reason behind this :)
Kind regards
Provide verbose output that clearly demonstrates the problem
Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
If using API, add 'verbose': True to YoutubeDL params instead
Copy the WHOLE output (starting with [debug] Command-line config) and insert it below
Complete Verbose Output
No response
The text was updated successfully, but these errors were encountered:
Performance does vary between versions of cpython. This is a fact that has nothing to do with yt-dlp.
Having to interpret youtube's player JS does slow down extraction. There are some alternatives to this, such as only using Deno via plugin or avoiding web client formats altogether with --extractor-arg "youtube:player_client=ios". But unless you have a better idea of how to more efficiently decode the youtube nsig parameters, there is nothing else to be done with this issue
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Please make sure the question is worded well enough to be understood
Around a year ago I set up a server to download YouTube videos. The response times used to be quite fast when querying formats for a given video. Since for some Websites updates were required I updated ytdlp from time to time.
The current versions appear to be slower. Is there any particular reason? Or are there ways to run it more performant.
Also the performance varies drastically based on the python version? Any clues on why that could be?
Also back when everything ran on python 3.7 I remembered things to be a lot faster...
Given the simple benchmark script:
On a raspberry pi 4 I get the following results:
Small update: the most time seems to be spent in the jsinterp.py
Any ways to speed this up?
Q2: Newbie question but why is jsinterp.py used in the first way? Isn't there an easier way to run a few lines of javascript? Or could someone explain the reason behind this :)
Kind regards
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output
No response
The text was updated successfully, but these errors were encountered: