diff --git a/README.md b/README.md index c7bde42..788952d 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,9 @@ To run with [Electron](https://www.electronjs.org/) : npm start ``` -To build for Linux (It will create packages as specified in package.json). The builds are stored in **release** folder. You need to be in a Linux environment to execute those scripts. Otherwise you can download the ffmpeg binary for the respective platform and put it in the root directory of the app and build with electron-builder. +You need to download ffmpeg and put it in the root directory of the project. If you don't need to build for arm processor, you can download ffmpeg by executing any of the files - linux.sh / mac.sh / windows.sh depending on the platform. Otherwise you need to download ffmpeg from [here](https://github.com/yt-dlp/FFmpeg-Builds/releases) for windows/linux and from [here](http://www.osxexperts.net/) for mac (not tested) +To build for Linux (It will create packages as specified in package.json). The builds are stored in **release** folder. ``` npm run linux ``` @@ -188,3 +189,8 @@ To build for macOS ``` npm run mac ``` +If you only want to build for one format, you can do +``` +npx electron-builder -l appimage +``` +It will just create a linux appimage build. \ No newline at end of file diff --git a/linux.sh b/linux.sh index 1c321eb..43140f8 100755 --- a/linux.sh +++ b/linux.sh @@ -2,10 +2,16 @@ # Script to download the latest x64 linux version of custom ffmpeg build for yt-dlp # The binary will be placed in the root dir of the app -rm ffmpeg* -wget "https://github.com/yt-dlp/FFmpeg-Builds/releases/latest/download/ffmpeg-n5.1-latest-linux64-gpl-5.1.tar.xz" -tar xvf ffmpeg-n5.1-latest-linux64-gpl-5.1.tar.xz -cp ffmpeg-n5.1-latest-linux64-gpl-5.1/bin/ffmpeg ffmpeg +if ls ffmpeg* 1> /dev/null 2>&1; then + rm ffmpeg* +fi +# >> Check if curl is installed or nor +if ! command -V curl > /dev/null 2>&1; then + echo "curl not installed, please install it and try again" + exit +fi + +curl -SL --progress-bar "https://github.com/aandrew-me/ffmpeg-builds/releases/download/v6/ffmpeg_linux_amd64" -o ffmpeg + chmod +x ffmpeg -rm -rf ffmpeg-n5.1-latest-linux64-gpl-5.1 -rm ffmpeg-n5.1-latest-linux64-gpl-5.1.tar.xz + diff --git a/mac.sh b/mac.sh index e7aad03..9d050af 100644 --- a/mac.sh +++ b/mac.sh @@ -1,9 +1,16 @@ #!/bin/bash # Script to download the latest x64 mac version of ffmpeg # The binary will be placed in the root dir of the app -rm ffmpeg* -curl https://evermeet.cx/ffmpeg/ffmpeg-6.0.zip -o ffmpeg.zip -unzip ffmpeg.zip -chmod +x ffmpeg -rm ffmpeg.zip +if ls ffmpeg* 1> /dev/null 2>&1; then + rm ffmpeg* +fi +# >> Check if curl is installed or nor +if ! command -V curl > /dev/null 2>&1; then + echo "curl not installed, please install it and try again" + exit +fi + +curl -SL --progress-bar "https://github.com/aandrew-me/ffmpeg-builds/releases/download/v6/ffmpeg_mac" -o ffmpeg + +chmod +x ffmpeg diff --git a/package.json b/package.json index 0159967..964f48a 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,16 @@ "yt-dlp-wrap-plus": "^2.3.18" }, "name": "ytdownloader", - "version": "3.17.1", + "version": "3.17.2", "main": "main.js", "scripts": { "start": "electron .", "watch": "nodemon --exec electron .", "dist": "electron-builder", "debug": "electron --inspect=5858 .", - "windows": "./windows.sh && electron-builder -w", - "linux": "./linux.sh && electron-builder -l", - "mac": "./mac.sh && electron-builder -m", + "windows": "electron-builder -w", + "linux": "electron-builder -l", + "mac": "electron-builder -m", "publish-linux": "cp ../ffmpeg-bin/ffmpeg . && electron-builder -l --publish=always", "publish-windows": "cp ../ffmpeg-bin/ffmpeg.exe . && electron-builder -w --publish=always", "publish-mac": "cp ../ffmpeg-bin/mac/ffmpeg . && electron-builder -m --publish=always", diff --git a/windows.sh b/windows.sh index 4ce4a99..b28cc79 100755 --- a/windows.sh +++ b/windows.sh @@ -2,10 +2,15 @@ # Script to download the latest x64 windows version of custom ffmpeg build for yt-dlp # The binary will be placed in the root dir of the app -rm ffmpeg* -wget "https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-n5.1-latest-win64-gpl-5.1.zip" -unzip ffmpeg-n5.1-latest-win64-gpl-5.1.zip -cp ffmpeg-n5.1-latest-win64-gpl-5.1/bin/ffmpeg.exe ffmpeg.exe -chmod +x ffmpeg.exe -rm -rf ffmpeg-n5.1-latest-win64-gpl-5.1 -rm ffmpeg-n5.1-latest-win64-gpl-5.1.zip \ No newline at end of file +if ls ffmpeg* 1> /dev/null 2>&1; then + rm ffmpeg* +fi +# >> Check if curl is installed or nor +if ! command -V curl > /dev/null 2>&1; then + echo "curl not installed, please install it and try again" + exit +fi + +curl -SL --progress-bar "https://github.com/aandrew-me/ffmpeg-builds/releases/download/v6/ffmpeg.exe" -o ffmpeg.exe + +chmod +x ffmpeg.exe \ No newline at end of file