forki 0.2.17 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d9500f6b5531d22bd8f1a227c9f7c241bacd594221bf4ce9d717d98090411b1
4
- data.tar.gz: 1bd7ac04cce0047d98151671cdf7812e99d50701ed3ba7877c569256f7de40f9
3
+ metadata.gz: 828be4f10ea4ff3496585984d78878a1492bfb13691e6772e754e31a8e0654e9
4
+ data.tar.gz: 35b0d1cba36a195e95e4d649a3808455cd2f51917a619c536b55b3413395b719
5
5
  SHA512:
6
- metadata.gz: 46c9fa11210476a43629ff6870207227b657912c3cacd9ca4b84d63d1391219ac8964d9ca9581e3c24e5ceec0afe816c252605bb07175a1d9f81f00507b01c7d
7
- data.tar.gz: 53adaa95825c4f27987d9fe2ee5dd873eb4da28c2415961a61a092240c0691482ba79fecbc1681f4aa8df22c5fff826ad1c1f94c25c5a191bbc9f8aa1b884fcc
6
+ metadata.gz: e34ae0dd4d57660c075bf1c6d8a690ca8a65adb771739556ba2c8031918ee32e2829ce7aa419ff5533640f602a92b2f7f1dc00d852768ff30cfdab42a48f9732
7
+ data.tar.gz: 8de5a58ece6ae090ebd1a638cbbe4cff3168a0f439476dfb7490d53b982e1cf4e12bf97d5a1f453134867a64f1442c95c4569ad2bde4be49f88fdde68da0b6b1
@@ -64,7 +64,17 @@ module Forki
64
64
  end
65
65
 
66
66
  def check_if_post_is_video(graphql_objects)
67
- graphql_objects.any? { |graphql_object| graphql_object.key?("is_live_streaming") || graphql_object.key?("video") || check_if_post_is_reel(graphql_object) }
67
+ result = graphql_objects.any? do |graphql_object|
68
+ next unless graphql_object.dig("viewer", "news_feed").nil?
69
+
70
+ result = graphql_object.to_s.include?("videoDeliveryLegacyFields")
71
+ result = graphql_object.key?("is_live_streaming") && graphql_object["is_live_streaming"] == true if result == false
72
+ result = graphql_object.key?("video") if result == false
73
+ result = check_if_post_is_reel(graphql_object) if result == false
74
+ result
75
+ end
76
+
77
+ result
68
78
  end
69
79
 
70
80
  def check_if_post_is_reel(graphql_object)
@@ -299,7 +309,7 @@ module Forki
299
309
 
300
310
  share_count_object = feedback_object.fetch("share_count", {})
301
311
 
302
- if story_node_object["comet_sections"]["content"]["story"]["comet_sections"].key? "message"
312
+ if story_node_object["comet_sections"]["content"]["story"]["comet_sections"].key?("message") && !story_node_object["comet_sections"]["content"]["story"]["comet_sections"]["message"].nil?
303
313
  text = story_node_object["comet_sections"]["content"]["story"]["comet_sections"]["message"]["story"]["message"]["text"]
304
314
  else
305
315
  text = ""
data/lib/forki/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Forki
4
- VERSION = "0.2.17"
4
+ VERSION = "0.2.18"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-01 00:00:00.000000000 Z
11
+ date: 2024-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara