Formatting

This commit is contained in:
Triplesalt 2020-10-23 03:20:40 +02:00
parent 9c78d912dd
commit e4af5e85cb

View File

@ -776,6 +776,7 @@ def extract_channel_community_cursor(continuation)
end
INITDATA_PREQUERY = "window[\"ytInitialData\"] = {"
def get_about_info(ucid, locale)
about = YT_POOL.client &.get("/channel/#{ucid}/about?gl=US&hl=en")
if about.status_code != 200
@ -895,7 +896,6 @@ def get_about_info(ucid, locale)
tabs = tabs_json.reject { |node| node["tabRenderer"]?.nil? }.map { |node| node["tabRenderer"]["title"].as_s.downcase }
end
sub_count = initdata["header"]["c4TabbedHeaderRenderer"]?.try &.["subscriberCountText"]?.try &.["simpleText"]?.try &.as_s?
.try { |text| short_text_to_number(text.split(" ")[0]) } || 0