Skip to content

Commit

Permalink
add no check certificates option
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscerri committed Jan 4, 2025
1 parent 927ea57 commit 82b2f65
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/baseline_note_24.xml
Original file line number Diff line number Diff line change
@@ -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>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
7 changes: 7 additions & 0 deletions app/src/main/res/xml/downloading_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 82b2f65

Please sign in to comment.