mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-06-30 11:02:54 -05:00
[utils] Introduce parse_bitrate
This commit is contained in:
@ -1798,6 +1798,14 @@ def parse_resolution(s):
|
||||
return {}
|
||||
|
||||
|
||||
def parse_bitrate(s):
|
||||
if not isinstance(s, compat_str):
|
||||
return
|
||||
mobj = re.search(r'\b(\d+)\s*kbps', s)
|
||||
if mobj:
|
||||
return int(mobj.group(1))
|
||||
|
||||
|
||||
def month_by_name(name, lang='en'):
|
||||
""" Return the number of a month by (locale-independently) English name """
|
||||
|
||||
|
Reference in New Issue
Block a user