🏡 index : github.com/captn3m0/youtube-cue.git

author Nemo <commits@captnemo.in> 2021-07-28 17:22:36.0 +05:30:00
committer Nemo <commits@captnemo.in> 2021-07-28 17:22:36.0 +05:30:00
commit
1aa0be59daa4a2b223abacdca51d3476e804befb [patch]
tree
e44c9def69a779817f233881154bd789d286f965
parent
c4b1b4246126c4dae3a0251c1b6978c57456deba
download
1aa0be59daa4a2b223abacdca51d3476e804befb.tar.gz

Change flags to --timestamps and --durations



Diff

 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
+++ a/README.md
@@ -37,16 +37,19 @@
      --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
+++ a/index.js
@@ -23,9 +23,12 @@

    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 @@

    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)
    }