From 94cad2773d3510de277e2b2e33ee07cc8204e3ec Mon Sep 17 00:00:00 2001 From: Timm Ruppert Date: Wed, 10 Nov 2021 09:29:00 +0100 Subject: [PATCH 1/3] Added youtube-dl and youtube-dlp (original shortname yt-dlp) as submodules --- .gitmodules | 6 ++++++ lib/youtube-dl | 1 + lib/yt-dlp | 1 + 3 files changed, 8 insertions(+) create mode 100644 .gitmodules create mode 160000 lib/youtube-dl create mode 160000 lib/yt-dlp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..886f75203 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "lib/youtube-dl"] + path = lib/youtube-dl + url = https://github.com/ytdl-org/youtube-dl.git +[submodule "lib/yt-dlp"] + path = lib/yt-dlp + url = https://github.com/yt-dlp/yt-dlp.git diff --git a/lib/youtube-dl b/lib/youtube-dl new file mode 160000 index 000000000..a80358271 --- /dev/null +++ b/lib/youtube-dl @@ -0,0 +1 @@ +Subproject commit a8035827177d6b59aca03bd717acb6a9bdd75ada diff --git a/lib/yt-dlp b/lib/yt-dlp new file mode 160000 index 000000000..9ebf3c6ab --- /dev/null +++ b/lib/yt-dlp @@ -0,0 +1 @@ +Subproject commit 9ebf3c6ab97c29b2d5872122e532bc98b93ad8b3 From 22464432d32d7ae524701752b92deeda13b8ce90 Mon Sep 17 00:00:00 2001 From: Timm Ruppert <25816243+nullket@users.noreply.github.com> Date: Wed, 10 Nov 2021 16:40:40 +0100 Subject: [PATCH 2/3] Do not download and integrate youtube-dl (or forks) during the run of the github action (which releases this addon). Instead the new git submodules are used. Following the recommendation in the kodi wiki, they are stored in a subfolder called lib. Also removed the travis instructions to clean up a bit --- .github/scripts/build-script.sh | 4 --- .github/workflows/build-addon.yml | 1 - .travis.yml | 51 ------------------------------- lib/__init__.py | 0 service.py | 2 +- 5 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 .travis.yml create mode 100644 lib/__init__.py diff --git a/.github/scripts/build-script.sh b/.github/scripts/build-script.sh index 4c25c0420..8f2ee3c36 100644 --- a/.github/scripts/build-script.sh +++ b/.github/scripts/build-script.sh @@ -4,10 +4,6 @@ git config --global user.email "tristanteufel@googlemail.com" git config --global user.name "firsttris" cd .. -# youtube_dl -wget ${YOUTUBE_DL} -unzip master.zip -cp -R youtube-dl-master/youtube_dl ${ADDON_NAME} # clone repo git clone https://${GH_REPO} git clone https://${GH_REPO_PYTHON3} diff --git a/.github/workflows/build-addon.yml b/.github/workflows/build-addon.yml index 3dd4b5331..fbcb037d5 100644 --- a/.github/workflows/build-addon.yml +++ b/.github/workflows/build-addon.yml @@ -9,7 +9,6 @@ jobs: env: GH_REPO: "github.com/firsttris/repository.sendtokodi.git" GH_REPO_PYTHON3: "github.com/firsttris/repository.sendtokodi.python3.git" - YOUTUBE_DL: https://github.com/rg3/youtube-dl/archive/master.zip VERSION: 0.1.${{github.run_id}} ADDON_NAME: plugin.video.sendtokodi REPO_NAME: repository.sendtokodi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 47cd23640..000000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: python -python: -- '3.5' -env: - global: - - GH_REPO="github.com/firsttris/repository.sendtokodi.git" - - GH_REPO_PYTHON3="github.com/firsttris/repository.sendtokodi.python3.git" - - YOUTUBE_DL="https://github.com/rg3/youtube-dl/archive/master.zip" - - VERSION=0.0.${TRAVIS_JOB_NUMBER} - - ADDON_NAME="plugin.video.sendtokodi" - - REPO_NAME="repository.sendtokodi" - - REPO_NAME_PYTHON3="repository.sendtokodi.python3" - - NAME="sendtokodi" -script: -- rm -rf .git/ -# LATER - envsubst < "addon.template.xml" > "addon.xml" -- cd .. -# youtube_dl -- wget ${YOUTUBE_DL} -- unzip master.zip -- cp -R youtube-dl-master/youtube_dl ${ADDON_NAME} -# clone repo -- git clone https://${GH_REPO} -- git clone https://${GH_REPO_PYTHON3} -# package python 2 addon -- envsubst < "${REPO_NAME}/${ADDON_NAME}/addon.template.xml" > "${REPO_NAME}/${ADDON_NAME}/addon.xml" # python 2 addon.xml -- cp ${REPO_NAME}/${ADDON_NAME}/addon.xml ${ADDON_NAME} # copy python 2 addon.xml to addon folder -- zip -r ${ADDON_NAME}-${VERSION}.zip ${ADDON_NAME} # create zip for python 2 -- cp ${ADDON_NAME}-${VERSION}.zip ${REPO_NAME}/${ADDON_NAME}/ # copy source code to python 2 repo -# package python 3 addon -- envsubst < "${REPO_NAME_PYTHON3}/${ADDON_NAME}/addon.template.xml" > "${REPO_NAME_PYTHON3}/${ADDON_NAME}/addon.xml" #python 3 addon.xml -- rm ${ADDON_NAME}/addon.xml # remove previous python 2 addon.xml -- cp ${REPO_NAME_PYTHON3}/${ADDON_NAME}/addon.xml ${ADDON_NAME} # copy python 3 addon.xml to addon folder -- zip -r ${ADDON_NAME}-${VERSION}.zip ${ADDON_NAME} # create zip for python 3 -- cp ${ADDON_NAME}-${VERSION}.zip ${REPO_NAME_PYTHON3}/${ADDON_NAME}/ # copy source code to python 3 repo -# commit & push to python 2 repo -- cd ${REPO_NAME}/ -- envsubst < "addon.template.xml" > "addon.xml" -- md5sum addon.xml > addon.xml.md5 -- git add . -- git commit -m "Travis-CI Update" -- git push --force --quiet "https://${GH_TOKEN}@${GH_REPO}" master > /dev/null 2>&1 -# go back one folder -- cd .. -# commit & push to python 3 repo -- cd ${REPO_NAME_PYTHON3}/ -- envsubst < "addon.template.xml" > "addon.xml" -- md5sum addon.xml > addon.xml.md5 -- git add . -- git commit -m "Travis-CI Update" -- git push --force --quiet "https://${GH_TOKEN}@${GH_REPO_PYTHON3}" master > /dev/null 2>&1 \ No newline at end of file diff --git a/lib/__init__.py b/lib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/service.py b/service.py index b370ff536..6df29bb35 100644 --- a/service.py +++ b/service.py @@ -42,7 +42,7 @@ def strptime(date_string, format): patchYoutubeDL() -from youtube_dl import YoutubeDL +from lib.youtube-dl.youtube_dl import YoutubeDL def showInfoNotification(message): From 660074b0417ac5489306054d8345b147d0f3a760 Mon Sep 17 00:00:00 2001 From: nullket <25816243+nullket@users.noreply.github.com> Date: Wed, 10 Nov 2021 19:46:24 +0100 Subject: [PATCH 3/3] Create build-addon.yml Make action checkout submodules as well --- .github/workflows/build-addon.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-addon.yml b/.github/workflows/build-addon.yml index fbcb037d5..c5b1348d4 100644 --- a/.github/workflows/build-addon.yml +++ b/.github/workflows/build-addon.yml @@ -17,5 +17,7 @@ jobs: TOKEN: ${{secrets.PAT}} steps: - uses: actions/checkout@v2 + with: + submodules: recursive - run: chmod +x ${GITHUB_WORKSPACE}/.github/scripts/build-script.sh - - run: ${GITHUB_WORKSPACE}/.github/scripts/build-script.sh \ No newline at end of file + - run: ${GITHUB_WORKSPACE}/.github/scripts/build-script.sh