Skip to content

Commit

Permalink
fix yt-dlp auto-update script
Browse files Browse the repository at this point in the history
  • Loading branch information
tejing1 committed Oct 31, 2024
1 parent aacf9f2 commit 2cfac43
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions homeConfigurations/tejing/media/yt-dlp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if [ $(stat -c '%Y' "$cachedir/version" 2>/dev/null || echo 0) -lt $((EPOCHSECON
newversion="$(curl -sSL https://pypi.org/rss/project/yt-dlp/releases.xml | sfeed | sort -rk1,1 | grep -v '.dev' | head -n 1 | cut -f2)"
if [ "$newversion" != "$curversion" ]; then
sha256="$(curl -sSL "https://pypi.org/pypi/yt-dlp/$newversion/json" | jq -r '.urls[] | select(.packagetype == "sdist") | .digests.sha256')"
mkdir -p "$cachedir" 1>&2
nix build --argstr version "$newversion" --argstr sha256 "$sha256" -o "$cachedir/package" --impure --expr '
{version, sha256}:
let
Expand All @@ -22,9 +23,7 @@ pkgs.yt-dlp.overrideAttrs (old: {
name = concatStringsSep "-" (lib.init (filter (x: x!=[]) (split "-" old.name)) ++ [ fixedversion ]);
version = fixedversion;
src = old.src.override {inherit version sha256; hash="";};
})' 1>&2
mkdir -p "$cachedir" 1>&2
printf '%s\n' "$newversion" >"$cachedir/version"
})' 1>&2 && printf '%s\n' "$newversion" >"$cachedir/version"
fi
fi

Expand Down

0 comments on commit 2cfac43

Please sign in to comment.