Liking cljdoc? Tell your friends :D

qy-upup.first-last-frame.core


extract-filename-from-urlclj

(extract-filename-from-url url)

Extracts the filename from a given URL.

Takes a URL string as input. Returns the filename with extension, or nil if not found.

Example: (extract-filename-from-url "https://example.com/videos/my_video.mp4") ;=> "my_video.mp4"

(extract-filename-from-url "https://example.com/videos/my_video") ;=> "my_video"

(extract-filename-from-url "https://example.com/videos/") ;=> nil

Extracts the filename from a given URL.

Takes a URL string as input. Returns the filename with extension, or nil if not found.

Example:
(extract-filename-from-url "https://example.com/videos/my_video.mp4")
;=> "my_video.mp4"

(extract-filename-from-url "https://example.com/videos/my_video")
;=> "my_video"

(extract-filename-from-url "https://example.com/videos/")
;=> nil
raw docstring

generate-supermaker-urlclj

(generate-supermaker-url
  {:keys [video-url frame-width frame-height output-format]
   :or {frame-width 640 frame-height 360 output-format "image"}})

Generates a Supermaker URL for extracting the first and last frame of a video.

Takes a map containing :video-url (required), and optional parameters:

  • :frame-width (default: 640)
  • :frame-height (default: 360)
  • :output-format (default: "image")

Returns a string representing the Supermaker URL.

Example: (generate-supermaker-url {:video-url "https://example.com/video.mp4"}) ;=> "https://supermaker.ai/api/first-last-frame?video_url=https://example.com/video.mp4&frame_width=640&frame_height=360&output_format=image"

Generates a Supermaker URL for extracting the first and last frame of a video.

Takes a map containing :video-url (required), and optional parameters:
- :frame-width (default: 640)
- :frame-height (default: 360)
- :output-format (default: "image")

Returns a string representing the Supermaker URL.

Example:
(generate-supermaker-url {:video-url "https://example.com/video.mp4"})
;=> "https://supermaker.ai/api/first-last-frame?video_url=https://example.com/video.mp4&frame_width=640&frame_height=360&output_format=image"
raw docstring

mock-supermaker-responseclj

(mock-supermaker-response filename)

Generates a mock Supermaker API response for testing purposes.

Takes a filename (string) as input.

Returns a map containing mock URLs for the first and last frames.

Example: (mock-supermaker-response "my_video.mp4") ;=> {:first_frame_url "https://mock.supermaker.ai/first_frame/my_video_first.jpg", :last_frame_url "https://mock.supermaker.ai/last_frame/my_video_last.jpg"}

Generates a mock Supermaker API response for testing purposes.

Takes a filename (string) as input.

Returns a map containing mock URLs for the first and last frames.

Example:
(mock-supermaker-response "my_video.mp4")
;=> {:first_frame_url "https://mock.supermaker.ai/first_frame/my_video_first.jpg", :last_frame_url "https://mock.supermaker.ai/last_frame/my_video_last.jpg"}
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close