add cookie import to frontend

This commit is contained in:
simon 2022-04-29 18:38:43 +07:00
parent 1fa26cdc44
commit 430fdb6f1c
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
3 changed files with 18 additions and 0 deletions

View File

@ -26,6 +26,7 @@
"subtitle": false,
"subtitle_source": false,
"subtitle_index": false,
"cookie_import": false,
"throttledratelimit": false,
"integrate_ryd": false,
"integrate_sponsorblock": false

View File

@ -86,6 +86,12 @@ class ApplicationSettingsForm(forms.Form):
("1", "enable subtitle index"),
]
COOKIE_IMPORT_CHOICES = [
("", "-- change cookie settings"),
("0", "disable cookie"),
("1", "enable cookie"),
]
subscriptions_channel_size = forms.IntegerField(required=False)
downloads_limit_count = forms.IntegerField(required=False)
downloads_limit_speed = forms.IntegerField(required=False)
@ -106,6 +112,9 @@ class ApplicationSettingsForm(forms.Form):
downloads_subtitle_index = forms.ChoiceField(
widget=forms.Select, choices=SUBTITLE_INDEX_CHOICES, required=False
)
downloads_cookie_import = forms.ChoiceField(
widget=forms.Select, choices=COOKIE_IMPORT_CHOICES, required=False
)
downloads_integrate_ryd = forms.ChoiceField(
widget=forms.Select, choices=RYD_CHOICES, required=False
)

View File

@ -114,6 +114,14 @@
{{ app_form.downloads_subtitle_index }}
</div>
</div>
<div class="settings-group">
<h2 id="format">Cookie</h2>
<div class="settings-item">
<p>Import YouTube cookie: <span class="settings-current">{{ config.downloads.cookie_import }}</span><br></p>
<i>Place your cookie file named <span class="settings-current">cookies.google.txt</span> in /cache/import before enabling.</i><br>
{{ app_form.downloads_cookie_import }}
</div>
</div>
<div class="settings-group">
<h2 id="integrations">Integrations</h2>
<div class="settings-item">