mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-10 18:11:27 +03:00
Fixed issue where setting resolution in a sub would instead require that resolution to exist (#678 and #330)
This commit is contained in:
@@ -403,6 +403,8 @@ exports.generateArgs = async (url, type, options, user_uid = null, simulated = f
|
|||||||
|
|
||||||
// video-specific args
|
// video-specific args
|
||||||
const selectedHeight = options.selectedHeight;
|
const selectedHeight = options.selectedHeight;
|
||||||
|
const maxHeight = options.maxHeight;
|
||||||
|
const heightParam = selectedHeight || maxHeight;
|
||||||
|
|
||||||
// audio-specific args
|
// audio-specific args
|
||||||
const maxBitrate = options.maxBitrate;
|
const maxBitrate = options.maxBitrate;
|
||||||
@@ -423,8 +425,8 @@ exports.generateArgs = async (url, type, options, user_uid = null, simulated = f
|
|||||||
} else {
|
} else {
|
||||||
if (customQualityConfiguration) {
|
if (customQualityConfiguration) {
|
||||||
qualityPath = ['-f', customQualityConfiguration, '--merge-output-format', 'mp4'];
|
qualityPath = ['-f', customQualityConfiguration, '--merge-output-format', 'mp4'];
|
||||||
} else if (selectedHeight && selectedHeight !== '' && !is_audio) {
|
} else if (heightParam && heightParam !== '' && !is_audio) {
|
||||||
qualityPath = ['-f', `'(mp4)[height=${selectedHeight}]`];
|
qualityPath = ['-f', `'(mp4)[height${maxHeight ? '<' : ''}=${heightParam}]`];
|
||||||
} else if (is_audio) {
|
} else if (is_audio) {
|
||||||
qualityPath = ['--audio-quality', maxBitrate ? maxBitrate : '0']
|
qualityPath = ['--audio-quality', maxBitrate ? maxBitrate : '0']
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ function generateOptionsForSubscriptionDownload(sub, user_uid) {
|
|||||||
let default_output = config_api.getConfigItem('ytdl_default_file_output') ? config_api.getConfigItem('ytdl_default_file_output') : '%(title)s';
|
let default_output = config_api.getConfigItem('ytdl_default_file_output') ? config_api.getConfigItem('ytdl_default_file_output') : '%(title)s';
|
||||||
|
|
||||||
const base_download_options = {
|
const base_download_options = {
|
||||||
selectedHeight: sub.maxQuality && sub.maxQuality !== 'best' ? sub.maxQuality : null,
|
maxHeight: sub.maxQuality && sub.maxQuality !== 'best' ? sub.maxQuality : null,
|
||||||
customFileFolderPath: getAppendedBasePath(sub, basePath),
|
customFileFolderPath: getAppendedBasePath(sub, basePath),
|
||||||
customOutput: sub.custom_output ? `${sub.custom_output}` : `${default_output}`,
|
customOutput: sub.custom_output ? `${sub.custom_output}` : `${default_output}`,
|
||||||
customArchivePath: path.join(basePath, 'archives', sub.name),
|
customArchivePath: path.join(basePath, 'archives', sub.name),
|
||||||
|
|||||||
Reference in New Issue
Block a user