aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-10-18 01:45:31 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-10-18 01:45:31 -0700
commitac9fbbbf10f3a74bbc0b212a03b5375d5667bca8 (patch)
treeeaf2250c1cce22d1c0d42a375a94e5fabe3f0326 /youtube
parent23dfb97309282d96d05644eb8960f3c8a9b05393 (diff)
downloadyt-local-ac9fbbbf10f3a74bbc0b212a03b5375d5667bca8.tar.lz
yt-local-ac9fbbbf10f3a74bbc0b212a03b5375d5667bca8.tar.xz
yt-local-ac9fbbbf10f3a74bbc0b212a03b5375d5667bca8.zip
comments: fixed regression in previous comments bugfix commit
Diffstat (limited to 'youtube')
-rw-r--r--youtube/comments.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube/comments.py b/youtube/comments.py
index c724f15..fef04a9 100644
--- a/youtube/comments.py
+++ b/youtube/comments.py
@@ -205,10 +205,12 @@ def parse_comments_polymer(content, replies=False):
else:
if 'commentTargetTitle' in comment_raw:
video_title = comment_raw['commentTargetTitle']['runs'][0]['text']
+
+ parent_id = comment_raw['comment']['commentRenderer']['commentId']
if 'replies' in comment_raw:
#reply_ctoken = comment_raw['replies']['commentRepliesRenderer']['continuations'][0]['nextContinuationData']['continuation']
#comment_id, video_id = get_ids(reply_ctoken)
- # replies_url = URL_ORIGIN + '/comments?parent_id=' + comment_id + "&video_id=" + video_id
+ replies_url = URL_ORIGIN + '/comments?parent_id=' + parent_id + "&video_id=" + video_id
view_replies_text = common.get_plain_text(comment_raw['replies']['commentRepliesRenderer']['moreText'])
match = reply_count_regex.search(view_replies_text)
if match is None:
@@ -217,8 +219,7 @@ def parse_comments_polymer(content, replies=False):
view_replies_text = match.group(1) + " replies"
elif not replies:
view_replies_text = "Reply"
- parent_id = comment_raw['comment']['commentRenderer']['commentId']
- replies_url = URL_ORIGIN + '/post_comment?parent_id=' + parent_id + "&video_id=" + video_id
+ replies_url = URL_ORIGIN + '/post_comment?parent_id=' + parent_id + "&video_id=" + video_id
comment_raw = comment_raw['comment']
comment_raw = comment_raw['commentRenderer']