Skip to content

Commit

Permalink
Update for a few new paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cguess committed Sep 12, 2024
1 parent 578ed82 commit 9929a95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions lib/forki/scrapers/sieves/video_sieves/video_sieve_watch_tab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ def self.check(graphql_objects)
def self.sieve(graphql_objects)
video_object = self.extractor(graphql_objects)

# video_url = video_object["attachments"].first["media"]["browser_native_sd_url"]
video_url = video_object["short_form_video_context"]["playback_video"]["browser_native_hd_url"]
video_url = video_object["short_form_video_context"]["playback_video"]["browser_native_sd_url"] if video_url.nil?
video_url = video_object["attachments"]&.first.dig("media", "browser_native_sd_url")

# video_preview_image_url = video_object["attachments"].first["media"]["preferred_thumbnail"]["image"]["uri"]
video_preview_image_url = video_object["short_form_video_context"]["video"]["first_frame_thumbnail"]
video_url = video_object.dig("short_form_video_context", "playback_video", "browser_native_hd_url") if video_url.nil?
video_url = video_object.dig("short_form_video_context", "playback_video", "browser_native_sd_url") if video_url.nil?

debugger if video_url.nil?

video_preview_image_url = video_object["attachments"]&.first.dig("media", "preferred_thumbnail", "image", "uri")
video_preview_image_url = video_object["short_form_video_context"]["video"]["first_frame_thumbnail"] if video_preview_image_url.nil?

if !video_object["feedback_context"].nil?
feedback_object = video_object["feedback_context"]["feedback_target_with_context"]
Expand Down
2 changes: 1 addition & 1 deletion lib/forki/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Forki
VERSION = "0.2.9"
VERSION = "0.2.10"
end

0 comments on commit 9929a95

Please sign in to comment.