|
|
@ -73,9 +73,9 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
|
|
|
|
contents = nil
|
|
|
|
contents = nil
|
|
|
|
|
|
|
|
|
|
|
|
if response["onResponseReceivedEndpoints"]?
|
|
|
|
if response["onResponseReceivedEndpoints"]?
|
|
|
|
onResponseReceivedEndpoints = response["onResponseReceivedEndpoints"]
|
|
|
|
on_response_received_endpoints = response["onResponseReceivedEndpoints"]
|
|
|
|
header = nil
|
|
|
|
header = nil
|
|
|
|
onResponseReceivedEndpoints.as_a.each do |item|
|
|
|
|
on_response_received_endpoints.as_a.each do |item|
|
|
|
|
if item["reloadContinuationItemsCommand"]?
|
|
|
|
if item["reloadContinuationItemsCommand"]?
|
|
|
|
case item["reloadContinuationItemsCommand"]["slot"]
|
|
|
|
case item["reloadContinuationItemsCommand"]["slot"]
|
|
|
|
when "RELOAD_CONTINUATION_SLOT_HEADER"
|
|
|
|
when "RELOAD_CONTINUATION_SLOT_HEADER"
|
|
|
@ -97,7 +97,8 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
|
|
|
|
contents = body["contents"]?
|
|
|
|
contents = body["contents"]?
|
|
|
|
header = body["header"]?
|
|
|
|
header = body["header"]?
|
|
|
|
if body["continuations"]?
|
|
|
|
if body["continuations"]?
|
|
|
|
moreRepliesContinuation = body["continuations"][0]["nextContinuationData"]["continuation"].as_s
|
|
|
|
# Removable? Doesn't seem like this is used.
|
|
|
|
|
|
|
|
more_replies_continuation = body["continuations"][0]["nextContinuationData"]["continuation"].as_s
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise InfoException.new("Could not fetch comments")
|
|
|
|
raise InfoException.new("Could not fetch comments")
|
|
|
@ -111,10 +112,10 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
continuationItemRenderer = nil
|
|
|
|
continuation_item_renderer = nil
|
|
|
|
contents.as_a.reject! do |item|
|
|
|
|
contents.as_a.reject! do |item|
|
|
|
|
if item["continuationItemRenderer"]?
|
|
|
|
if item["continuationItemRenderer"]?
|
|
|
|
continuationItemRenderer = item["continuationItemRenderer"]
|
|
|
|
continuation_item_renderer = item["continuationItemRenderer"]
|
|
|
|
true
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -232,14 +233,14 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if continuationItemRenderer
|
|
|
|
if continuation_item_renderer
|
|
|
|
if continuationItemRenderer["continuationEndpoint"]?
|
|
|
|
if continuation_item_renderer["continuationEndpoint"]?
|
|
|
|
continuationEndpoint = continuationItemRenderer["continuationEndpoint"]
|
|
|
|
continuation_endpoint = continuation_item_renderer["continuationEndpoint"]
|
|
|
|
elsif continuationItemRenderer["button"]?
|
|
|
|
elsif continuation_item_renderer["button"]?
|
|
|
|
continuationEndpoint = continuationItemRenderer["button"]["buttonRenderer"]["command"]
|
|
|
|
continuation_endpoint = continuation_item_renderer["button"]["buttonRenderer"]["command"]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if continuationEndpoint
|
|
|
|
if continuation_endpoint
|
|
|
|
json.field "continuation", continuationEndpoint["continuationCommand"]["token"].as_s
|
|
|
|
json.field "continuation", continuation_endpoint["continuationCommand"]["token"].as_s
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|