Fix yt-dlp cli and docker image
This commit is contained in:
parent
16ee666c4f
commit
375ab9115e
@ -6,11 +6,10 @@ WORKDIR /musicbot
|
||||
COPY package.json package.json
|
||||
COPY ./.yarnrc.yml ./.yarnrc.yml
|
||||
COPY ./.yarn/releases ./.yarn/releases
|
||||
# CMD ["/bin/ash"]
|
||||
RUN yarn install
|
||||
|
||||
FROM node:lts-alpine
|
||||
RUN apk update && apk add ffmpeg
|
||||
RUN apk update && apk add ffmpeg python3
|
||||
COPY --from=zotify /app/dist/zotify /bin/zotify
|
||||
WORKDIR /musicbot
|
||||
COPY build build
|
||||
@ -18,4 +17,3 @@ COPY --from=builder /musicbot/node_modules ./node_modules
|
||||
COPY package.json package.json
|
||||
VOLUME [ "/musicbot/cache" ]
|
||||
CMD ["node", "--enable-source-maps", "build/index.js"]
|
||||
# CMD ["/bin/ash"]
|
@ -105,7 +105,7 @@ class YtdlpDownloader extends Downloader
|
||||
const { resolve, reject, url } = entry;
|
||||
this.logger.info(`Processing queue, downloading ${url}`);
|
||||
const ts = Date.now();
|
||||
exec(`${this.#executable} ${this.#options.join(' ')} -o ${ts}-%(title)s.%(ext)s ${url}`, (error, stdout, stderr) =>
|
||||
exec(`${this.#executable} ${this.#options.join(' ')} -o "${ts}-%(title)s.%(ext)s" ${url}`, (error, stdout, stderr) =>
|
||||
{
|
||||
if (error)
|
||||
return reject(error);
|
||||
@ -123,8 +123,8 @@ class YtdlpDownloader extends Downloader
|
||||
const ext = path.extname(file);
|
||||
const name = file
|
||||
.replace(`${ts}-`, '')
|
||||
.replace('_', ' ')
|
||||
.replace(ext, '');
|
||||
.replace(ext, '')
|
||||
.replaceAll('_', ' ');
|
||||
|
||||
resolve({
|
||||
filePath: path.resolve('./cache/youtube', file),
|
||||
|
Loading…
Reference in New Issue
Block a user