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
commit a10a97a459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,8 @@ def get_number_of_videos_channel(channel_id):
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:
return int(match.group(1).replace(',',''))
else: