mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-26 06:30:58 +03:00
Compare commits
9 Commits
angular-13
...
GlassedSil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa8f602856 | ||
|
|
21507ee36d | ||
|
|
0585943d67 | ||
|
|
0bc2193f25 | ||
|
|
f3398fce1a | ||
|
|
d94857b0a5 | ||
|
|
5fda56d7af | ||
|
|
abb80b33f3 | ||
|
|
9977340161 |
@@ -16,7 +16,7 @@ paths:
|
|||||||
- downloader
|
- downloader
|
||||||
summary: Download video file
|
summary: Download video file
|
||||||
description: |-
|
description: |-
|
||||||
Downloads a video file with the given URL. Will include global args if they exist.
|
Downloads a file with the given URL. Will include global args if they exist.
|
||||||
|
|
||||||
|
|
||||||
HTTP requests will return once the video file download completes. In the future, it will (by default) return once the download starts, and a separate API call will be used for checking the download status.
|
HTTP requests will return once the video file download completes. In the future, it will (by default) return once the download starts, and a separate API call will be used for checking the download status.
|
||||||
@@ -41,7 +41,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- downloader
|
- downloader
|
||||||
summary: Download video file
|
summary: Generates arguments used to download file
|
||||||
description: Generates args, used for checking what args would run if you ran downloadFile
|
description: Generates args, used for checking what args would run if you ran downloadFile
|
||||||
operationId: post-generateArgs
|
operationId: post-generateArgs
|
||||||
requestBody:
|
requestBody:
|
||||||
|
|||||||
21
SECURITY.md
Normal file
21
SECURITY.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Currently all work on this project goes into the nightly builds.
|
||||||
|
4.2's RELEASE build is now quite old and should be considered legacy.
|
||||||
|
We urge users to use the nightly releases, because the project
|
||||||
|
constantly sees fixes.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------------- | ------------------ |
|
||||||
|
| 4.2 Nightlies | :white_check_mark: |
|
||||||
|
| 4.2 Release | :x: |
|
||||||
|
| < 4.2 | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Please file an issue in our GitHub's repo, because this app
|
||||||
|
isn't meant to be safe to run as public instance yet, but rather as a LAN facing app.
|
||||||
|
|
||||||
|
We welcome PRs and help in general in making YTDL-M more secure, but it's not a priority as of now.
|
||||||
@@ -803,7 +803,7 @@ app.post('/api/testConnectionString', optionalJwt, async (req, res) => {
|
|||||||
app.post('/api/downloadFile', optionalJwt, async function(req, res) {
|
app.post('/api/downloadFile', optionalJwt, async function(req, res) {
|
||||||
req.setTimeout(0); // remove timeout in case of long videos
|
req.setTimeout(0); // remove timeout in case of long videos
|
||||||
const url = req.body.url;
|
const url = req.body.url;
|
||||||
const type = req.body.type;
|
const type = req.body.type ? req.body.type : 'video';
|
||||||
const user_uid = req.isAuthenticated() ? req.user.uid : null;
|
const user_uid = req.isAuthenticated() ? req.user.uid : null;
|
||||||
const options = {
|
const options = {
|
||||||
customArgs: req.body.customArgs,
|
customArgs: req.body.customArgs,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ const { uuid } = require('uuidv4');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const mergeFiles = require('merge-files');
|
const mergeFiles = require('merge-files');
|
||||||
const NodeID3 = require('node-id3')
|
const NodeID3 = require('node-id3')
|
||||||
const glob = require('glob')
|
|
||||||
const Mutex = require('async-mutex').Mutex;
|
const Mutex = require('async-mutex').Mutex;
|
||||||
|
|
||||||
const youtubedl = require('youtube-dl');
|
const youtubedl = require('youtube-dl');
|
||||||
@@ -583,20 +582,26 @@ async function checkDownloadPercent(download_uid) {
|
|||||||
if (!resulting_file_size) return;
|
if (!resulting_file_size) return;
|
||||||
|
|
||||||
let sum_size = 0;
|
let sum_size = 0;
|
||||||
glob(`{${files_to_check_for_progress.join(',')}, }*`, async (err, files) => {
|
for (let i = 0; i < files_to_check_for_progress.length; i++) {
|
||||||
files.forEach(async file => {
|
const file_to_check_for_progress = files_to_check_for_progress[i];
|
||||||
try {
|
const dir = path.dirname(file_to_check_for_progress);
|
||||||
const file_stats = fs.statSync(file);
|
if (!fs.existsSync(dir)) continue;
|
||||||
if (file_stats && file_stats.size) {
|
fs.readdir(dir, async (err, files) => {
|
||||||
sum_size += file_stats.size;
|
for (let j = 0; j < files.length; j++) {
|
||||||
}
|
const file = files[j];
|
||||||
} catch (e) {
|
if (!file.includes(path.basename(file_to_check_for_progress))) continue;
|
||||||
|
try {
|
||||||
|
const file_stats = fs.statSync(path.join(dir, file));
|
||||||
|
if (file_stats && file_stats.size) {
|
||||||
|
sum_size += file_stats.size;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const percent_complete = (sum_size/resulting_file_size * 100).toFixed(2);
|
||||||
|
await db_api.updateRecord('download_queue', {uid: download_uid}, {percent_complete: percent_complete});
|
||||||
});
|
});
|
||||||
const percent_complete = (sum_size/resulting_file_size * 100).toFixed(2);
|
}
|
||||||
await db_api.updateRecord('download_queue', {uid: download_uid}, {percent_complete: percent_complete});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.generateNFOFile = (info, output_path) => {
|
exports.generateNFOFile = (info, output_path) => {
|
||||||
|
|||||||
6
backend/package-lock.json
generated
6
backend/package-lock.json
generated
@@ -2567,9 +2567,9 @@
|
|||||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
||||||
},
|
},
|
||||||
"passport": {
|
"passport": {
|
||||||
"version": "0.5.2",
|
"version": "0.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/passport/-/passport-0.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/passport/-/passport-0.4.1.tgz",
|
||||||
"integrity": "sha512-w9n/Ot5I7orGD4y+7V3EFJCQEznE5RxHamUxcqLT2QoJY0f2JdN8GyHonYFvN0Vz+L6lUJfVhrk2aZz2LbuREw==",
|
"integrity": "sha512-IxXgZZs8d7uFSt3eqNjM9NQ3g3uQCW5avD8mRNoXV99Yig50vjuaez6dQK2qC0kVWPRTujxY0dWgGfT09adjYg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"passport-strategy": "1.x.x",
|
"passport-strategy": "1.x.x",
|
||||||
"pause": "0.0.1"
|
"pause": "0.0.1"
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"express": "^4.17.3",
|
"express": "^4.17.3",
|
||||||
"fluent-ffmpeg": "^2.1.2",
|
"fluent-ffmpeg": "^2.1.2",
|
||||||
"fs-extra": "^9.0.0",
|
"fs-extra": "^9.0.0",
|
||||||
"glob": "^7.1.6",
|
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lowdb": "^1.0.0",
|
"lowdb": "^1.0.0",
|
||||||
"md5": "^2.2.1",
|
"md5": "^2.2.1",
|
||||||
@@ -53,7 +52,7 @@
|
|||||||
"node-id3": "^0.1.14",
|
"node-id3": "^0.1.14",
|
||||||
"node-schedule": "^2.1.0",
|
"node-schedule": "^2.1.0",
|
||||||
"nodemon": "^2.0.7",
|
"nodemon": "^2.0.7",
|
||||||
"passport": "^0.5.2",
|
"passport": "^0.4.1",
|
||||||
"passport-http": "^0.3.0",
|
"passport-http": "^0.3.0",
|
||||||
"passport-jwt": "^4.0.0",
|
"passport-jwt": "^4.0.0",
|
||||||
"passport-ldapauth": "^3.0.1",
|
"passport-ldapauth": "^3.0.1",
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ function scheduleJob(task_key, schedule) {
|
|||||||
if (schedule['type'] === 'timestamp') {
|
if (schedule['type'] === 'timestamp') {
|
||||||
converted_schedule = new Date(schedule['data']['timestamp']);
|
converted_schedule = new Date(schedule['data']['timestamp']);
|
||||||
} else if (schedule['type'] === 'recurring') {
|
} else if (schedule['type'] === 'recurring') {
|
||||||
const dayOfWeek = schedule['data']['dayOfWeek'] ? schedule['data']['dayOfWeek'] : null;
|
const dayOfWeek = schedule['data']['dayOfWeek'] != null ? schedule['data']['dayOfWeek'] : null;
|
||||||
const hour = schedule['data']['hour'] ? schedule['data']['hour'] : null;
|
const hour = schedule['data']['hour'] != null ? schedule['data']['hour'] : null;
|
||||||
const minute = schedule['data']['minute'] ? schedule['data']['minute'] : null;
|
const minute = schedule['data']['minute'] != null ? schedule['data']['minute'] : null;
|
||||||
converted_schedule = new scheduler.RecurrenceRule(null, null, null, dayOfWeek, hour, minute);
|
converted_schedule = new scheduler.RecurrenceRule(null, null, null, dayOfWeek, hour, minute);
|
||||||
} else {
|
} else {
|
||||||
logger.error(`Failed to schedule job '${task_key}' as the type '${schedule['type']}' is invalid.`)
|
logger.error(`Failed to schedule job '${task_key}' as the type '${schedule['type']}' is invalid.`)
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -3367,9 +3367,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"async": {
|
"async": {
|
||||||
"version": "2.6.4",
|
"version": "2.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
|
||||||
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"lodash": "^4.17.14"
|
"lodash": "^4.17.14"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||||
import { Schedule } from 'api-types';
|
import { Schedule, Task } from 'api-types';
|
||||||
import { PostsService } from 'app/posts.services';
|
import { PostsService } from 'app/posts.services';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -18,7 +18,7 @@ export class UpdateTaskScheduleDialogComponent implements OnInit {
|
|||||||
date = null;
|
date = null;
|
||||||
today = new Date();
|
today = new Date();
|
||||||
|
|
||||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<UpdateTaskScheduleDialogComponent>, private postsService: PostsService) {
|
constructor(@Inject(MAT_DIALOG_DATA) public data: {task: Task}, private dialogRef: MatDialogRef<UpdateTaskScheduleDialogComponent>, private postsService: PostsService) {
|
||||||
this.processTask(this.data.task);
|
this.processTask(this.data.task);
|
||||||
this.postsService.getTask(this.data.task.key).subscribe(res => {
|
this.postsService.getTask(this.data.task.key).subscribe(res => {
|
||||||
this.processTask(res['task']);
|
this.processTask(res['task']);
|
||||||
@@ -28,7 +28,7 @@ export class UpdateTaskScheduleDialogComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
processTask(task) {
|
processTask(task: Task): void {
|
||||||
if (!task['schedule']) {
|
if (!task['schedule']) {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
return;
|
return;
|
||||||
@@ -39,7 +39,11 @@ export class UpdateTaskScheduleDialogComponent implements OnInit {
|
|||||||
this.recurring = schedule['type'] === Schedule.type.RECURRING;
|
this.recurring = schedule['type'] === Schedule.type.RECURRING;
|
||||||
|
|
||||||
if (this.recurring) {
|
if (this.recurring) {
|
||||||
this.time = `${schedule['data']['hour']}:${schedule['data']['minute']}`;
|
const hour = schedule['data']['hour'];
|
||||||
|
const minute = schedule['data']['minute'];
|
||||||
|
|
||||||
|
// add padding 0s if necessary to hours and minutes
|
||||||
|
this.time = (hour < 10 ? '0' : '') + hour + ':' + (minute < 10 ? '0' : '') + minute;
|
||||||
|
|
||||||
if (schedule['data']['dayOfWeek']) {
|
if (schedule['data']['dayOfWeek']) {
|
||||||
this.days_of_week = schedule['data']['dayOfWeek'];
|
this.days_of_week = schedule['data']['dayOfWeek'];
|
||||||
@@ -75,7 +79,6 @@ export class UpdateTaskScheduleDialogComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.date.setHours(hours, minutes);
|
this.date.setHours(hours, minutes);
|
||||||
console.log(this.date);
|
|
||||||
schedule['data'] = {timestamp: this.date.getTime()};
|
schedule['data'] = {timestamp: this.date.getTime()};
|
||||||
}
|
}
|
||||||
this.dialogRef.close(schedule);
|
this.dialogRef.close(schedule);
|
||||||
|
|||||||
Reference in New Issue
Block a user