UI changes to support pot_provider_url

This commit is contained in:
bmcdonough 2025-11-16 15:10:00 +00:00
parent 5c114df0b2
commit 517b67d1de
5 changed files with 32 additions and 0 deletions

View File

@ -55,6 +55,7 @@ class AppConfigDownloadsSerializer(
choices=["top", "new"], allow_null=True
)
cookie_import = serializers.BooleanField()
pot_provider_url = serializers.CharField(allow_null=True)
potoken = serializers.BooleanField()
throttledratelimit = serializers.IntegerField(allow_null=True)
extractor_args = serializers.CharField(allow_null=True)

View File

@ -42,6 +42,7 @@ class DownloadsConfigType(TypedDict):
comment_max: str | None
comment_sort: Literal["top", "new"] | None
cookie_import: bool
pot_provider_url: str | None
potoken: bool
throttledratelimit: int | None
extractor_args: str | None
@ -93,6 +94,7 @@ class AppConfig:
"comment_max": None,
"comment_sort": "top",
"cookie_import": False,
"pot_provider_url": None,
"potoken": False,
"throttledratelimit": None,
"extractor_args": None,

View File

@ -23,6 +23,7 @@ export type AppSettingsConfigType = {
comment_max: string | null;
comment_sort: string;
cookie_import: boolean;
pot_provider_url: string | null;
potoken: boolean;
throttledratelimit: number | null;
extractor_args: string | null;

View File

@ -74,6 +74,7 @@ const SettingsApplication = () => {
const [showCookieForm, setShowCookieForm] = useState<boolean>(false);
const [poTokenFormData, setPoTokenFormData] = useState<string>('web+');
const [showPoTokenForm, setShowPoTokenForm] = useState<boolean>(false);
const [potProviderUrl, setPotProviderUrl] = useState<string | null>(null);
// Integrations
const [showApiToken, setShowApiToken] = useState(false);
@ -128,6 +129,9 @@ const SettingsApplication = () => {
setCommentsMax(appSettingsConfigData?.downloads.comment_max || null);
setCommentsSort(appSettingsConfigData?.downloads.comment_sort || '');
// Cookie
setPotProviderUrl(appSettingsConfigData?.downloads.pot_provider_url || null);
// Integrations
setDownloadDislikes(appSettingsConfigData?.downloads.integrate_ryd || false);
setEnableSponsorBlock(appSettingsConfigData?.downloads.integrate_sponsorblock || false);
@ -748,6 +752,16 @@ const SettingsApplication = () => {
PO guide
</a>
</li>
<li>
The POT Provider URL <i>(bgutil-ytdlp-pot-provider)</i> running external to
tubearchivist. Make sure to review{' '}
<a
target="_blank"
href="https://github.com/Brainicism/bgutil-ytdlp-pot-provider/blob/master/README.md"
>
README.md
</a>
</li>
</ul>
</div>
)}
@ -847,6 +861,19 @@ const SettingsApplication = () => {
)}
</div>
</div>
<div className="settings-box-wrapper">
<div>
<p>POT Provider URL</p>
</div>
<InputConfig
type="text"
name="downloads.pot_provider_url"
value={potProviderUrl}
setValue={setPotProviderUrl}
oldValue={appSettingsConfig.downloads.pot_provider_url}
updateCallback={handleUpdateConfig}
/>
</div>
</div>
<div className="info-box-item">
<h2 id="sntegrations">Integrations</h2>

View File

@ -30,6 +30,7 @@ export const useAppSettingsStore = create<AppSettingsState>(set => ({
comment_max: null,
comment_sort: 'asc',
cookie_import: false,
pot_provider_url: null,
potoken: false,
throttledratelimit: null,
extractor_args: null,