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:
parent
90a026e648
commit
8678b34116
@ -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['duration'] = int_or_none(meta[5]) if len_ >= 5 else None
|
||||||
info['thumbnails'] = [{'url': meta[14]}] if len_ >= 14 else []
|
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
|
return info
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
Loading…
Reference in New Issue
Block a user