[ie/youtube] Detect experiment binding GVS PO Token to video id (#14471)

Fixes https://github.com/yt-dlp/yt-dlp/issues/14421

Authored by: coletdjnz
This commit is contained in:
coletdjnz 2025-09-29 16:25:09 +13:00 committed by GitHub
parent 88e2a2de8e
commit bd5ed90419
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 2 deletions

View file

@ -45,3 +45,8 @@ class TestGetWebPoContentBinding:
def test_invalid_base64(self, pot_request):
pot_request.visitor_data = 'invalid-base64'
assert get_webpo_content_binding(pot_request, bind_to_visitor_id=True) == (pot_request.visitor_data, ContentBindingType.VISITOR_DATA)
def test_gvs_video_id_binding_experiment(self, pot_request):
pot_request.context = PoTokenContext.GVS
pot_request._gvs_bind_to_video_id = True
assert get_webpo_content_binding(pot_request) == ('example-video-id', ContentBindingType.VIDEO_ID)