From 7551aa1fd45e5125a95fdd5bc6bba926304a0338 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Sat, 9 Aug 2025 18:32:51 +0300 Subject: [PATCH] minor history fix --- .vscode/settings.json | 4 +++- FAQ.md | 12 +++++++++++- ui/app/components/History.vue | 24 +++++++++++++++++------- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 07a04ce6..9315ac71 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,6 +20,7 @@ "attl", "autonumber", "bgutil", + "bgutilhttp", "brainicism", "brotlicffi", "consoletitle", @@ -113,7 +114,8 @@ "vconvert", "writedescription", "xerror", - "youtu" + "youtu", + "youtubepot" ], "css.styleSheets": [ "ui/app/assets/css/*.css" diff --git a/FAQ.md b/FAQ.md index e7dbade4..bc8776c1 100644 --- a/FAQ.md +++ b/FAQ.md @@ -83,7 +83,17 @@ services: Then simply create a new preset, and in the `Command options for yt-dlp` field set the following: ```bash ---extractor-args "youtubepot-bgutilhttp:base_url=http://bgutil_provider:4416;disable_innertube=1" +--extractor-args "youtubepot-bgutilhttp:base_url=http://bgutil_provider:4416" --extractor-args "youtube:player-client=default,tv,mweb;formats=incomplete" ``` + +you and also enable the fallback by using the follow extractor args + +```bash +--extractor-args "youtubepot-bgutilhttp:base_url=http://bgutil_provider:4416;disable_innertube=1" +--extractor-args "youtube:player-client=default,tv,mweb;formats=incomplete" +``` + +Use this settings in case the extractor fails to get the pot tokens from the bgutil provider server. + For more information please visit [bgutil-ytdlp-pot-provider](https://github.com/Brainicism/bgutil-ytdlp-pot-provider) project. diff --git a/ui/app/components/History.vue b/ui/app/components/History.vue index 9489f9c3..73e056fb 100644 --- a/ui/app/components/History.vue +++ b/ui/app/components/History.vue @@ -508,9 +508,7 @@ const dialog_confirm = ref<{ title: 'Confirm Action', confirm: () => { }, message: '', - options: [ - { key: 'remove_history', label: 'Also, Remove from history.' }, - ], + options: [], }) const showThumbnails = computed(() => (props.thumbnails || true) && !hideThumbnail.value) @@ -735,6 +733,7 @@ const addArchiveDialog = (item: StoreItem) => { dialog_confirm.value.visible = true dialog_confirm.value.title = 'Archive Item' dialog_confirm.value.message = `Archive '${item.title || item.id || item.url || '??'}'?` + dialog_confirm.value.options = [{ key: 'remove_history', label: 'Also, Remove from history.' }] dialog_confirm.value.confirm = (opts: any) => archiveItem(item, opts) } @@ -864,10 +863,15 @@ const removeFromArchiveDialog = (item: StoreItem) => { dialog_confirm.value.visible = true dialog_confirm.value.title = 'Remove from Archive' dialog_confirm.value.message = `Remove '${item.title || item.id || item.url || '??'}' from archive?` - dialog_confirm.value.confirm = () => removeFromArchive(item) + dialog_confirm.value.options = [ + { key: 'remove_history', label: 'Also, Remove from history.' }, + { key: 're_add', label: 'Re-add to download form.' }, + ] + dialog_confirm.value.confirm = (opts: any) => removeFromArchive(item, opts) } -const removeFromArchive = async (item: StoreItem, opts?: { remove_history?: boolean }) => { +const removeFromArchive = async (item: StoreItem, opts?: { re_add?: boolean, remove_history?: boolean }) => { + console.log('Removing from archive:', item, opts) try { const req = await request(`/api/archive/${item._id}`, { credentials: 'include', @@ -876,15 +880,21 @@ const removeFromArchive = async (item: StoreItem, opts?: { remove_history?: bool const data = await req.json() if (!req.ok) { toast.error(data.error) - return + } else { + toast.success(data.message || `Removed '${item.title || item.id || item.url || '??'}' from archive.`) } - toast.success(data.message || `Removed '${item.title || item.id || item.url || '??'}' from archive.`) } catch (e: any) { console.error(e) toast.error(`Error: ${e.message}`) } finally { dialog_confirm.value.visible = false } + + if (opts?.re_add) { + retryItem(item, true) + return + } + if (opts?.remove_history) { socket.emit('item_delete', { id: item._id, remove_file: false }) }