Skip to content

Commit fd3f384

Browse files
dev: disable caption language setting
1 parent 735a57d commit fd3f384

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

android/src/main/kotlin/project/pipepipe/app/download/YtDlpFormatHelper.kt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -142,25 +142,25 @@ object YtDlpFormatHelper {
142142
?.asSequence()
143143
?.toList() ?: emptyList()
144144

145-
// Determine autoCaption based on preference
146-
var autoCaption = if (preferredLang !in subtitlesKeys) {
147-
// Preferred language not in manual subtitles, check auto captions
148-
jsonNode.get("automatic_captions")
149-
?.fieldNames()
150-
?.asSequence()
151-
?.toList()
152-
?.find { it == preferredLang }
153-
} else {
154-
// Preferred language exists in manual subtitles, no need for auto caption
155-
null
156-
}
157-
158-
if (jsonNode.requireString("webpage_url_domain").contains("youtube", ignoreCase = true) &&
159-
CookieManager.getCookie(0)?.isLoggedInCookie() == null) {
160-
autoCaption = null
161-
}
162-
163-
Log.d(TAG, "Preferred subtitle: $preferredLang, autoCaption: $autoCaption")
145+
// // Determine autoCaption based on preference
146+
// var autoCaption = if (preferredLang !in subtitlesKeys) {
147+
// // Preferred language not in manual subtitles, check auto captions
148+
// jsonNode.get("automatic_captions")
149+
// ?.fieldNames()
150+
// ?.asSequence()
151+
// ?.toList()
152+
// ?.find { it == preferredLang }
153+
// } else {
154+
// // Preferred language exists in manual subtitles, no need for auto caption
155+
// null
156+
// }
157+
//
158+
// if (jsonNode.requireString("webpage_url_domain").contains("youtube", ignoreCase = true) &&
159+
// CookieManager.getCookie(0)?.isLoggedInCookie() == null) {
160+
// autoCaption = null
161+
// }
162+
//
163+
// Log.d(TAG, "Preferred subtitle: $preferredLang, autoCaption: $autoCaption")
164164

165165
// Separate formats by type
166166
val videoOnly = allFormats.filter { it.isVideoOnly() }
@@ -196,7 +196,7 @@ object YtDlpFormatHelper {
196196
audioFormats = audioOnly,
197197
combinedFormats = combined,
198198
subtitles = subtitlesKeys,
199-
autoCaption = autoCaption
199+
autoCaption = null
200200
)
201201
)
202202
} catch (e: Exception) {

library/src/commonMain/kotlin/project/pipepipe/app/ui/screens/settings/LanguageSettingsScreen.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,13 +481,13 @@ fun LanguageSettingsScreen(
481481
entryValues = audioLanguageValues,
482482
defaultValue = "original"
483483
),
484-
PreferenceItem.ListPref(
485-
key = "preferred_subtitle_language_key",
486-
title = preferredCaptionLanguageTitle,
487-
entries = sharedLanguageEntries,
488-
entryValues = sharedLanguageValues,
489-
defaultValue = "en"
490-
),
484+
// PreferenceItem.ListPref(
485+
// key = "preferred_subtitle_language_key",
486+
// title = preferredCaptionLanguageTitle,
487+
// entries = sharedLanguageEntries,
488+
// entryValues = sharedLanguageValues,
489+
// defaultValue = "en"
490+
// ),
491491
PreferenceItem.ListPref(
492492
key = "content_country",
493493
title = contentCountryTitle,

0 commit comments

Comments
 (0)