Skip to content

Commit

Permalink
Update build info
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Feb 23, 2024
1 parent 5e58ca7 commit 49d756a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 22 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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.
18 changes: 12 additions & 6 deletions linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

15 changes: 11 additions & 4 deletions mac.sh
Original file line number Diff line number Diff line change
@@ -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
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
rm ffmpeg.zip

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 12 additions & 7 deletions windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 49d756a

Please sign in to comment.