@@ -89,8 +89,9 @@ function getRetryMessage({meta, ref, retryCount, maxRetries, bytesRead, totalByt
89
89
Number . isFinite ( maxRetries ) ? `/:{color(yellow)}${ maxRetries } :{color:close(yellow)}` : ''
90
90
} }: `,
91
91
lastErr
92
- ? `${ lastErr . code ? `[:{color(yellow)}${ lastErr . code } :{color:close(yellow)}] ` : '' } (:{color(yellow)}${ lastErr . message ||
93
- lastErr } :{color:close(yellow)}) `
92
+ ? `${ lastErr . code ? `[:{color(yellow)}${ lastErr . code } :{color:close(yellow)}] ` : '' } (:{color(yellow)}${
93
+ lastErr . message || lastErr
94
+ } :{color:close(yellow)}) `
94
95
: '' ,
95
96
totalBytes
96
97
? `(:{color(cyan)}${
@@ -618,20 +619,27 @@ async function init(queries, options) {
618
619
}
619
620
let { namespace} = Config . playlist ;
620
621
namespace = namespace ? xurl . format ( xurl . parse ( namespace ) ) . concat ( '/' ) : '' ;
621
- validStats . forEach ( ( { meta : { track : { uri, name, artists, duration} , service, outFilePath} } ) =>
622
- plStream . write (
623
- [
624
- '' ,
625
- `#${ service [ symbols . meta ] . DESC } URI: ${ uri } ` ,
626
- `#EXTINF:${ Math . round ( duration / 1e3 ) } ,${ artists [ 0 ] } - ${ name } ` ,
627
- `${ namespace . concat (
628
- ( entry => ( ! Config . playlist . escape ? entry : encodeURI ( entry ) . replace ( / # / g, '%23' ) ) ) (
629
- xpath . relative ( BASE_DIRECTORY , outFilePath ) ,
630
- ) ,
631
- ) } `,
632
- '' ,
633
- ] . join ( '\n' ) ,
634
- ) ,
622
+ validStats . forEach (
623
+ ( {
624
+ meta : {
625
+ track : { uri, name, artists, duration} ,
626
+ service,
627
+ outFilePath,
628
+ } ,
629
+ } ) =>
630
+ plStream . write (
631
+ [
632
+ '' ,
633
+ `#${ service [ symbols . meta ] . DESC } URI: ${ uri } ` ,
634
+ `#EXTINF:${ Math . round ( duration / 1e3 ) } ,${ artists [ 0 ] } - ${ name } ` ,
635
+ `${ namespace . concat (
636
+ ( entry => ( ! Config . playlist . escape ? entry : encodeURI ( entry ) . replace ( / # / g, '%23' ) ) ) (
637
+ xpath . relative ( BASE_DIRECTORY , outFilePath ) ,
638
+ ) ,
639
+ ) } `,
640
+ '' ,
641
+ ] . join ( '\n' ) ,
642
+ ) ,
635
643
) ;
636
644
plStream . close ( ) ;
637
645
logger . write ( '[done]\n' ) ;
@@ -990,10 +998,7 @@ async function init(queries, options) {
990
998
if ( ! audioFeeds || audioFeeds . err ) return { meta, err : ( audioFeeds || { } ) . err , code : 2 } ;
991
999
992
1000
const feedMeta = audioFeeds . formats . sort ( ( meta1 , meta2 ) => ( meta1 . abr > meta2 . abr ? - 1 : meta1 . abr < meta2 . abr ? 1 : 0 ) ) [ 0 ] ;
993
- meta . fingerprint = crypto
994
- . createHash ( 'md5' )
995
- . update ( `${ audioSource . source . videoId } ${ feedMeta . format_id } ` )
996
- . digest ( 'hex' ) ;
1001
+ meta . fingerprint = crypto . createHash ( 'md5' ) . update ( `${ audioSource . source . videoId } ${ feedMeta . format_id } ` ) . digest ( 'hex' ) ;
997
1002
const files = await downloadQueue
998
1003
. push ( { track, meta, feedMeta, trackLogger} )
999
1004
. catch ( errObject => Promise . reject ( { meta, code : 5 , ...( errObject . code ? errObject : { err : errObject } ) } ) ) ;
@@ -1520,7 +1525,7 @@ program
1520
1525
)
1521
1526
. option ( '-L, --filter-case' , 'enable case sensitivity for glob matches on the filters (unimplemented)' )
1522
1527
. option ( '--profile <PROFILE>' , 'configuration context with which to process the search and download' )
1523
- . action ( ( args , cmd ) => {
1528
+ . action ( ( _args , _cmd ) => {
1524
1529
throw Error ( 'Unimplemented: [CLI:search]' ) ;
1525
1530
} )
1526
1531
. on ( '--help' , ( ) => {
0 commit comments