Comparing version 2.0.7 to 2.1.0
20
index.js
@@ -6,3 +6,3 @@ #!/usr/bin/env node | ||
import { createRequire } from 'module'; | ||
import { chunk } from 'lodash-es'; | ||
import { sleep } from './src/utils.js'; | ||
@@ -61,3 +61,3 @@ const require = createRequire(import.meta.url); | ||
url = url.trim(); | ||
console.log(`fetching pages for ${url}`); | ||
console.log(`Fetching pages for:`, url); | ||
const data = await getDataByUrl(url); | ||
@@ -90,7 +90,17 @@ // console.log(data); | ||
); | ||
// console.log('Pages:', pages); | ||
const pageChunks = chunk(pages, argv.threads || 5); | ||
for (const c of pageChunks) { | ||
await Promise.all(c.map(download2mp3)); | ||
let maxThreads = argv.threads; | ||
let currentThreads = 0; | ||
for (const page of pages) { | ||
while (currentThreads === maxThreads) { | ||
// wait for available thread | ||
await sleep(100); | ||
} | ||
currentThreads += 1; | ||
download2mp3(page).finally(() => { | ||
currentThreads -= 1; | ||
}); | ||
} | ||
})(); |
{ | ||
"name": "bv2mp3", | ||
"version": "2.0.7", | ||
"version": "2.1.0", | ||
"description": "A tool to download all videos and convert to mp3 inside a video set of bilibili (also works for single video, of course).", | ||
@@ -25,8 +25,8 @@ "bin": "index.js", | ||
"dependencies": { | ||
"@ffmpeg/core": "0.10.0", | ||
"@ffmpeg/ffmpeg": "0.10.1", | ||
"axios": "0.27.2", | ||
"commander": "9.4.0", | ||
"@ffmpeg/core": "0.11.0", | ||
"@ffmpeg/ffmpeg": "0.11.6", | ||
"axios": "1.3.4", | ||
"commander": "10.0.0", | ||
"lodash-es": "4.17.21", | ||
"minimist": "1.2.6", | ||
"minimist": "1.2.8", | ||
"multi-progress": "4.0.0", | ||
@@ -36,7 +36,7 @@ "progress": "2.0.3" | ||
"devDependencies": { | ||
"conventional-changelog-cli": "^2.2.2", | ||
"eslint": "8.20.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"conventional-changelog-cli": "2.2.2", | ||
"eslint": "8.36.0", | ||
"eslint-config-prettier": "8.8.0", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"prettier": "2.7.1" | ||
"prettier": "2.8.7" | ||
}, | ||
@@ -43,0 +43,0 @@ "eslintConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22725
311
+ Added@ffmpeg/core@0.11.0(transitive)
+ Added@ffmpeg/ffmpeg@0.11.6(transitive)
+ Addedaxios@1.3.4(transitive)
+ Addedcommander@10.0.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removed@ffmpeg/core@0.10.0(transitive)
- Removed@ffmpeg/ffmpeg@0.10.1(transitive)
- Removedaxios@0.27.2(transitive)
- Removedcommander@9.4.0(transitive)
- Removedminimist@1.2.6(transitive)
Updated@ffmpeg/core@0.11.0
Updated@ffmpeg/ffmpeg@0.11.6
Updatedaxios@1.3.4
Updatedcommander@10.0.0
Updatedminimist@1.2.8