feat(YouTube - Spoof client): Allow forcing AVC codec with iOS (#3570)

This commit is contained in:
LisoUseInAIKyrios 2024-08-22 13:48:49 -04:00 committed by GitHub
parent 1872d81abd
commit 1a49d1f3c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 6 deletions

View file

@ -14,6 +14,8 @@ import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
import app.revanced.patches.all.misc.resources.AddResourcesPatch
import app.revanced.patches.shared.misc.settings.preference.ListPreference
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch
@ -118,9 +120,16 @@ object SpoofClientPatch : BytecodePatch(
sorting = PreferenceScreen.Sorting.UNSORTED,
preferences = setOf(
SwitchPreference("revanced_spoof_client"),
SwitchPreference("revanced_spoof_client_use_ios"),
),
),
ListPreference("revanced_spoof_client_type",
summaryKey = null,
entriesKey = "revanced_spoof_client_type_entries",
entryValuesKey = "revanced_spoof_client_type_entry_values"
),
SwitchPreference("revanced_spoof_client_ios_force_avc"),
NonInteractivePreference("revanced_spoof_client_about_android_ios"),
NonInteractivePreference("revanced_spoof_client_about_android_vr")
)
)
)
// region Block /initplayback requests to fall back to /get_watch requests.

View file

@ -97,6 +97,18 @@
<item>END</item>
</string-array>
</patch>
<patch id="misc.fix.playback.SpoofClientPatch">
<string-array name="revanced_spoof_client_type_entries">
<!-- OS names are the same in all languages, so specify them here and not in Strings.xml -->
<item>iOS</item>
<item>Android VR</item>
</string-array>
<string-array name="revanced_spoof_client_type_entry_values">
<!-- Enum names from Integrations -->
<item>IOS</item>
<item>ANDROID_VR</item>
</string-array>
</patch>
<patch id="video.quality.RememberVideoQualityPatch">
<string-array name="revanced_video_quality_default_entries">
<item>@string/revanced_video_quality_default_entry_1</item>

View file

@ -1138,9 +1138,15 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_spoof_client_summary_on">Client is spoofed</string>
<string name="revanced_spoof_client_summary_off">Client is not spoofed\n\nVideo playback may not work</string>
<string name="revanced_spoof_client_user_dialog_message">Turning off this setting may cause video playback issues.</string>
<string name="revanced_spoof_client_use_ios_title">Spoof client to iOS</string>
<string name="revanced_spoof_client_use_ios_summary_on">Client is currently spoofed to iOS\n\nSide effects include:\n• HDR video may not be available\n• Watch history does not work with a brand account</string>
<string name="revanced_spoof_client_use_ios_summary_off">Client is currently spoofed to Android VR\n\nSide effects include:\n• No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden</string>
<string name="revanced_spoof_client_type_title">Spoof client type</string>
<string name="revanced_spoof_client_ios_force_avc_title">Force iOS AVC (H.264)</string>
<string name="revanced_spoof_client_ios_force_avc_summary_on">iOS video codec is AVC</string>
<string name="revanced_spoof_client_ios_force_avc_summary_off">iOS video codec is AVC, VP9, or AV1</string>
<string name="revanced_spoof_client_ios_force_avc_user_dialog_message">Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1.</string>
<string name="revanced_spoof_client_about_android_ios_title">iOS spoofing side effects</string>
<string name="revanced_spoof_client_about_android_ios_summary">• HDR is supported only with AV1 codec\n• Watch history does not work with a brand account</string>
<string name="revanced_spoof_client_about_android_vr_title">Android VR spoofing side effects</string>
<string name="revanced_spoof_client_about_android_vr_summary">• No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden</string>
<string name="revanced_spoof_client_storyboard_timeout">Spoof client thumbnails not available (API timed out)</string>
<string name="revanced_spoof_client_storyboard_io_exception">Spoof client thumbnails temporarily not available: %s</string>
</patch>