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