Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ffmpeg through docker, fetchFFMPEG removed #85

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Expand Up @@ -13,6 +13,12 @@ WORKDIR /fp
VOLUME /fp/db
VOLUME /fp/videos

# Updates apt-get and installs ffmpeg
RUN DEBIAN_FRONTEND='noninteractive' && \
apt-get upgrade -y && \
apt-get update -y && \
apt-get install -y ffmpeg

# Install typescript so we can use the tsc command
RUN npm install -g typescript

Expand Down
Binary file added docker-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/float.ts
@@ -1,6 +1,6 @@
import { quickStart, validatePlexSettings } from './quickStart';
import { fetchSubscriptions } from './subscriptionFetching';
import { settings, fetchFFMPEG } from './lib/helpers';
import { settings } from './lib/helpers';
import { MyPlexAccount } from '@ctrl/plex';
import { fApi } from './lib/FloatplaneAPI';
import { loginFloatplane } from './logins';
Expand Down Expand Up @@ -43,7 +43,6 @@ const fetchNewVideos = async (subscriptions: Array<Subscription>, videoProcessor
}.\nHead to \u001b[36mhttps://github.com/Inrixia/Floatplane-Downloader/releases\u001b[0m to update!\n`
);

await fetchFFMPEG();
// Earlybird functions, these are run before script start and not run again if script repeating is enabled.
if (settings.runQuickstartPrompts) await quickStart();
settings.runQuickstartPrompts = false;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Video.ts
Expand Up @@ -170,7 +170,7 @@ export default class Video {
);
await new Promise((resolve, reject) =>
execFile(
args.headless === true ? './ffmpeg' : './db/ffmpeg',
'ffmpeg',
[
'-i',
`${this.filePath}.partial`,
Expand Down
25 changes: 1 addition & 24 deletions src/lib/helpers.ts
Expand Up @@ -30,27 +30,4 @@ if (args.headless === true) {
if (typeof params[0] === 'string') params[0] = params[0].replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
return originalStdoutWrite(...params);
}) as typeof process.stdout.write;
}

export const fetchFFMPEG = (): Promise<void> =>
new Promise((resolve, reject) => {
const platform = detectPlatform();
const path = args.headless === true ? './' : './db/';
if (fs.existsSync(`${path}${getBinaryFilename('ffmpeg', platform)}`) === false) {
process.stdout.write('> Ffmpeg binary missing! Downloading... ');
downloadBinaries(
'ffmpeg',
{
destination: path,
platform,
},
(err) => {
if (err !== null) reject(err);
else {
process.stdout.write('\u001b[36mDone!\u001b[0m\n\n');
resolve();
}
}
);
} else resolve();
});
}