WARNING: [youtube] Couldn't extract YouTube video throttling parameter descrambling function name
n
in each download URL; downloading is throttled from the URL unless the new n
value is substituted. Every so often YT changes the syntax of the JS in a way that confuses yt-dl's toy JS interpreter.extractor/youtube.py
file.Youtube-DL fork YT-DLP has had a workaround since YT introduced this. It's what I use on PCs under TarTube as a result.Since 2021 YT has been sending a chunk of obfuscated JS that the web player runs on the query parametern
in each download URL; downloading is throttled from the URL unless the newn
value is substituted. Every so often YT changes the syntax of the JS in a way that confuses yt-dl's toy JS interpreter.
Is there a fix for this available?
OK, that looks good...Yes, in the upstream master branch
...ah, that's not so good. So there's a a fix available, but then you're saying it can't be used?The cumulative result of this affects several files, so in this case it isn't possible just to patch in theextractor/youtube.py
file.
Yes, screwed up the packaging by keeping old versions of youtube.py, bbc.py and itv.pySome .pyc left over somewhere?
~/.cache/youtube-dl/youtube-nsig
on my Linux desktop), so that the player JS is only downloaded when YT changes to a new player. Although the n-response calculation is probably challenging for the HD/R Python environment, it's only done once per n
value per yt-dl invocation; typically all the formats have the same n
value.Is the file the same for everybody? Currently I see md5sum:the player JS is only downloaded when YT changes to a new player. Although the n-response calculation is probably challenging for the HD/R Python environment, it's only done once pern
value per yt-dl invocation; typically all the formats have the samen
value.
s
query parameter to make a valid URL - cached in youtube-sigfuncs
n
query parameter challenge - cached in youtube-nsig
.WARNING: Writing cache to u'/.cache/youtube-dl/youtube-nsig/1f77e565.json' failed: ...
OSError: [Errno 30] Read-only file system: '/.cache'
--cache-dir DIR
Location in the filesystem where youtube-dl can store some down‐
loaded information permanently. By default
$XDG_CACHE_HOME/youtube-dl or ~/.cache/youtube-dl . At the mo‐
ment, only YouTube player files (for videos with obfuscated sig‐
natures) are cached, but that may change.
XDG_CACHE_HOME
isn't defined, we're using ~/.cache
where ~
is supposed to mean $HOME
. In the post above it has been expanded to /mod
as expected. In a QTube run, HOME
seems to be unset. Maybe it should be set in the script that QTube calls, like this? #!/bin/sh
+[ -n "$HOME" -a -d "$HOME" ] || HOME=/mod
python /mod/lib/python2.7/dist-packages/youtube-dl "$@"
Feels a bit clunky. Presumably lack of HOME ought to be dealt with elsewhere, more generally. How's it supposed to work?In a QTube run,HOME
seems to be unset. Maybe it should be set in the script that QTube calls
HOME
is normally set to /mod
but either not set or set to /
for the user under which queued tasks run. But perhaps it's just that /etc/profile
is either not run or run as non-interactive, which means that HOME
isn't set:...
# If running interactively, then:
if [ -n "$PS1" ]; then
...
export HOME=/mod
fi
...
exec
command which accepts an environment list from $::env
(a {name value ...}
list). Then a non-interactive shell is run from the #!/bin/sh
in the script. It could have a -i
(interactive) option but that does other things too. Actually the clunky solution seems quite reasonable, and I did get new cached items.--cache-dir ...
option of yt-dl that could be used, but I think it should be reserved for overriding the default behaviour.Brief research seem to lead to /etc/profile and one component that loads is /mod/.env , so maybe in the latter? But what creates that?
/sbin/modinit
Thanks. I thought I'd searched that but must have slipped through without. Tired I guess./sbin/modinit
You could test it by modifying /mod/.env to include it and seeing if it picks it up.But perhaps it's just that/etc/profile
is either not run or run as non-interactive, which means thatHOME
isn't set
Yes, seems so.Actually the clunky solution seems quite reasonable
15:57:55 - --------------------------------------------------------------
15:57:55 - Starting immediate download of https://www.youtube.com/watch?v=pBv1-AI0Klg Options -F
15:59:03 - [youtube] pBv1-AI0Klg: Downloading webpage
15:59:05 - [youtube] pBv1-AI0Klg: Downloading player 19fc75cf
15:59:33 - [youtube] pBv1-AI0Klg: Downloading MPD manifest
14:10:56 - --------------------------------------------------------------
14:10:56 - Starting immediate download of https://www.youtube.com/watch?v=pBv1-AI0Klg Options -F
14:12:21 - [youtube] pBv1-AI0Klg: Downloading webpage
14:12:23 - [youtube] pBv1-AI0Klg: Downloading player 19fc75cf
14:12:51 - [youtube] pBv1-AI0Klg: Downloading MPD manifest
14:26:27 - --------------------------------------------------------------
14:26:27 - Starting immediate download of https://www.youtube.com/watch?v=pBv1-AI0Klg Options -x --audio-format mp3
14:27:59 - [youtube] pBv1-AI0Klg: Downloading webpage
14:28:01 - [youtube] pBv1-AI0Klg: Downloading player 19fc75cf
14:28:29 - [youtube] pBv1-AI0Klg: Downloading MPD manifest
15:57:55 - --------------------------------------------------------------
15:57:55 - Starting immediate download of https://www.youtube.com/watch?v=pBv1-AI0Klg Options -F
15:59:03 - [youtube] pBv1-AI0Klg: Downloading webpage
15:59:05 - [youtube] pBv1-AI0Klg: Downloading player 19fc75cf
15:59:33 - [youtube] pBv1-AI0Klg: Downloading MPD manifest
30/10/2022 16:15:02 - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30/10/2022 16:15:02 - Starting queued download URL https://www.youtube.com/watch?v=pBv1-AI0Klg Options -x --audio-format mp3 QID 8591
30/10/2022 16:16:10 - [youtube] pBv1-AI0Klg: Downloading webpage
30/10/2022 16:16:12 - [youtube] pBv1-AI0Klg: Downloading player 19fc75cf
30/10/2022 16:16:39 - [youtube] pBv1-AI0Klg: Downloading MPD manifest
30/10/2022 16:23:37 - [download] Resuming download at byte 3072
30/10/2022 16:23:38 - [download] Destination: /mnt/hd2/My Video/Dusk_Cecil_Armstrong_Gibbs_1889-1960.mp4
30/10/2022 16:23:38 - [download] 0.1% of 7.74MiB at 98.46KiB/s ETA 01:24
30/10/2022 16:23:38 - [download] 0.1% of 7.74MiB at 191.87KiB/s ETA 00:42
30/10/2022 16:23:38 - [download] 0.1% of 7.74MiB at 116.01KiB/s ETA 01:09
...
30/10/2022 16:25:53 - [download] 99.5% of 7.74MiB at 58.26KiB/s ETA 00:00
30/10/2022 16:25:53 - [download] 100.0% of 7.74MiB at 58.50KiB/s ETA 00:00
30/10/2022 16:25:54 - [download] 100% of 7.74MiB in 02:16
30/10/2022 16:25:55 - [ffmpeg] Destination: /mnt/hd2/My Video/Dusk_Cecil_Armstrong_Gibbs_1889-1960.mp3
30/10/2022 16:36:45 - Deleting original file /mnt/hd2/My Video/Dusk_Cecil_Armstrong_Gibbs_1889-1960.mp4 (pass -k to keep)
30/10/2022 16:36:46 - Completed queued download of https://www.youtube.com/watch?v=pBv1-AI0Klg Options -x --audio-format mp3