add no check certificates option

This commit is contained in:
deniscerri 2025-01-04 22:48:55 +01:00
parent 927ea57a99
commit 82b2f651ab
No known key found for this signature in database
GPG key ID: 95C43D517D830350
4 changed files with 21 additions and 0 deletions

View file

@ -76,6 +76,10 @@ class YTDLPUtil(private val context: Context) {
}
addOption("-P", FileUtil.getCachePath(context) + "/tmp")
if (sharedPreferences.getBoolean("no_check_certificates", true)) {
addOption("--no-check-certificates")
}
val extraCommands = sharedPreferences.getString("data_fetching_extra_commands", "")!!
if (extraCommands.isNotBlank()){
//addCommands(extraCommands.split(" ", "\t", "\n"))
@ -644,6 +648,10 @@ class YTDLPUtil(private val context: Context) {
}
}
if (sharedPreferences.getBoolean("no_check_certificates", true)) {
request.addOption("--no-check-certificates")
}
val proxy = sharedPreferences.getString("proxy", "")
if (proxy!!.isNotBlank()){
request.addOption("--proxy", proxy)

View file

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="?android:colorAccent" android:pathData="M22,10l-6,-6L4,4c-1.1,0 -2,0.9 -2,2v12.01c0,1.1 0.9,1.99 2,1.99l16,-0.01c1.1,0 2,-0.89 2,-1.99v-8zM15,5.5l5.5,5.5L15,11L15,5.5z"/>
</vector>

View file

@ -443,4 +443,5 @@
<string name="ytdlp_recommnedations">YT-DLP Youtube Recommendations (needs cookies)</string>
<string name="ytdlp_liked">YT-DLP Youtube Liked Videos (needs cookies)</string>
<string name="ytdlp_watch_history">YT-DLP Youtube Watch History (needs cookies)</string>
<string name="no_check_certificates">Suppress HTTPS certificate validation</string>
</resources>

View file

@ -67,6 +67,13 @@
android:key="use_cookies"
app:title="@string/use_cookies" />
<SwitchPreferenceCompat
android:widgetLayout="@layout/preferece_material_switch"
app:defaultValue="true"
android:icon="@drawable/baseline_note_24"
android:key="no_check_certificates"
app:title="@string/no_check_certificates" />
<EditTextPreference
android:icon="@drawable/baseline_network_locked_24"
app:key="proxy"