1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-09 23:08:32 +00:00

feat: parse age limit

This commit is contained in:
DarkCat09 2025-03-30 15:55:27 +04:00
parent 90a026e648
commit 8678b34116
No known key found for this signature in database

View File

@ -896,6 +896,17 @@ def _parse_track_meta(self, meta, track_id=None):
info['duration'] = int_or_none(meta[5]) if len_ >= 5 else None
info['thumbnails'] = [{'url': meta[14]}] if len_ >= 14 else []
# meta[30] is 2 bits
# most significant: isExplicit
# least significant: isForeignAgent
# i. e.
# 00 = safe
# 01 = marked by RKN as "foreign agent"
# 10 = explicit lyrics
# 11 = both E lyrics and "foreign agent"
if len_ >= 30 and meta[30]:
info['age_limit'] = 18
return info
def _real_extract(self, url):