aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-01-11 02:10:51 +0530
committerpukkandan <pukkandan@gmail.com>2021-01-11 02:59:44 +0530
commit7267acd1edd907e7359febab00061ae873a0c274 (patch)
treef6da1a856cd4862c0a3fc7cd251eaec03e7d0c2d
parentf446cc66675629d3e043800d9ce74d3327f9fdfa (diff)
downloadhypervideo-pre-7267acd1edd907e7359febab00061ae873a0c274.tar.lz
hypervideo-pre-7267acd1edd907e7359febab00061ae873a0c274.tar.xz
hypervideo-pre-7267acd1edd907e7359febab00061ae873a0c274.zip
[youtube:search] fix view_count (https://github.com/ytdl-org/youtube-dl/pull/27588/)
Authored by ohnonot
-rw-r--r--youtube_dlc/extractor/youtube.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py
index 44acb069a..0b87f2185 100644
--- a/youtube_dlc/extractor/youtube.py
+++ b/youtube_dlc/extractor/youtube.py
@@ -3624,8 +3624,8 @@ class YoutubeSearchIE(SearchInfoExtractor, YoutubeBaseInfoExtractor):
description = try_get(video, lambda x: x['descriptionSnippet']['runs'][0]['text'], compat_str)
duration = parse_duration(try_get(video, lambda x: x['lengthText']['simpleText'], compat_str))
view_count_text = try_get(video, lambda x: x['viewCountText']['simpleText'], compat_str) or ''
- view_count = int_or_none(self._search_regex(
- r'^(\d+)', re.sub(r'\s', '', view_count_text),
+ view_count = str_to_int(self._search_regex(
+ r'^([\d,]+)', re.sub(r'\s', '', view_count_text),
'view count', default=None))
uploader = try_get(video, lambda x: x['ownerText']['runs'][0]['text'], compat_str)
total += 1