Merge pull request #26 from zrose584/num_videos_fix

fix get_number_of_videos_channel
This commit is contained in:
James Taylor
2020-10-09 12:56:07 -07:00
committed by GitHub

View File

@@ -150,7 +150,8 @@ def get_number_of_videos_channel(channel_id):
response = response.decode('utf-8') response = response.decode('utf-8')
match = re.search(r'"numVideosText":\s*{\s*"runs":\s*\[{"text":\s*"([\d,]*) videos"', response) # match = re.search(r'"numVideosText":\s*{\s*"runs":\s*\[{"text":\s*"([\d,]*) videos"', response)
match = re.search(r'"numVideosText".*?([,\d]+)', response)
if match: if match:
return int(match.group(1).replace(',','')) return int(match.group(1).replace(',',''))
else: else: