about summary refs log tree commit diff
path: root/pkgs/applications/video/kodi/addons/sendtokodi
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2023-10-19 21:11:29 +0200
committerPatrick Steinhardt <ps@pks.im>2023-10-22 19:48:49 +0200
commit479480b3a0a062fd10092354622751cdb6c2ce2f (patch)
tree6e8ec2f72fdbe9cba6f6c13906d1b2ade5e6fee0 /pkgs/applications/video/kodi/addons/sendtokodi
parent585a8b12b1ab3f5cfd7aec0b3958b754ef63bad2 (diff)
kodi.packages.sendtokodi: init at 0.9.557
Diffstat (limited to 'pkgs/applications/video/kodi/addons/sendtokodi')
-rw-r--r--pkgs/applications/video/kodi/addons/sendtokodi/default.nix40
-rw-r--r--pkgs/applications/video/kodi/addons/sendtokodi/use-packaged-deps.patch16
2 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/applications/video/kodi/addons/sendtokodi/default.nix b/pkgs/applications/video/kodi/addons/sendtokodi/default.nix
new file mode 100644
index 0000000000000..f6946842ded41
--- /dev/null
+++ b/pkgs/applications/video/kodi/addons/sendtokodi/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildKodiAddon, fetchFromGitHub, addonUpdateScript, kodi, inputstreamhelper }:
+
+buildKodiAddon rec {
+  pname = "sendtokodi";
+  namespace = "plugin.video.sendtokodi";
+  version = "0.9.557";
+
+  src = fetchFromGitHub {
+    owner = "firsttris";
+    repo = "plugin.video.sendtokodi";
+    rev = "v${version}";
+    hash = "sha256-Ga+9Q7x8+sEmQmteHbSyCahZ/T/l28BAEM84w7bf7z8=";
+  };
+
+  patches = [
+    ./use-packaged-deps.patch
+  ];
+
+  propagatedBuildInputs = [
+    inputstreamhelper
+  ];
+
+  postPatch = ''
+    # Remove vendored youtube-dl and yt-dlp libraries.
+    rm -r lib/
+  '';
+
+  passthru = {
+    # Instead of the vendored libraries, we propagate youtube-dl and yt-dlp via
+    # the Python path.
+    pythonPath = with kodi.pythonPackages; makePythonPath [ youtube-dl yt-dlp ];
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/firsttris/plugin.video.sendtokodi";
+    description = "Plays various stream sites on Kodi using youtube-dl";
+    license = licenses.mit;
+    maintainers = teams.kodi.members ++ [ maintainers.pks ];
+  };
+}
diff --git a/pkgs/applications/video/kodi/addons/sendtokodi/use-packaged-deps.patch b/pkgs/applications/video/kodi/addons/sendtokodi/use-packaged-deps.patch
new file mode 100644
index 0000000000000..abfea58a7ceb8
--- /dev/null
+++ b/pkgs/applications/video/kodi/addons/sendtokodi/use-packaged-deps.patch
@@ -0,0 +1,16 @@
+diff --git a/service.py b/service.py
+index 1d7b6e4..9782993 100644
+--- a/service.py
++++ b/service.py
+@@ -241,9 +241,9 @@ def playlistIndex(url, playlist):
+ 
+ # Use the chosen resolver while forcing to use youtube_dl on legacy python 2 systems (dlp is python 3.6+)
+ if xbmcplugin.getSetting(int(sys.argv[1]),"resolver") == "0" or sys.version_info[0] == 2:
+-    from lib.youtube_dl import YoutubeDL
++    from youtube_dl import YoutubeDL
+ else:
+-    from lib.yt_dlp import YoutubeDL
++    from yt_dlp import YoutubeDL
+     
+ # patch broken strptime (see above)
+ patch_strptime()