grab-url 0.9.137 → 0.9.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/grab-url-cli.js +12 -15
package/package.json
CHANGED
package/src/grab-url-cli.js
CHANGED
|
@@ -175,15 +175,15 @@ cleanupStateFile(stateFilePath) {
|
|
|
175
175
|
*/
|
|
176
176
|
printHeaderRow() {
|
|
177
177
|
console.log(
|
|
178
|
-
this.colors.success('
|
|
179
|
-
this.colors.yellow('
|
|
180
|
-
this.colors.cyan('
|
|
178
|
+
this.colors.success('%'.padEnd(this.COL_PERCENT)) +
|
|
179
|
+
this.colors.yellow('File'.padEnd(this.COL_FILENAME)) +
|
|
180
|
+
this.colors.cyan(''.padEnd(this.COL_SPINNER)) +
|
|
181
181
|
' ' +
|
|
182
|
-
this.colors.green('
|
|
183
|
-
this.colors.info('
|
|
184
|
-
this.colors.info('
|
|
185
|
-
this.colors.purple('
|
|
186
|
-
this.colors.pink('
|
|
182
|
+
this.colors.green('Progress'.padEnd(this.COL_BAR + 1)) +
|
|
183
|
+
this.colors.info('Downloaded'.padEnd(this.COL_DOWNLOADED)) +
|
|
184
|
+
this.colors.info('Total'.padEnd(this.COL_TOTAL)) +
|
|
185
|
+
this.colors.purple('Speed'.padEnd(this.COL_SPEED)) +
|
|
186
|
+
this.colors.pink('ETA'.padEnd(this.COL_ETA))
|
|
187
187
|
);
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -857,23 +857,20 @@ async downloadMultipleFiles(downloads) {
|
|
|
857
857
|
const successful = results.filter(r => r.status === 'fulfilled' && r.value.success).length;
|
|
858
858
|
const failed = results.length - successful;
|
|
859
859
|
|
|
860
|
-
console.log(this.colors.green(
|
|
860
|
+
console.log(this.colors.green(`Success: ${successful}/${downloads.length}`));
|
|
861
861
|
if (failed > 0) {
|
|
862
|
-
console.log(this.colors.error(
|
|
862
|
+
console.log(this.colors.error(`Failed: ${failed}/${downloads.length}`));
|
|
863
863
|
|
|
864
864
|
results.forEach((result, index) => {
|
|
865
865
|
if (result.status === 'rejected' || !result.value.success) {
|
|
866
866
|
const filename = downloads[index].filename;
|
|
867
867
|
const error = result.reason || result.value?.error || 'Unknown error';
|
|
868
|
-
console.log(this.colors.error(`
|
|
868
|
+
console.log(this.colors.error(` ${filename}: ${error.message || error}`));
|
|
869
869
|
}
|
|
870
870
|
});
|
|
871
871
|
}
|
|
872
872
|
|
|
873
|
-
|
|
874
|
-
const celebrationEmojis = ['🥳', '🎊', '🎈', '🌟', '💯', '🚀', '✨', '🔥'];
|
|
875
|
-
const randomEmoji = celebrationEmojis[Math.floor(Math.random() * celebrationEmojis.length)];
|
|
876
|
-
console.log(this.colors.success(`${randomEmoji} Batch download completed! ${randomEmoji}`));
|
|
873
|
+
console.log(this.colors.success('Download completed'));
|
|
877
874
|
|
|
878
875
|
this.clearAbortControllers();
|
|
879
876
|
|