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

youtube-dl check is unstable and will produce false positives #19

Closed
theofficialgman opened this issue Mar 8, 2022 · 1 comment
Closed

Comments

@theofficialgman
Copy link

theofficialgman commented Mar 8, 2022

I have youtube-dl version 2022.02.04 (a self compiled version)

What is the goal here?

  if ! command -v youtube-dl >/dev/null || [ ! -z "$(youtube-dl -v 2>&1 | grep '2019\|2020')" ] || [ ! -z "$(youtube-dl -v 2>&1 | grep 'youtube-dl version 2021.01.08')" ] || [ "$(stat --printf="%s" $(command -v youtube-dl))" -ge 2000 ];then

if you just want to make sure youtube-dl is "new enough" then why not do something like this:

function version { echo "$@" | awk -F. '{ printf("%04d%02d%02d\n", $1,$2,$3); }'; }
ytdl_version=$(youtube-dl --version)
if [ $(version "$ytdl_version") -lt $(version "2021.10.07") ]; then
    echo "do stuff to install new version"
fi

also FYI, anything older than something from Feb 2022 is going to be EXTREMLY SLOW to download videos from youtube due to a change on youtube's end that now clients have to solve a puzzle to get fullspeed
you can read about it here: ytdl-org/youtube-dl#30184
commits with the fix are at the bottom

yes I realize this tool does not use youtube-dl to actually download the files (thats handled through the vlc lua script) but you should at least be doing proper checking

@Botspot Botspot closed this as completed in 002423e Mar 8, 2022
@Botspot
Copy link
Owner

Botspot commented Mar 8, 2022

I ended up doing:

if ! command -v youtube-dl >/dev/null || [ "$(date +%s -d "$(youtube-dl --version | tr '.' '/')")" -lt "$(date +%s -d "2021/12/17")" ];then

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

No branches or pull requests

2 participants