remove some bulky and useless data from mock gen

Co-authored-by: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
Lennart Bernhardt 2023-04-07 22:08:37 +00:00 committed by GitHub
parent 177f0ca96c
commit 767f4c0634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,14 @@ for file in files:
default_context.update({"videoId": file["video_id"]})
context = json.dumps(default_context)
video = json.loads(run_yt_helper_script("-c", "web", "-e", file['endpoint'], "--data", context))
# Delete some useless elements
del video['responseContext']
if 'topbar' in video: del video['topbar']
if 'overlay' in video: del video['overlay']
if 'attestation' in video: del video['attestation']
if 'frameworkUpdates' in video: del video['frameworkUpdates']
processed_mocks = apply_ip_replacements(json.dumps(video, indent=2))
write_string_to_file("video/"+file["name"], processed_mocks)