Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Make youtube-dl a symlink of globally installed yt-dlp
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed May 17, 2022
1 parent 31e6c86 commit ccd3a67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
35 changes: 2 additions & 33 deletions deps/executable/youtube-dl
Original file line number Diff line number Diff line change
@@ -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 $@

0 comments on commit ccd3a67

Please sign in to comment.