forki 0.2.16 → 0.2.17

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: 5a81f3f14449d4d0abdb3300bbdffbc4d34b8c5db400c8a4d7beb9bb2958fcc7
4
- data.tar.gz: d4b9ade188b782c02da0b53ef64fb39a6d66aaed3eac2354dd968e87c58f1e51
3
+ metadata.gz: 1d9500f6b5531d22bd8f1a227c9f7c241bacd594221bf4ce9d717d98090411b1
4
+ data.tar.gz: 1bd7ac04cce0047d98151671cdf7812e99d50701ed3ba7877c569256f7de40f9
5
5
  SHA512:
6
- metadata.gz: d9516edea544bd8eefaee678e60f957f9f659a32daa46bbb8157a06da38e4e513ea3eca85108c59714b4d9d70b536ef853a7f6741e1e956c2bdb7c89a908308d
7
- data.tar.gz: eb6126c73693e2d13d335d517573736343869b94e3e17e8775d65f2c496e90b55c6baed06797e140ca76539ba5434d2ad2dc603de415d758db76337ee74224c6
6
+ metadata.gz: 46c9fa11210476a43629ff6870207227b657912c3cacd9ca4b84d63d1391219ac8964d9ca9581e3c24e5ceec0afe816c252605bb07175a1d9f81f00507b01c7d
7
+ data.tar.gz: 53adaa95825c4f27987d9fe2ee5dd873eb4da28c2415961a61a092240c0691482ba79fecbc1681f4aa8df22c5fff826ad1c1f94c25c5a191bbc9f8aa1b884fcc
@@ -33,12 +33,12 @@ module Forki
33
33
 
34
34
  if post_is_text_only
35
35
  extract_text_post_data(graphql_objects)
36
+ elsif post_has_image && !post_has_video && !post_has_video_in_comment_stream
37
+ extract_image_post_data(graphql_objects)
36
38
  elsif post_has_video
37
39
  extract_video_post_data(graphql_strings)
38
40
  elsif post_has_video_in_comment_stream
39
41
  extract_video_comment_post_data(graphql_objects)
40
- elsif post_has_image
41
- extract_image_post_data(graphql_objects)
42
42
  else
43
43
  extract_image_post_data(graphql_objects)
44
44
  end
@@ -84,6 +84,7 @@ module Forki
84
84
  return true unless graphql_object.fetch("image", nil).nil? # so long as the associated values are not nil
85
85
  return true unless graphql_object.fetch("currMedia", nil).nil?
86
86
  return true unless graphql_object.fetch("photo_image", nil).nil?
87
+ return true unless graphql_object.fetch("large_share_image", nil).nil?
87
88
 
88
89
  # This is a complicated form for `web.facebook.com` posts
89
90
  if !graphql_object.dig("node", "comet_sections", "content", "story", "attachments").nil?
@@ -329,11 +330,10 @@ module Forki
329
330
  reshare_warning = feedback_object["comet_ufi_summary_and_actions_renderer"]["feedback"]["should_show_reshare_warning"]
330
331
  end
331
332
 
332
- if !video_object.key?("browser_native_hd_url") && !video_object.key?("browser_native_sd_url") && video_object.key?("videoDeliveryLegacyFields")
333
- video_url = video_object["videoDeliveryLegacyFields"]["browser_native_hd_url"] || video_object["videoDeliveryLegacyFields"]["browser_native_sd_url"]
334
- else
335
- video_url = video_object["browser_native_hd_url"] || video_object["browser_native_sd_url"]
336
- end
333
+ video_object_url_subsearch = video_object
334
+ video_object_url_subsearch = video_object_url_subsearch["videoDeliveryLegacyFields"] if video_object_url_subsearch.has_key?("videoDeliveryLegacyFields")
335
+ # if video_object.key?("browser_native_hd_url") || video_object.key?("browser_native_sd_url")
336
+ video_url = video_object_url_subsearch["browser_native_hd_url"] || video_object_url_subsearch["browser_native_sd_url"]
337
337
 
338
338
  post_details = {
339
339
  id: video_object["id"],
@@ -442,6 +442,10 @@ module Forki
442
442
  if image_url.nil?
443
443
  image_url = attachments.first&.dig("styles", "attachment", "media", "large_share_image", "uri")
444
444
  end
445
+
446
+ if image_url.nil?
447
+ image_url = attachments.first&.dig("styles", "attachment", "media", "image", "uri")
448
+ end
445
449
  end
446
450
 
447
451
  text = graphql_object["node"]["comet_sections"]["content"]["story"].dig("message", "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.16"
4
+ VERSION = "0.2.17"
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.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-28 00:00:00.000000000 Z
11
+ date: 2024-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara