forki 0.2.12 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c0373d5017b66032feca78ff34014da595078bd2ea276aed8590199ba386397
4
- data.tar.gz: 41f53e6c34b490d9cf7f24ad6ff43c82c8e596c789938c1a8026411a5111245b
3
+ metadata.gz: 8076712122eaa3930f4810048520db6fb17452584a7347a8cb2d4d53d275984a
4
+ data.tar.gz: 74b06da01c47fd9d4dd9532a79a7aaf03e2e2f760c9bf91cb015bfd1a82b5789
5
5
  SHA512:
6
- metadata.gz: c9cb10df9e69bb07c1b8f2d1da2e3369ddfaddf1900ad94e5d9568c50f4045df994939f81a9d7543371ee53b8376f93d2e2e62370a69ccffb598b83362e85ac2
7
- data.tar.gz: f553f6ad7d90aece2501f1ef6d0cd8c787f1ce8bc051480bdc87dab8fa43721923670b76aa3a3b1b8a6fbc46dd834dde2025ffd79dc00987ba9bcd6899bd99f4
6
+ metadata.gz: b85a149035c8aa693c2d758dbf246725eb64ce6159c86ec67f29c9ba11ec99de98b987fdd71c9536fa1f097ddfff9fa3fe172dd4d6e7640b44439316f0e153d4
7
+ data.tar.gz: 60f2298e805c9ea0517983a2f17dfe388e62f41bff9525d2b5161ab9306f729eb7d8fb2d1f35d1c963dfd2db3bdaa93f318e546f8771780a61dd03d0c059b432
@@ -38,8 +38,6 @@ module Forki
38
38
  extract_image_post_data(graphql_objects)
39
39
  else
40
40
  extract_image_post_data(graphql_objects)
41
-
42
- #raise UnhandledContentError
43
41
  end
44
42
  end
45
43
 
@@ -290,6 +288,9 @@ module Forki
290
288
  num_comments = feedback_object["comments_count_summary_renderer"]["feedback"]["total_comment_count"]
291
289
  end
292
290
 
291
+ text = sidepane_object["tahoe_sidepane_renderer"]["video"]["creation_story"]["comet_sections"]["message"].dig(["story", "message", "text"])
292
+ text = "" if text.nil?
293
+
293
294
  post_details = {
294
295
  id: video_object["id"],
295
296
  num_comments: num_comments,
@@ -298,7 +299,7 @@ module Forki
298
299
  reshare_warning: feedback_object["should_show_reshare_warning"],
299
300
  video_preview_image_url: video_object["video"]["preferred_thumbnail"]["image"]["uri"],
300
301
  video_url: video_object["video"]["playable_url_quality_hd"] || video_object["video"]["browser_native_hd_url"] || video_object["video"]["browser_native_sd_url"] || video_object["video"]["playable_url"],
301
- text: sidepane_object["tahoe_sidepane_renderer"]["video"]["creation_story"]["comet_sections"]["message"]["story"]["message"]["text"],
302
+ text: text,
302
303
  created_at: video_object["video"]["publish_time"],
303
304
  profile_link: sidepane_object["tahoe_sidepane_renderer"]["video"]["creation_story"]["comet_sections"]["actor_photo"]["story"]["actors"][0]["url"],
304
305
  has_video: true
@@ -324,9 +325,7 @@ module Forki
324
325
  elsif graphql_object["node"]["comet_sections"]["feedback"]["story"].dig("feedback_context")
325
326
  begin
326
327
  feedback_object = graphql_object["node"]["comet_sections"]["feedback"]["story"]["feedback_context"]["feedback_target_with_context"]["ufi_renderer"]["feedback"]["comet_ufi_summary_and_actions_renderer"]["feedback"]
327
- rescue NoMethodError
328
- debugger
329
- end
328
+ rescue NoMethodError; end
330
329
  elsif graphql_object["node"]["comet_sections"]["feedback"]["story"].has_key?("comet_feed_ufi_container")
331
330
  feedback_object = graphql_object["node"]["comet_sections"]["feedback"]["story"]["comet_feed_ufi_container"]["story"]["story_ufi_container"]["story"]["feedback_context"]["feedback_target_with_context"]["comet_ufi_summary_and_actions_renderer"]["feedback"]
332
331
  else
@@ -353,7 +352,9 @@ module Forki
353
352
  end
354
353
  end
355
354
 
356
- text = graphql_object["node"]["comet_sections"]["content"]["story"]["message"]["text"]
355
+ text = graphql_object["node"]["comet_sections"]["content"]["story"].dig(["message", "text"])
356
+ text = "" if text.nil?
357
+
357
358
  profile_link = graphql_object["node"]["comet_sections"]["content"]["story"]["actors"].first["url"]
358
359
 
359
360
  unless graphql_object["node"]["comet_sections"].dig("content", "story", "comet_sections", "context_layout", "story", "comet_sections", "metadata").nil?
@@ -506,7 +507,9 @@ module Forki
506
507
  end
507
508
 
508
509
  begin
510
+ # rubocop:disable Lint/Debugger
509
511
  save_screenshot("#{Forki.temp_storage_location}/facebook_screenshot_#{SecureRandom.uuid}.png")
512
+ # rubocop:enable Lint/Debugger
510
513
  rescue Selenium::WebDriver::Error::TimeoutError
511
514
  raise Net::ReadTimeout
512
515
  end
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.12"
4
+ VERSION = "0.2.14"
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.12
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-20 00:00:00.000000000 Z
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara