Change flags to --timestamps and --durations
This commit is contained in:
parent
c4b1b42461
commit
1aa0be59da
17
README.md
17
README.md
|
@ -37,16 +37,19 @@ You need to pass 2 parameters, a Youtube URL and a output CUE filename. YouTube
|
||||||
--help, Show help
|
--help, Show help
|
||||||
--audio-file, Input Audio File (optional) that is written to the CUE sheet
|
--audio-file, Input Audio File (optional) that is written to the CUE sheet
|
||||||
|
|
||||||
The default audio file is set to %VIDEOTITLE.m4a
|
The default audio file is set to %VIDEOTITLE.m4a
|
||||||
The default output file is set to %VIDEOTITLE.cue
|
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
|
Generally the parser detects whether numbers are positional timestamps or track durations.
|
||||||
--timestamps-are-durations Parse timestamps as 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
|
--timestamps Parse as positional timestamps (relative to the start of the playlist)
|
||||||
not be required for most files.
|
--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
|
Examples
|
||||||
$ youtube-cue --audio-file audio.m4a "https://www.youtube.com/watch?v=THzUassmQwE"
|
$ youtube-cue --audio-file audio.m4a "https://www.youtube.com/watch?v=THzUassmQwE"
|
||||||
|
|
13
index.js
13
index.js
|
@ -23,8 +23,11 @@ if (argv._.length <1 || argv.help ){
|
||||||
|
|
||||||
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
|
Generally the parser detects whether numbers are positional timestamps or track durations.
|
||||||
--timestamps-are-durations Parse timestamps as 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
|
The above 2 are only needed to force behaviour in very specific edge cases, they should
|
||||||
not be required for most files.
|
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 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) {
|
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)
|
exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue