Fetching youtube url with youtube_dl is very slow

98 Views Asked by At

I'm having a problem with a shell script that I am making. I try to fetch the ids of the newest videos (last day) from a youtube channel with youtube_dl

Here is what I am doing for that:

video_list=$(youtube-dl --skip-download --get-id --dateafter now-2day "$channel_url" --verbose)

The output for this line looks like this:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--skip-download', '--get-id', '--dateafter', 'now-2day', 'https://www.youtube.com/@gustoonz', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.11.5 (CPython x86_64 64bit) - Linux-6.4.12-arch1-1-x86_64-with-glibc2.38 - OpenSSL 3.1.2 1 Aug 2023 - glibc 2.38
[debug] exe versions: ffmpeg 6.0, ffprobe 6.0, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best

the last lines go on and repeat for multiple minutes

The only problem I get is that it is very slow and seems to try to fetch every url from the channel.

Does anyone know how to go around this and/or get the urls faster? I am open to try something other than youtube_dl

0

There are 0 best solutions below