From 1aa0be59daa4a2b223abacdca51d3476e804befb Mon Sep 17 00:00:00 2001 From: Nemo Date: Wed, 28 Jul 2021 17:22:36 +0530 Subject: [PATCH] Change flags to --timestamps and --durations --- README.md | 17 ++++++++++------- index.js | 13 ++++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fe114b5..b24b317 100644 --- a/README.md +++ b/README.md @@ -37,16 +37,19 @@ You need to pass 2 parameters, a Youtube URL and a output CUE filename. YouTube --help, Show help --audio-file, Input Audio File (optional) that is written to the CUE sheet - The default audio file is set to %VIDEOTITLE.m4a - The default output file is set to %VIDEOTITLE.cue + The default audio file is set to %VIDEOTITLE.m4a + The default output file is set to %VIDEOTITLE.cue - where $VIDEOTITLE is the title of the YouTube video. + 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" diff --git a/index.js b/index.js index 1aa9d3e..441756e 100755 --- a/index.js +++ b/index.js @@ -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) }