From 479480b3a0a062fd10092354622751cdb6c2ce2f Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 19 Oct 2023 21:11:29 +0200 Subject: kodi.packages.sendtokodi: init at 0.9.557 --- .../video/kodi/addons/sendtokodi/default.nix | 40 ++++++++++++++++++++++ .../kodi/addons/sendtokodi/use-packaged-deps.patch | 16 +++++++++ 2 files changed, 56 insertions(+) create mode 100644 pkgs/applications/video/kodi/addons/sendtokodi/default.nix create mode 100644 pkgs/applications/video/kodi/addons/sendtokodi/use-packaged-deps.patch (limited to 'pkgs/applications') 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() -- cgit 1.4.1