66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/forki/scrapers/post_scraper.rb', line 66
def check_if_post_is_video(graphql_objects)
result = graphql_objects.find do |graphql_object|
next unless graphql_object.dig("viewer", "news_feed").nil? next unless graphql_object.dig("node", "sponsored_data").nil?
result = graphql_object.to_s.include?("videoDeliveryLegacyFields")
result = graphql_object.key?("is_live_streaming") && graphql_object["is_live_streaming"] == true if result == false
result = graphql_object.key?("video") if result == false
result = check_if_post_is_reel(graphql_object) if result == false
result
end
!result.nil?
end
|