minor fixes to not export default format

This commit is contained in:
ArabCoders 2025-03-14 23:06:09 +03:00
parent fc696b6afa
commit 83152f0e00
3 changed files with 18 additions and 19 deletions

View file

@ -129,7 +129,7 @@ class YTDLPOpts(metaclass=Singleton):
self.presets_opts = {}
self._item_opts = {}
if "format" in data and "not_set" == data["format"]:
if "format" in data and data["format"] in ["not_set", "default"]:
data["format"] = None
return data

View file

@ -113,8 +113,7 @@
<span>The yt-dlp <code>[--format, -f]</code> video format code. see <NuxtLink
href="https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#format-selection" target="blank">this
url</NuxtLink> for more info.</span>. Note, as this key is required, you can set the value to
<code>not_set</code>
to use the default yt-dlp format.
<code>default</code> to let <code>yt-dlp</code> choose the best format.
</span>
</div>
</div>
@ -223,19 +222,19 @@
<div class="card-footer">
<div class="card-footer-item">
<button class="button is-fullwidth is-primary" :disabled="addInProgress" type="submit"
:class="{ 'is-loading': addInProgress }" form="presetForm">
<span class="icon"><i class="fa-solid fa-save" /></span>
<span>Save</span>
</button>
</div>
<div class="card-footer-item">
<button class="button is-fullwidth is-danger" @click="emitter('cancel')" :disabled="addInProgress"
type="button">
<span class="icon"><i class="fa-solid fa-times" /></span>
<span>Cancel</span>
</button>
</div>
<button class="button is-fullwidth is-primary" :disabled="addInProgress" type="submit"
:class="{ 'is-loading': addInProgress }" form="presetForm">
<span class="icon"><i class="fa-solid fa-save" /></span>
<span>Save</span>
</button>
</div>
<div class="card-footer-item">
<button class="button is-fullwidth is-danger" @click="emitter('cancel')" :disabled="addInProgress"
type="button">
<span class="icon"><i class="fa-solid fa-times" /></span>
<span>Cancel</span>
</button>
</div>
</div>
</div>
</form>

View file

@ -386,8 +386,8 @@ const exportItem = async item => {
args[key] = preset.args[key]
}
}
if (preset.format !== 'not_set' && preset.format) {
const defaults = ['default', 'not_set']
if (preset.format && !defaults.includes(info.format)) {
args.format = preset.format
}
@ -421,7 +421,7 @@ const exportItem = async item => {
}
data['_type'] = 'task'
data['_version'] = '1.0'
data['_version'] = '1.1'
return copyText(base64UrlEncode(JSON.stringify(data)));
}