Skip to content

Commit 0706802

Browse files
authored
Merge pull request #100 from stemrollerapp/v3
Use yt-dlp instead of youtubei.js for downloads
2 parents 926f4ee + cc3d276 commit 0706802

File tree

11 files changed

+1963
-1612
lines changed

11 files changed

+1963
-1612
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ node_modules
1414
!*-extra-files/ThirdPartyApps/ffmpeg/bin
1515
*-extra-files/ThirdPartyApps/ffmpeg/bin/**
1616
!*-extra-files/ThirdPartyApps/ffmpeg/bin/.gitkeep
17+
*-extra-files/ThirdPartyApps/yt-dlp/**
18+
!*-extra-files/ThirdPartyApps/yt-dlp/.gitkeep
1719
*-extra-files/Models/**
1820
!*-extra-files/Models/.gitkeep

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npm i -D
2424

2525
### Linux (Not officially supported)
2626

27-
Install `ffmpeg` globally using your preferred package manager, and install `demucs` globally with `pip`.
27+
Install `ffmpeg` globally using your preferred package manager, and install `demucs` and `yt-dlp` globally with `pip`.
2828
If you get "Couldn't find appropriate backend" errors, try installing `libsox-dev`.
2929

3030
## Run in Development Mode

download-third-party-apps.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,21 @@ async function main() {
125125
]
126126

127127
if (process.platform === 'win32') {
128-
downloads.push([
129-
'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip',
130-
path.join(
131-
`${winOrMac}-extra-files`,
132-
'ThirdPartyApps',
133-
'ffmpeg',
134-
'ffmpeg-release-essentials.zip'
135-
),
136-
])
128+
downloads.push(
129+
[
130+
'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip',
131+
path.join(
132+
`${winOrMac}-extra-files`,
133+
'ThirdPartyApps',
134+
'ffmpeg',
135+
'ffmpeg-release-essentials.zip'
136+
),
137+
],
138+
[
139+
'https://github.com/yt-dlp/yt-dlp/releases/download/2025.09.26/yt-dlp_win.zip',
140+
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'yt-dlp', 'yt-dlp_win.zip'),
141+
]
142+
)
137143
} else if (process.platform === 'darwin') {
138144
downloads.push(
139145
[
@@ -143,6 +149,10 @@ async function main() {
143149
[
144150
'https://evermeet.cx/ffmpeg/getrelease/ffprobe/zip',
145151
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'ffmpeg', 'ffprobe-release.zip'),
152+
],
153+
[
154+
'https://github.com/yt-dlp/yt-dlp/releases/download/2025.09.26/yt-dlp_macos.zip',
155+
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'yt-dlp', 'yt-dlp_macos.zip'),
146156
]
147157
)
148158
}
@@ -205,6 +215,13 @@ async function main() {
205215
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'ffmpeg', 'bin', 'ffprobe')
206216
)
207217
console.log('Move successful: ffmpeg and ffprobe')
218+
219+
console.log('Renaming yt-dlp_macos to yt-dlp')
220+
await fsPromises.rename(
221+
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'yt-dlp', 'yt-dlp_macos'),
222+
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'yt-dlp', 'yt-dlp')
223+
)
224+
console.log('Rename successful: yt-dlp_macos to yt-dlp')
208225
}
209226
}
210227

mac-extra-files/ThirdPartyApps/yt-dlp/.gitkeep

Whitespace-only changes.

main-src/fetchYtStream.js

Lines changed: 0 additions & 174 deletions
This file was deleted.

main-src/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import xxhash from 'xxhash-wasm'
1010
import serve from 'electron-serve'
1111
import Store from 'electron-store'
1212
import * as processQueue from './processQueue.js'
13-
import { searchYt, deleteYtCacheDir } from './fetchYtStream.js'
13+
import { searchYt } from './searchYt.js'
1414

1515
let electronStore = null
1616

@@ -306,7 +306,7 @@ async function checkForMsvcRuntime() {
306306
}
307307

308308
async function main() {
309-
await deleteYtCacheDir()
309+
await processQueue.deleteYtCacheDir()
310310
await processQueue.deleteTmpFolders()
311311

312312
app.on('second-instance', (event, commandLine, workingDirectory, additionalData) => {
@@ -364,7 +364,7 @@ async function main() {
364364
})
365365

366366
app.on('window-all-closed', async () => {
367-
await deleteYtCacheDir()
367+
await processQueue.deleteYtCacheDir()
368368
await processQueue.setItems([])
369369
await processQueue.deleteTmpFolders()
370370
app.quit()

0 commit comments

Comments
 (0)