diff --git a/backend/app.js b/backend/app.js index ed32f1d..e4dfdc1 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1893,8 +1893,11 @@ app.post('/api/tomp3', optionalJwt, async function(req, res) { user: req.isAuthenticated() ? req.user.uid : null } + const safeDownloadOverride = config_api.getConfigItem('ytdl_safe_download_override'); const is_playlist = url.includes('playlist'); - if (is_playlist || options.customQualityConfiguration || options.customArgs || options.maxBitrate) + + let result_obj = null; + if (safeDownloadOverride || is_playlist || options.customQualityConfiguration || options.customArgs || options.maxBitrate) result_obj = await downloadFileByURL_exec(url, 'audio', options, req.query.sessionID); else result_obj = await downloadFileByURL_normal(url, 'audio', options, req.query.sessionID); @@ -1920,9 +1923,11 @@ app.post('/api/tomp4', optionalJwt, async function(req, res) { user: req.isAuthenticated() ? req.user.uid : null } + const safeDownloadOverride = config_api.getConfigItem('ytdl_safe_download_override'); const is_playlist = url.includes('playlist'); + let result_obj = null; - if (is_playlist || options.customQualityConfiguration || options.customArgs || options.selectedHeight || !url.includes('youtu')) + if (safeDownloadOverride || is_playlist || options.customQualityConfiguration || options.customArgs || options.selectedHeight || !url.includes('youtu')) result_obj = await downloadFileByURL_exec(url, 'video', options, req.query.sessionID); else result_obj = await downloadFileByURL_normal(url, 'video', options, req.query.sessionID); diff --git a/backend/appdata/default.json b/backend/appdata/default.json index c124548..058cc77 100644 --- a/backend/appdata/default.json +++ b/backend/appdata/default.json @@ -13,7 +13,8 @@ "path-audio": "audio/", "path-video": "video/", "use_youtubedl_archive": false, - "custom_args": "" + "custom_args": "", + "safe_download_override": false }, "Extra": { "title_top": "YoutubeDL-Material", diff --git a/backend/appdata/encrypted.json b/backend/appdata/encrypted.json index 10b49aa..c884b2a 100644 --- a/backend/appdata/encrypted.json +++ b/backend/appdata/encrypted.json @@ -13,7 +13,8 @@ "path-audio": "audio/", "path-video": "video/", "use_youtubedl_archive": false, - "custom_args": "" + "custom_args": "", + "safe_download_override": false }, "Extra": { "title_top": "YoutubeDL-Material", diff --git a/backend/config.js b/backend/config.js index 35d4033..6f29cb8 100644 --- a/backend/config.js +++ b/backend/config.js @@ -182,7 +182,8 @@ DEFAULT_CONFIG = { "path-audio": "audio/", "path-video": "video/", "use_youtubedl_archive": false, - "custom_args": "" + "custom_args": "", + "safe_download_override": false }, "Extra": { "title_top": "YoutubeDL-Material", diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index a61ad3c..7c665c9 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -152,6 +152,10 @@ Use youtube-dl archive

Note: This setting only applies to downloads on the Home page. If you would like to use youtube-dl archive functionality in subscriptions, head down to the Subscriptions section.

+ +
+ Safe download override +
diff --git a/src/assets/default.json b/src/assets/default.json index 329f192..ed29d2d 100644 --- a/src/assets/default.json +++ b/src/assets/default.json @@ -13,7 +13,8 @@ "path-audio": "audio/", "path-video": "video/", "use_youtubedl_archive": false, - "custom_args": "" + "custom_args": "", + "safe_download_override": false }, "Extra": { "title_top": "YoutubeDL-Material", @@ -37,7 +38,7 @@ "Subscriptions": { "allow_subscriptions": true, "subscriptions_base_path": "subscriptions/", - "subscriptions_check_interval": "300", + "subscriptions_check_interval": "30", "subscriptions_use_youtubedl_archive": true }, "Users": { @@ -49,7 +50,8 @@ "custom_downloading_agent": "", "multi_user_mode": true, "allow_advanced_download": true, - "logger_level": "debug" + "logger_level": "debug", + "use_cookies": true } } } \ No newline at end of file