diff options
-rw-r--r-- | youtube/yt_data_extract/common.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/yt_data_extract/common.py b/youtube/yt_data_extract/common.py index dfeae64..221b523 100644 --- a/youtube/yt_data_extract/common.py +++ b/youtube/yt_data_extract/common.py @@ -142,12 +142,12 @@ def extract_int(string, default=None): return default def extract_approx_int(string): - '''e.g. "15M" from "15M subscribers"''' + '''e.g. "15.1M" from "15.1M subscribers"''' if not isinstance(string, str): string = extract_str(string) if not string: return None - match = re.search(r'(\d+[KMBTkmbt])', string.replace(',', '')) + match = re.search(r'(\d+(?:\.\d+)?[KMBTkmbt])', string.replace(',', '')) if match is None: return None return match.group(1) |