fix(peertube-analyse): Handle missing automatic_captions field in yt-dlp output
PeerTube videos don't include the automatic_captions field in their
yt-dlp JSON output. The jq filter was attempting (.automatic_captions | keys)
which fails with "null (null) has no keys" when the field is missing.
Fixed by adding null-coalescing: ((.automatic_captions // {}) | keys)
Also applied same fix to subtitles field for consistency.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f76dfe8a67
commit
e3db75cd0a
@ -187,8 +187,8 @@ extract_metadata() {
|
||||
webpage_url: .webpage_url,
|
||||
thumbnail: .thumbnail,
|
||||
language: .language,
|
||||
subtitles: (.subtitles | keys),
|
||||
automatic_captions: (.automatic_captions | keys)
|
||||
subtitles: ((.subtitles // {}) | keys),
|
||||
automatic_captions: ((.automatic_captions // {}) | keys)
|
||||
}' "$meta_file.tmp" > "$meta_file"
|
||||
rm -f "$meta_file.tmp"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user