Change flags to --timestamps and --durations

This commit is contained in:
Nemo 2021-07-28 17:22:36 +05:30
parent c4b1b42461
commit 1aa0be59da
2 changed files with 18 additions and 12 deletions

View File

@ -42,11 +42,14 @@ You need to pass 2 parameters, a Youtube URL and a output CUE filename. YouTube
where $VIDEOTITLE is the title of the YouTube video.
--timestamps-only Do not try to parse the timestamps as track durations
--timestamps-are-durations Parse timestamps as durations
Generally the parser detects whether numbers are positional timestamps or track durations.
To enforce a desired interpretation you can use these flags:
The above 2 are only needed to force behaviour in very specific edge cases, they should
not be required for most files.
--timestamps Parse as positional timestamps (relative to the start of the playlist)
--durations Parse as track durations
The above 2 are only needed to force behaviour in
very specific edge cases, they should not be required for most files.
Examples
$ youtube-cue --audio-file audio.m4a "https://www.youtube.com/watch?v=THzUassmQwE"

View File

@ -23,8 +23,11 @@ if (argv._.length <1 || argv.help ){
where $VIDEOTITLE is the title of the YouTube video.
--timestamps-only Do not try to parse the timestamps as track durations
--timestamps-are-durations Parse timestamps as durations
Generally the parser detects whether numbers are positional timestamps or track durations.
To enforce a desired interpretation you can use these flags:
--timestamps Parse as positional timestamps (relative to the start of the playlist)
--durations Parse as track durations
The above 2 are only needed to force behaviour in very specific edge cases, they should
not be required for most files.
@ -42,12 +45,12 @@ if (argv._.length <1 || argv.help ){
let output_file = argv._[1]? argv._[1] : `${info.videoDetails.title}.cue`
let forceTimestamps = argv['timestamps-only']? argv['timestamps-only'] : false;
let forceTimestamps = argv['timestamps']? argv['timestamps'] : false;
let forceDurations = argv['timestamps-are-durations']? argv['timestamps-are-durations'] : false;
let forceDurations = argv['durations']? argv['durations'] : false;
if (forceTimestamps && forceDurations) {
console.error("You can't pass both --timestamps-only and timestamps-are-durations");
console.error("You can't pass both --timestamps and durations");
exit(1)
}