aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/channel.py
diff options
context:
space:
mode:
authorJames Taylor <28744867+user234683@users.noreply.github.com>2020-10-12 09:37:13 -0700
committerGitHub <noreply@github.com>2020-10-12 09:37:13 -0700
commitfd253d9e07fa34e2a22d28d445839147daca9ee0 (patch)
tree7dfecaadce3cc58ddcc86e2cd9d5ef762563e9ce /youtube/channel.py
parent37d286fc7ce8feec72d9ecf5d238a42c873de1d0 (diff)
parent2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833 (diff)
downloadyt-local-fd253d9e07fa34e2a22d28d445839147daca9ee0.tar.lz
yt-local-fd253d9e07fa34e2a22d28d445839147daca9ee0.tar.xz
yt-local-fd253d9e07fa34e2a22d28d445839147daca9ee0.zip
Merge branch 'master' into optional_proxy_images
Diffstat (limited to 'youtube/channel.py')
-rw-r--r--youtube/channel.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube/channel.py b/youtube/channel.py
index ad6db5b..e9cc87b 100644
--- a/youtube/channel.py
+++ b/youtube/channel.py
@@ -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:
@@ -209,7 +210,7 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None):
if tab == 'videos' and channel_id:
tasks = (
- gevent.spawn(get_number_of_videos_channel, channel_id),
+ gevent.spawn(get_number_of_videos_channel, channel_id),
gevent.spawn(get_channel_tab, channel_id, page_number, sort, 'videos', view)
)
gevent.joinall(tasks)
@@ -217,7 +218,7 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None):
number_of_videos, polymer_json = tasks[0].value, tasks[1].value
elif tab == 'videos':
tasks = (
- gevent.spawn(get_number_of_videos_general, base_url),
+ gevent.spawn(get_number_of_videos_general, base_url),
gevent.spawn(util.fetch_url, base_url + '/videos?pbj=1&view=0', headers_desktop, debug_name='gen_channel_videos')
)
gevent.joinall(tasks)