mirror of
https://github.com/snobu/destreamer.git
synced 2026-02-01 21:02:17 +00:00
Fixes and refactoring (#59)
* Input url list: Fix bad Windows behavior * Minor output fix * Fix all download issues - downloads are synchronous again - fix progress bar (fix #39) - nuke fluent and switch to a bug-free ffmpeg module (fessonia) * Move destreamer process events to a new file, we may add more in the future, lets give them their own space * Destreamer: Release packages and builder script ETA when? :P * Clean up * Implement yargs checks and add --videoUrlsFile option * Refactor error handling - Human readable - No magic numbers * Handle mkdir error - remove reduntant message * gitignore: don't add hidden files * Implement --outputDirectories This gives us more flexibility on where to save videos ..especially if your videos have all the same name <.< * Rename utils -> Utils * Fix tests don't import yargs on files other than main * Create scripts directory * Update make_release path * Fix typo * Create CONTRIBUTING.md Co-authored-by: kylon <kylonux@gmail.com>
This commit is contained in:
28
src/Types.ts
28
src/Types.ts
@@ -7,32 +7,8 @@ export type Session = {
|
||||
|
||||
export type Metadata = {
|
||||
date: string;
|
||||
duration: number;
|
||||
totalChunks: number; // Abstraction of FFmpeg timemark
|
||||
title: string;
|
||||
playbackUrl: string;
|
||||
posterImage: string;
|
||||
}
|
||||
|
||||
|
||||
interface Errors {
|
||||
[key: number]: string
|
||||
}
|
||||
|
||||
// I didn't use an enum because there is no real advantage that i can find and
|
||||
// we can't use multiline string for long errors
|
||||
// TODO: create better errors descriptions
|
||||
export const Errors: Errors = {
|
||||
22: 'FFmpeg is missing.\n' +
|
||||
'Destreamer requires a fairly recent release of FFmpeg to download videos.\n' +
|
||||
'Please install it in $PATH or copy the ffmpeg binary to the root directory (next to package.json). \n',
|
||||
|
||||
33: "Can't split videoId from videoUrl\n",
|
||||
|
||||
44: "Couldn't evaluate sessionInfo on the page\n",
|
||||
|
||||
55: 'Running in an elevated shell\n',
|
||||
|
||||
66: 'No valid URL in the input\n',
|
||||
|
||||
0: "Clean exit with code 0."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user