YouTube Timed Text
application/octet-stream
Magic Bytes
Offset: 0
CE BD AF FF FF
YouTube Timed Text (YTT) is a proprietary caption format developed by Google for use within the YouTube video ecosystem. The format stores subtitle data, including timing information, text styling, and positioning, specifically for the platform's legacy closed captioning interface. Although largely superseded by newer standards like WebVTT, this format is considered safe for general use as it typically contains only structured text data without support for executable scripts or external macros.
Validation Code
How to validate .ytt files in Python
Python
def is_ytt(file_path: str) -> bool:
"""Check if file is a valid YTT by magic bytes."""
signature = bytes([0xCE, 0xBD, 0xAF, 0xFF, 0xFF])
with open(file_path, "rb") as f:
return f.read(5) == signature
How to validate .ytt files in Node.js
Node.js
function isYTT(buffer: Buffer): boolean {
const signature = Buffer.from([0xCE, 0xBD, 0xAF, 0xFF, 0xFF]);
return buffer.subarray(0, 5).equals(signature);
}
Go
func IsYTT(data []byte) bool {
signature := []byte{0xCE, 0xBD, 0xAF, 0xFF, 0xFF}
if len(data) < 5 {
return false
}
return bytes.Equal(data[:5], signature)
}
API Endpoint
GET
/api/v1/ytt
curl https://filesignature.org/api/v1/ytt