mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-28 15:40:56 +03:00
Compare commits
1 Commits
further-do
...
GlassedSil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51512a60da |
42
.github/workflows/docker-pr.yml
vendored
42
.github/workflows/docker-pr.yml
vendored
@@ -1,42 +0,0 @@
|
|||||||
name: docker-pr
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Set hash
|
|
||||||
id: vars
|
|
||||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
||||||
- name: Get current date
|
|
||||||
id: date
|
|
||||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
||||||
- name: create-json
|
|
||||||
id: create-json
|
|
||||||
uses: jsdaniell/create-json@1.1.2
|
|
||||||
with:
|
|
||||||
name: "version.json"
|
|
||||||
json: '{"type": "docker", "tag": "nightly", "commit": "${{ steps.vars.outputs.sha_short }}", "date": "${{ steps.date.outputs.date }}"}'
|
|
||||||
dir: 'backend/'
|
|
||||||
- name: setup platform emulator
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
- name: setup multi-arch docker build
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: build & push images
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm,linux/arm64/v8
|
|
||||||
push: false
|
|
||||||
tags: tzahi12345/youtubedl-material:nightly-pr
|
|
||||||
24
Dockerfile
24
Dockerfile
@@ -1,18 +1,17 @@
|
|||||||
FROM ubuntu:20.04 AS ffmpeg
|
FROM ubuntu:20.04 AS ffmpeg
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
RUN apt-get update && apt-get -y install curl xz-utils
|
||||||
|
|
||||||
COPY docker-build.sh .
|
COPY docker-build.sh .
|
||||||
RUN sh ./docker-build.sh
|
RUN sh ./docker-build.sh
|
||||||
|
|
||||||
FROM ubuntu:20.04 as frontend
|
FROM ubuntu:20.04 as frontend
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && apt-get -y install curl
|
RUN apt-get update
|
||||||
|
RUN apt-get -y install curl gnupg
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
||||||
RUN apt-get -y install nodejs \
|
RUN apt-get -y install nodejs
|
||||||
yarn
|
|
||||||
RUN npm config set strict-ssl false
|
|
||||||
RUN npm install -g @angular/cli
|
RUN npm install -g @angular/cli
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
@@ -32,23 +31,16 @@ ENV UID=1000 \
|
|||||||
USER=youtube \
|
USER=youtube \
|
||||||
NO_UPDATE_NOTIFIER=true
|
NO_UPDATE_NOTIFIER=true
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
RUN groupadd -g $GID $USER && useradd --system -g $USER --uid $UID $USER
|
RUN groupadd -g $GID $USER && useradd --system -g $USER --uid $UID $USER
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get -y install curl
|
||||||
|
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
||||||
RUN apt-get update && apt-get -y install \
|
RUN apt-get update && apt-get -y install \
|
||||||
nodejs \
|
nodejs \
|
||||||
yarn \
|
|
||||||
python2 \
|
python2 \
|
||||||
python3 \
|
python3 \
|
||||||
atomicparsley && \
|
atomicparsley
|
||||||
apt-get autoremove --purge && \
|
|
||||||
apt-get autoremove && \
|
|
||||||
apt-get clean && \
|
|
||||||
rm -rf /var/lib/apt
|
|
||||||
|
|
||||||
RUN npm config set strict-ssl false
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
|
COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ async function unsubscribe(sub, deleteMode, user_uid = null) {
|
|||||||
if (sub.archive && (await fs.pathExists(sub.archive))) {
|
if (sub.archive && (await fs.pathExists(sub.archive))) {
|
||||||
const archive_file_path = path.join(sub.archive, 'archive.txt');
|
const archive_file_path = path.join(sub.archive, 'archive.txt');
|
||||||
// deletes archive if it exists
|
// deletes archive if it exists
|
||||||
// TODO: Keep entries in blacklist_video.txt by moving them to a global blacklist
|
|
||||||
if (await fs.pathExists(archive_file_path)) {
|
if (await fs.pathExists(archive_file_path)) {
|
||||||
await fs.unlink(archive_file_path);
|
await fs.unlink(archive_file_path);
|
||||||
}
|
}
|
||||||
@@ -380,11 +379,7 @@ async function generateArgsForSubscription(sub, user_uid, redownload = false, de
|
|||||||
if (useArchive && !redownload) {
|
if (useArchive && !redownload) {
|
||||||
if (sub.archive) {
|
if (sub.archive) {
|
||||||
archive_dir = sub.archive;
|
archive_dir = sub.archive;
|
||||||
if (sub.type && sub.type === 'audio') {
|
archive_path = path.join(archive_dir, 'archive.txt')
|
||||||
archive_path = path.join(archive_dir, 'merged_audio.txt');
|
|
||||||
} else {
|
|
||||||
archive_path = path.join(archive_dir, 'merged_video.txt');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
downloadConfig.push('--download-archive', archive_path);
|
downloadConfig.push('--download-archive', archive_path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
# and also optimizing some code with this commit.
|
# and also optimizing some code with this commit.
|
||||||
# xoxo :D
|
# xoxo :D
|
||||||
|
|
||||||
|
# set -xeuo pipefail
|
||||||
|
|
||||||
case $(uname -m) in
|
case $(uname -m) in
|
||||||
x86_64)
|
x86_64)
|
||||||
ARCH=amd64;;
|
ARCH=amd64;;
|
||||||
@@ -20,24 +22,15 @@ case $(uname -m) in
|
|||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "(INFO) Architecture detected: $ARCH"
|
echo "Architecture: $ARCH"
|
||||||
echo "(1/5) READY - Acquire temp dependencies in ffmpeg obtain layer"
|
curl --connect-timeout 5 \
|
||||||
apt-get update && apt-get -y install curl xz-utils
|
|
||||||
echo "(2/5) DOWNLOAD - Acquire latest ffmpeg and ffprobe from John van Sickle's master-sourced builds in ffmpeg obtain layer"
|
|
||||||
curl -o ffmpeg.txz \
|
|
||||||
--connect-timeout 5 \
|
|
||||||
--max-time 10 \
|
--max-time 10 \
|
||||||
--retry 5 \
|
--retry 5 \
|
||||||
--retry-delay 0 \
|
--retry-delay 0 \
|
||||||
--retry-max-time 40 \
|
--retry-max-time 40 \
|
||||||
"https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-${ARCH}-static.tar.xz"
|
"https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-${ARCH}-static.tar.xz" -o ffmpeg.txz
|
||||||
mkdir /tmp/ffmpeg
|
mkdir /tmp/ffmpeg
|
||||||
tar xf ffmpeg.txz -C /tmp/ffmpeg
|
tar xf ffmpeg.txz -C /tmp/ffmpeg
|
||||||
echo "(3/5) CLEANUP - Remove temp dependencies from ffmpeg obtain layer"
|
|
||||||
apt-get -y remove curl xz-utils
|
|
||||||
apt-get -y autoremove
|
|
||||||
echo "(4/5) PROVISION - Provide ffmpeg and ffprobe from ffmpeg obtain layer"
|
|
||||||
cp /tmp/ffmpeg/*/ffmpeg /usr/local/bin/ffmpeg
|
cp /tmp/ffmpeg/*/ffmpeg /usr/local/bin/ffmpeg
|
||||||
cp /tmp/ffmpeg/*/ffprobe /usr/local/bin/ffprobe
|
cp /tmp/ffmpeg/*/ffprobe /usr/local/bin/ffprobe
|
||||||
echo "(5/5) CLEANUP - Remove temporary downloads from ffmpeg obtain layer"
|
|
||||||
rm -rf /tmp/ffmpeg ffmpeg.txz
|
rm -rf /tmp/ffmpeg ffmpeg.txz
|
||||||
Reference in New Issue
Block a user