From ccd3a672a73ae8c1cee39de2e02d6e3d554af411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 28 Dec 2021 10:27:45 +0800 Subject: [PATCH] Make youtube-dl a symlink of globally installed yt-dlp --- Makefile | 4 ---- deps/executable/youtube-dl | 35 ++--------------------------------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 90dd65c4360..1533261d0f4 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,6 @@ depends: /usr/bin/ruby other/parse_doc.rb /usr/bin/ruby other/change_lib_dependencies.rb "$(shell brew --prefix)" "$(shell brew --prefix mpv-iina)/lib/libmpv.dylib" -yt-dlp: - brew upgrade yt-dlp - cp "$(realpath $(shell which yt-dlp))" deps/executable/youtube-dl - archive: xcodebuild -project iina.xcodeproj -scheme iina -config Release -archivePath ./archive archive diff --git a/deps/executable/youtube-dl b/deps/executable/youtube-dl index 04eb8868ca9..738a952dd1b 100755 --- a/deps/executable/youtube-dl +++ b/deps/executable/youtube-dl @@ -1,33 +1,2 @@ -#!/opt/homebrew/Cellar/yt-dlp/2021.12.1/libexec/bin/python3.10 -# EASY-INSTALL-ENTRY-SCRIPT: 'yt-dlp==2021.12.1','console_scripts','yt-dlp' -import re -import sys - -# for compatibility with easy_install; see #2198 -__requires__ = 'yt-dlp==2021.12.1' - -try: - from importlib.metadata import distribution -except ImportError: - try: - from importlib_metadata import distribution - except ImportError: - from pkg_resources import load_entry_point - - -def importlib_load_entry_point(spec, group, name): - dist_name, _, _ = spec.partition('==') - matches = ( - entry_point - for entry_point in distribution(dist_name).entry_points - if entry_point.group == group and entry_point.name == name - ) - return next(matches).load() - - -globals().setdefault('load_entry_point', importlib_load_entry_point) - - -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) - sys.exit(load_entry_point('yt-dlp==2021.12.1', 'console_scripts', 'yt-dlp')()) +#/bin/sh +/usr/bin/env yt-dlp $@