Merge pull request #7422 from alpha-pet/feat-youtube-transscript-proxy

feat: Optional proxy setting for downloading Youtube transscripts
This commit is contained in:
Timothy Jaeryang Baek
2024-11-29 12:40:46 -08:00
committed by GitHub
5 changed files with 54 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ type ContentExtractConfigForm = {
type YoutubeConfigForm = {
language: string[];
translation?: string | null;
proxy_url: string;
};
type RAGConfigForm = {

View File

@@ -29,13 +29,15 @@
let youtubeLanguage = 'en';
let youtubeTranslation = null;
let youtubeProxyUrl = '';
const submitHandler = async () => {
const res = await updateRAGConfig(localStorage.token, {
web: webConfig,
youtube: {
language: youtubeLanguage.split(',').map((lang) => lang.trim()),
translation: youtubeTranslation
translation: youtubeTranslation,
proxy_url: youtubeProxyUrl
}
});
};
@@ -48,6 +50,7 @@
youtubeLanguage = res.youtube.language.join(',');
youtubeTranslation = res.youtube.translation;
youtubeProxyUrl = res.youtube.proxy_url;
}
});
</script>
@@ -358,6 +361,21 @@
</div>
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" w-20 text-xs font-medium self-center">{$i18n.t('Proxy URL')}</div>
<div class=" flex-1 self-center">
<input
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
type="text"
placeholder={$i18n.t('Enter proxy URL (e.g. https://user:password@host:port)')}
bind:value={youtubeProxyUrl}
autocomplete="off"
/>
</div>
</div>
</div>
</div>
{/if}
</div>