summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiota2023-11-10 10:03:08 -0800
committerxiota2023-11-10 10:03:41 -0800
commit7bde8e852ec4b8a56c57fdec7f5925ecf67f4608 (patch)
treeb1dca1e5e4c835d2150caaebcd934ae7c3f3e2c3
parent817ccaa88afffec275de666c67c3a871bf7854bc (diff)
downloadaur-7bde8e852ec4b8a56c57fdec7f5925ecf67f4608.tar.gz
2023.10.13
-rw-r--r--.SRCINFO15
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD40
-rw-r--r--youtube-dl-hook.sh2
-rw-r--r--youtube-dl.py7
-rw-r--r--youtube-dl.sh4
6 files changed, 53 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4bb2642545ea..7bbfb953ad04 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,14 @@
pkgbase = yt-dlp-drop-in
- pkgdesc = Emulate youtube-dl executables with yt-dlp (youtube-dlp)
- pkgver = 1.1
+ pkgdesc = Provide both youtube-dl command and python imports using yt-dlp
+ pkgver = 2023.10.13
pkgrel = 1
arch = any
- license = MIT
- depends = yt-dlp
- provides = youtube-dl
+ license = Unlicense
+ makedepends = python
+ provides = youtube-dl=2023.10.13
conflicts = youtube-dl
- source = youtube-dl-hook.sh
- sha256sums = 78e4e0ae75e40fea540afd65c4d45788a14b14611d358578cb7fa20e574efb8d
+ source = youtube-dl.py
+ sha256sums = 4b3d042525b05d84bb892a864a3ae832cc923bd630ea7e8b4d91ae9c4ec555db
pkgname = yt-dlp-drop-in
+ depends = yt-dlp
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..018a3de08144
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*
+!PKGBUILD
+!.SRCINFO
+!.gitignore
diff --git a/PKGBUILD b/PKGBUILD
index 75c557918564..9cc054ccbe48 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,18 +1,38 @@
-# Maintainer: Minmo <com dot gmail at maroboromike>
+# Maintainer:
+# Contributor: Minmo <com dot gmail at maroboromike>
# Contributor: Sematre <sematre at gmx dot de>
pkgname=yt-dlp-drop-in
-pkgver=1.1
+pkgver=2023.10.13
pkgrel=1
-pkgdesc='Emulate youtube-dl executables with yt-dlp (youtube-dlp)'
+pkgdesc='Provide both youtube-dl command and python imports using yt-dlp'
arch=('any')
-license=('MIT')
-depends=('yt-dlp')
-provides=('youtube-dl')
-conflicts=('youtube-dl')
-source=('youtube-dl-hook.sh')
-sha256sums=('78e4e0ae75e40fea540afd65c4d45788a14b14611d358578cb7fa20e574efb8d')
+license=('Unlicense')
+
+makedepends=('python')
+
+provides=("youtube-dl=${pkgver:?}")
+conflicts=("youtube-dl")
+
+source=(
+ "youtube-dl.py"
+ #"youtube-dl.sh"
+)
+sha256sums=(
+ "4b3d042525b05d84bb892a864a3ae832cc923bd630ea7e8b4d91ae9c4ec555db"
+ #"f2096dadce18216a3da2634202666713831ba8fb36f1f591e951c7329cc4f002"
+)
+
+pkgver() {
+ pacman -Si yt-dlp | sed -nE 's@^Version\s+: (.*)-.*$@\1@p'
+}
package() {
- install -Dm755 "youtube-dl-hook.sh" "${pkgdir}/usr/bin/youtube-dl"
+ depends=('yt-dlp')
+
+ install -Dm755 "${srcdir:?}/youtube-dl.py" "${pkgdir:?}/usr/bin/youtube-dl"
+
+ local _sitepackages="$(python -c 'import site; print(site.getsitepackages()[0])')"
+ install -dm755 "${pkgdir:?}${_sitepackages:?}"
+ ln -sfT "yt_dlp" "${pkgdir:?}${_sitepackages:?}/youtube_dl"
}
diff --git a/youtube-dl-hook.sh b/youtube-dl-hook.sh
deleted file mode 100644
index b4f083977560..000000000000
--- a/youtube-dl-hook.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/usr/bin/yt-dlp --compat-options youtube-dl "$@"
diff --git a/youtube-dl.py b/youtube-dl.py
new file mode 100644
index 000000000000..e42b5f3b50f4
--- /dev/null
+++ b/youtube-dl.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+import sys
+import yt_dlp
+
+if __name__ == '__main__':
+ yt_dlp.main(['--compat-options', 'youtube-dl'] + sys.argv[1:])
diff --git a/youtube-dl.sh b/youtube-dl.sh
new file mode 100644
index 000000000000..b91f257f45e8
--- /dev/null
+++ b/youtube-dl.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+
+YTDLP="$(which yt-dlp)"
+exec "${YTDLP}" --compat-options youtube-dl "$@"