grab-url 0.9.137 β 0.9.139
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 +16 -19
package/package.json
CHANGED
package/src/grab-url-cli.js
CHANGED
|
@@ -29,7 +29,7 @@ try {
|
|
|
29
29
|
spinners = JSON.parse(readFileSync(join(process.cwd(), 'src', 'spinners.json'), 'utf8'));
|
|
30
30
|
} catch (error3) {
|
|
31
31
|
// Fallback to default spinners if file not found
|
|
32
|
-
console.warn('
|
|
32
|
+
console.warn('Could not load spinners.json, using defaults');
|
|
33
33
|
spinners = {
|
|
34
34
|
dots: { frames: ['β ', 'β ', 'β Ή', 'β Έ', 'β Ό', 'β ΄', 'β ¦', 'β §', 'β ', 'β '] },
|
|
35
35
|
line: { frames: ['-', '\\', '|', '/'] },
|
|
@@ -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
|
|
|
@@ -882,14 +879,14 @@ async downloadMultipleFiles(downloads) {
|
|
|
882
879
|
this.setPauseCallback(() => {
|
|
883
880
|
if (!pausedMessageShown) {
|
|
884
881
|
this.multiBar.stop();
|
|
885
|
-
console.log(this.colors.warning('
|
|
882
|
+
console.log(this.colors.warning('Paused. Press p to resume, a to add URL'));
|
|
886
883
|
pausedMessageShown = true;
|
|
887
884
|
}
|
|
888
885
|
});
|
|
889
886
|
|
|
890
887
|
this.setResumeCallback(() => {
|
|
891
888
|
if (pausedMessageShown) {
|
|
892
|
-
console.log(this.colors.success('
|
|
889
|
+
console.log(this.colors.success('Resumed. Press p to pause, a to add URL'));
|
|
893
890
|
pausedMessageShown = false;
|
|
894
891
|
}
|
|
895
892
|
});
|
|
@@ -1703,7 +1700,7 @@ setupFallbackKeyboardListener() {
|
|
|
1703
1700
|
};
|
|
1704
1701
|
|
|
1705
1702
|
process.stdin.on('data', handleKeypress);
|
|
1706
|
-
console.log(this.colors.info('
|
|
1703
|
+
console.log(this.colors.info('Keyboard active: p=pause/resume, a=add URL'));
|
|
1707
1704
|
}
|
|
1708
1705
|
}
|
|
1709
1706
|
|