mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-20 09:43:19 +03:00
Removed subscriptions_use_youtubedl_archive setting, to use youtube-dl archive functionality, there is now just one setting for both subscription and non-subscription videos
This commit is contained in:
@@ -2080,7 +2080,6 @@ app.post('/api/getAllFiles', optionalJwt, function (req, res) {
|
|||||||
// loop through subscriptions and add videos
|
// loop through subscriptions and add videos
|
||||||
for (let i = 0; i < subscriptions.length; i++) {
|
for (let i = 0; i < subscriptions.length; i++) {
|
||||||
sub = subscriptions[i];
|
sub = subscriptions[i];
|
||||||
console.log(sub);
|
|
||||||
if (!sub.videos) continue;
|
if (!sub.videos) continue;
|
||||||
// add sub id for UI
|
// add sub id for UI
|
||||||
for (let j = 0; j < sub.videos.length; j++) {
|
for (let j = 0; j < sub.videos.length; j++) {
|
||||||
@@ -2590,7 +2589,7 @@ app.post('/api/downloadFile', optionalJwt, async (req, res) => {
|
|||||||
else
|
else
|
||||||
basePath = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
basePath = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
||||||
|
|
||||||
file = path.join(__dirname, basePath, (subscriptionPlaylist === 'true' ? 'playlists' : 'channels'), subscriptionName, fileNames + ext);
|
file = path.join(__dirname, basePath, (subscriptionPlaylist === true || subscriptionPlaylist === 'true' ? 'playlists' : 'channels'), subscriptionName, fileNames + ext);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < fileNames.length; i++) {
|
for (let i = 0; i < fileNames.length; i++) {
|
||||||
|
|||||||
@@ -37,8 +37,7 @@
|
|||||||
"Subscriptions": {
|
"Subscriptions": {
|
||||||
"allow_subscriptions": true,
|
"allow_subscriptions": true,
|
||||||
"subscriptions_base_path": "subscriptions/",
|
"subscriptions_base_path": "subscriptions/",
|
||||||
"subscriptions_check_interval": "300",
|
"subscriptions_check_interval": "300"
|
||||||
"subscriptions_use_youtubedl_archive": true
|
|
||||||
},
|
},
|
||||||
"Users": {
|
"Users": {
|
||||||
"base_path": "users/",
|
"base_path": "users/",
|
||||||
|
|||||||
@@ -37,8 +37,7 @@
|
|||||||
"Subscriptions": {
|
"Subscriptions": {
|
||||||
"allow_subscriptions": true,
|
"allow_subscriptions": true,
|
||||||
"subscriptions_base_path": "subscriptions/",
|
"subscriptions_base_path": "subscriptions/",
|
||||||
"subscriptions_check_interval": "300",
|
"subscriptions_check_interval": "300"
|
||||||
"subscriptions_use_youtubedl_archive": true
|
|
||||||
},
|
},
|
||||||
"Users": {
|
"Users": {
|
||||||
"base_path": "users/",
|
"base_path": "users/",
|
||||||
|
|||||||
@@ -214,8 +214,7 @@ DEFAULT_CONFIG = {
|
|||||||
"Subscriptions": {
|
"Subscriptions": {
|
||||||
"allow_subscriptions": true,
|
"allow_subscriptions": true,
|
||||||
"subscriptions_base_path": "subscriptions/",
|
"subscriptions_base_path": "subscriptions/",
|
||||||
"subscriptions_check_interval": "300",
|
"subscriptions_check_interval": "300"
|
||||||
"subscriptions_use_youtubedl_archive": true
|
|
||||||
},
|
},
|
||||||
"Users": {
|
"Users": {
|
||||||
"base_path": "users/",
|
"base_path": "users/",
|
||||||
|
|||||||
@@ -116,10 +116,6 @@ let CONFIG_ITEMS = {
|
|||||||
'key': 'ytdl_subscriptions_check_interval',
|
'key': 'ytdl_subscriptions_check_interval',
|
||||||
'path': 'YoutubeDLMaterial.Subscriptions.subscriptions_check_interval'
|
'path': 'YoutubeDLMaterial.Subscriptions.subscriptions_check_interval'
|
||||||
},
|
},
|
||||||
'ytdl_subscriptions_use_youtubedl_archive': {
|
|
||||||
'key': 'ytdl_use_youtubedl_archive',
|
|
||||||
'path': 'YoutubeDLMaterial.Subscriptions.subscriptions_use_youtubedl_archive'
|
|
||||||
},
|
|
||||||
|
|
||||||
// Users
|
// Users
|
||||||
'ytdl_users_base_path': {
|
'ytdl_users_base_path': {
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ async function getSubscriptionInfo(sub, user_uid = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const useArchive = config_api.getConfigItem('ytdl_subscriptions_use_youtubedl_archive');
|
const useArchive = config_api.getConfigItem('ytdl_use_youtubedl_archive');
|
||||||
if (useArchive && !sub.archive) {
|
if (useArchive && !sub.archive) {
|
||||||
// must create the archive
|
// must create the archive
|
||||||
const archive_dir = path.join(__dirname, basePath, 'archives', sub.name);
|
const archive_dir = path.join(__dirname, basePath, 'archives', sub.name);
|
||||||
@@ -197,7 +197,7 @@ async function deleteSubscriptionFile(sub, file, deleteForever, file_uid = null,
|
|||||||
basePath = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
basePath = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
||||||
sub_db = db.get('subscriptions').find({id: sub.id});
|
sub_db = db.get('subscriptions').find({id: sub.id});
|
||||||
}
|
}
|
||||||
const useArchive = config_api.getConfigItem('ytdl_subscriptions_use_youtubedl_archive');
|
const useArchive = config_api.getConfigItem('ytdl_use_youtubedl_archive');
|
||||||
const appendedBasePath = getAppendedBasePath(sub, basePath);
|
const appendedBasePath = getAppendedBasePath(sub, basePath);
|
||||||
const name = file;
|
const name = file;
|
||||||
let retrievedID = null;
|
let retrievedID = null;
|
||||||
@@ -273,7 +273,7 @@ async function getVideosForSub(sub, user_uid = null) {
|
|||||||
else
|
else
|
||||||
basePath = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
basePath = config_api.getConfigItem('ytdl_subscriptions_base_path');
|
||||||
|
|
||||||
const useArchive = config_api.getConfigItem('ytdl_subscriptions_use_youtubedl_archive');
|
const useArchive = config_api.getConfigItem('ytdl_use_youtubedl_archive');
|
||||||
|
|
||||||
let appendedBasePath = null
|
let appendedBasePath = null
|
||||||
appendedBasePath = getAppendedBasePath(sub, basePath);
|
appendedBasePath = getAppendedBasePath(sub, basePath);
|
||||||
|
|||||||
@@ -79,11 +79,6 @@
|
|||||||
<mat-hint><ng-container i18n="Check interval setting input hint">Unit is seconds, only include numbers.</ng-container></mat-hint>
|
<mat-hint><ng-container i18n="Check interval setting input hint">Unit is seconds, only include numbers.</ng-container></mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 mt-4">
|
|
||||||
<mat-checkbox color="accent" [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_use_youtubedl_archive']"><ng-container i18n="Use youtube-dl archive setting">Use youtube-dl archive</ng-container></mat-checkbox>
|
|
||||||
<p><a target="_blank" href="https://github.com/ytdl-org/youtube-dl/blob/master/README.md#how-do-i-download-only-new-videos-from-a-playlist"><ng-container i18n="youtube-dl archive explanation prefix link">With youtube-dl's archive</ng-container></a> <ng-container i18n="youtube-dl archive explanation middle">feature, downloaded videos from your subscriptions get recorded in a text file in the subscriptions archive sub-directory.</ng-container></p>
|
|
||||||
<p><ng-container i18n="youtube-dl archive explanation suffix">This enables the ability to permanently delete videos from your subscriptions without unsubscribing, and allows you to record which videos you downloaded in case of data loss.</ng-container></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
@@ -150,7 +145,6 @@
|
|||||||
|
|
||||||
<div class="col-12 mt-5">
|
<div class="col-12 mt-5">
|
||||||
<mat-checkbox color="accent" [(ngModel)]="new_config['Downloader']['use_youtubedl_archive']"><ng-container i18n="Use youtubedl archive setting">Use youtube-dl archive</ng-container></mat-checkbox>
|
<mat-checkbox color="accent" [(ngModel)]="new_config['Downloader']['use_youtubedl_archive']"><ng-container i18n="Use youtubedl archive setting">Use youtube-dl archive</ng-container></mat-checkbox>
|
||||||
<p><ng-container i18n="youtubedl archive setting Note">Note: This setting only applies to downloads on the Home page. If you would like to use youtube-dl archive functionality in subscriptions, head to the Main tab and activate this option there.</ng-container></p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 mt-2">
|
<div class="col-12 mt-2">
|
||||||
|
|||||||
@@ -59,11 +59,6 @@ export class SubscriptionComponent implements OnInit {
|
|||||||
this.getSubscription();
|
this.getSubscription();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.initialized) {
|
|
||||||
this.getConfig();
|
|
||||||
this.getSubscription();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if (this.route.snapshot.paramMap.get('id')) {
|
if (this.route.snapshot.paramMap.get('id')) {
|
||||||
this.id = this.route.snapshot.paramMap.get('id');
|
this.id = this.route.snapshot.paramMap.get('id');
|
||||||
@@ -101,7 +96,7 @@ export class SubscriptionComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getConfig() {
|
getConfig() {
|
||||||
this.use_youtubedl_archive = this.postsService.config['Subscriptions']['subscriptions_use_youtubedl_archive'];
|
this.use_youtubedl_archive = this.postsService.config['Downloader']['use_youtubedl_archive'];
|
||||||
}
|
}
|
||||||
|
|
||||||
goToFile(emit_obj) {
|
goToFile(emit_obj) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"Downloader": {
|
"Downloader": {
|
||||||
"path-audio": "audio/",
|
"path-audio": "audio/",
|
||||||
"path-video": "video/",
|
"path-video": "video/",
|
||||||
"use_youtubedl_archive": false,
|
"use_youtubedl_archive": true,
|
||||||
"custom_args": "",
|
"custom_args": "",
|
||||||
"safe_download_override": false
|
"safe_download_override": false
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user