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

Angular 17 #1037

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d02d100
Force ngx-avatars to use angular 16
Tzahi12345 Dec 1, 2023
d10401c
Force update ngx-avatars
Tzahi12345 Dec 1, 2023
caadf4f
Temporarily removed ngx-avatars
Tzahi12345 Dec 2, 2023
c3c8f50
Updated to Angular 16
Tzahi12345 Dec 2, 2023
69d8751
Updated Angular Material to v16
Tzahi12345 Dec 2, 2023
517c9e1
Updated to Angular 17
Tzahi12345 Dec 2, 2023
f57e0ab
Updated Angular Material to v17
Tzahi12345 Dec 2, 2023
7cf5d86
Updated styles.scss to match new Angular syntax
Tzahi12345 Dec 2, 2023
6152df3
Added missing saveAs imports
Tzahi12345 Dec 2, 2023
25e4c11
Updated templates to new Angular control flow
Tzahi12345 Dec 2, 2023
2c155b7
Updates version info/requirements in README
Tzahi12345 Dec 2, 2023
4a97fa4
Updates node version in CI
Tzahi12345 Dec 2, 2023
9556f9c
Updated docker frontend build node version to 18
Tzahi12345 Dec 3, 2023
84464db
Frontend dev environment now uses non-prod mode by default
Tzahi12345 Dec 3, 2023
3912655
Merge branch 'master' of https://github.com/Tzahi12345/YoutubeDL-Mate…
Tzahi12345 Dec 4, 2023
9b38c56
Reverted using production as defaultConfiguration in angular.json
Tzahi12345 Dec 6, 2023
2cf2154
Merge branch 'master' of https://github.com/Tzahi12345/YoutubeDL-Mate…
Tzahi12345 Dec 7, 2023
dcb5369
mocha is now a backend dev dependency
Tzahi12345 Dec 9, 2023
f96ffab
Install pm2 without npm
Tzahi12345 Dec 9, 2023
eb8cd3f
Remove curl install from pm2
Tzahi12345 Dec 9, 2023
1bf348f
Cleaned up pm2 installcommand
Tzahi12345 Dec 9, 2023
026f24a
Updated npm version in Dockerfile
Tzahi12345 Dec 9, 2023
b4cf1e3
Removed version from docker npm install
Tzahi12345 Dec 16, 2023
fb92975
Updated docker Ubuntu to 24.04
Tzahi12345 Dec 16, 2023
7ac6a50
Updated UID/GID to 1001
Tzahi12345 Dec 16, 2023
4258b82
Removed libicu70
Tzahi12345 Dec 16, 2023
72399b0
Removed libicu70 from fetch-twitch-downloader
Tzahi12345 Dec 16, 2023
c56987d
Downgraded ubuntu to 23.04
Tzahi12345 Dec 16, 2023
25bf7a6
Trying removal of python
Tzahi12345 Dec 16, 2023
e2e3dd2
Added back python and added flag to pip to force install pycryptodomex
Tzahi12345 Dec 16, 2023
6a7c1c9
Set docker npm install timeout to 60s
Tzahi12345 Dec 17, 2023
7d3458e
Testing using npm registry mirror
Tzahi12345 Dec 17, 2023
a74bca0
Improved download fail backup method
Tzahi12345 Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
cache: 'npm'
- name: install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
node:
- 16
- 18
steps:
- uses: actions/setup-node@v3
with:
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: FedericoCarboni/setup-ffmpeg@v2
id: setup-ffmpeg
- name: Install Dependencies
run: npm install
run: npm install --dev
working-directory: ./backend
- name: Run All Node.js Tests
run: npm run test
Expand Down
27 changes: 15 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Fetching our utils
FROM ubuntu:22.04 AS utils
FROM ubuntu:23.04 AS utils
ENV DEBIAN_FRONTEND=noninteractive
# Use script due local build compability
COPY docker-utils/*.sh .
Expand All @@ -8,24 +8,23 @@ RUN sh ./ffmpeg-fetch.sh
RUN sh ./fetch-twitchdownloader.sh


# Create our Ubuntu 22.04 with node 16.14.2 (that specific version is required as per: https://stackoverflow.com/a/72855258/8088021)
# Go to 20.04
FROM ubuntu:22.04 AS base
# Create our Ubuntu 22.04 with node 18.19.0
FROM ubuntu:23.04 AS base
ARG TARGETPLATFORM
ARG DEBIAN_FRONTEND=noninteractive
ENV UID=1000
ENV GID=1000
ENV UID=1001
ENV GID=1001
ENV USER=youtube
ENV NO_UPDATE_NOTIFIER=true
ENV PM2_HOME=/app/pm2
ENV ALLOW_CONFIG_MUTATIONS=true
ENV npm_config_cache=/app/.npm

# Use NVM to get specific node version
ENV NODE_VERSION=16.14.2
ENV NODE_VERSION=18.19.0
RUN groupadd -g $GID $USER && useradd --system -m -g $USER --uid $UID $USER && \
apt update && \
apt install -y --no-install-recommends curl ca-certificates tzdata libicu70 libatomic1 && \
apt install -y --no-install-recommends curl ca-certificates tzdata libatomic1 && \
apt clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -37,9 +36,11 @@ RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}

RUN npm install -g npm

# Build frontend
ARG BUILDPLATFORM
FROM --platform=${BUILDPLATFORM} node:16 as frontend
FROM --platform=${BUILDPLATFORM} node:18 as frontend
RUN npm install -g @angular/cli
WORKDIR /build
COPY [ "package.json", "package-lock.json", "angular.json", "tsconfig.json", "/build/" ]
Expand All @@ -56,6 +57,8 @@ FROM base as backend
WORKDIR /app
COPY [ "backend/","/app/" ]
RUN npm config set strict-ssl false && \
npm config set registry https://registry.npm.taobao.org && \
npm config set fetch-retry-maxtimeout 60000 && \
npm install --prod && \
ls -al

Expand All @@ -72,10 +75,10 @@ RUN npm config set strict-ssl false && \

# Final image
FROM base
RUN npm install -g pm2 && \
apt update && \
RUN apt update && \
curl -sL https://raw.githubusercontent.com/Unitech/pm2/master/packager/setup.deb.sh | bash && \
apt install -y --no-install-recommends gosu python3-minimal python-is-python3 python3-pip atomicparsley build-essential && \
pip install pycryptodomex && \
pip install pycryptodomex --break-system-packages && \
apt remove -y --purge build-essential && \
apt autoremove -y --purge && \
apt clean && \
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![GitHub issues badge](https://img.shields.io/github/issues/Tzahi12345/YoutubeDL-Material)](https://github.com/Tzahi12345/YoutubeDL-Material/issues)
[![License badge](https://img.shields.io/github/license/Tzahi12345/YoutubeDL-Material)](https://github.com/Tzahi12345/YoutubeDL-Material/blob/master/LICENSE.md)

YoutubeDL-Material is a Material Design frontend for [youtube-dl](https://rg3.github.io/youtube-dl/). It's coded using [Angular 15](https://angular.io/) for the frontend, and [Node.js](https://nodejs.org/) on the backend.
YoutubeDL-Material is a Material Design frontend for [youtube-dl](https://rg3.github.io/youtube-dl/). It's coded using [Angular 17](https://angular.io/) for the frontend, and [Node.js](https://nodejs.org/) on the backend.

Now with [Docker](#Docker) support!

Expand All @@ -30,7 +30,7 @@ NOTE: If you would like to use Docker, you can skip down to the [Docker](#Docker

Required dependencies:

* Node.js 16
* Node.js 18
* Python

Optional dependencies:
Expand All @@ -42,7 +42,7 @@ Optional dependencies:
<summary>Debian/Ubuntu</summary>

```bash
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install nodejs youtube-dl ffmpeg unzip python npm
```

Expand All @@ -57,7 +57,7 @@ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfu
sudo yum install centos-release-scl-rh
sudo yum install rh-nodejs12
scl enable rh-nodejs12 bash
curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
sudo yum install nodejs youtube-dl ffmpeg ffmpeg-devel
```

Expand Down
10 changes: 5 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "youtube-dl-material:build"
"buildTarget": "youtube-dl-material:build"
},
"configurations": {
"production": {
"browserTarget": "youtube-dl-material:build:production"
"buildTarget": "youtube-dl-material:build:production"
},
"es": {
"browserTarget": "youtube-dl-material:build:es"
"buildTarget": "youtube-dl-material:build:es"
},
"codespaces": {
"browserTarget": "youtube-dl-material:build:codespaces"
"buildTarget": "youtube-dl-material:build:codespaces"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "youtube-dl-material:build"
"buildTarget": "youtube-dl-material:build"
}
},
"serve-electron": {
Expand Down
6 changes: 4 additions & 2 deletions backend/downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@ exports.generateArgs = async (url, type, options, user_uid = null, simulated = f
downloadConfig.push('--write-thumbnail');
}

downloadConfig.push('-i');

if (globalArgs && globalArgs !== '') {
// adds global args
if (downloadConfig.indexOf('-o') !== -1 && globalArgs.split(',,').indexOf('-o') !== -1) {
Expand Down Expand Up @@ -571,8 +573,8 @@ exports.getVideoInfoByURL = async (url, args = [], download_uid = null) => {
let {callback} = await youtubedl_api.runYoutubeDL(url, new_args);
const {parsed_output, err} = await callback;
if (!parsed_output || parsed_output.length === 0) {
let error_message = `Error while retrieving info on video with URL ${url} with the following message: ${err}`;
if (err.stderr) error_message += `\n\n${err.stderr}`;
let error_message = `Error while retrieving info on video with URL ${url}`;
if (err.stderr) error_message += ` with the following message: \n${err.stderr}`;
logger.error(error_message);
if (download_uid) {
await handleDownloadError(download_uid, error_message, 'info_retrieve_failed');
Expand Down
Loading
Loading