diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-01 13:25:42 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-01 13:26:45 +0100 |
commit | 7f0506de4f737807043cc70511dad55a1eada7de (patch) | |
tree | 4f20c4924621b8296801091e9264b0a2f8e39b90 /src | |
parent | 6f27466738e0b170fe957793855ec96c187a34c9 (diff) |
feat: extract more properties in stream and stream-item api handlers
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/tubo/api.clj | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/src/backend/tubo/api.clj b/src/backend/tubo/api.clj index f5e1a2e..d0d33e2 100644 --- a/src/backend/tubo/api.clj +++ b/src/backend/tubo/api.clj @@ -14,22 +14,26 @@ (defn get-stream-item [stream] - {:type :stream - :service-id (.getServiceId stream) - :url (.getUrl stream) - :name (.getName stream) - :thumbnail-url (.getThumbnailUrl stream) - :uploader-name (.getUploaderName stream) - :uploader-url (.getUploaderUrl stream) - :uploader-avatar (.getUploaderAvatarUrl stream) - :upload-date (.getTextualUploadDate stream) + {:type :stream + :service-id (.getServiceId stream) + :url (.getUrl stream) + :name (.getName stream) + :thumbnail-url (.getThumbnailUrl stream) + :uploader-name (.getUploaderName stream) + :uploader-url (.getUploaderUrl stream) + :uploader-avatar (.getUploaderAvatarUrl stream) + :upload-date (.getTextualUploadDate stream) :short-description (.getShortDescription stream) - :duration (.getDuration stream) - :view-count (when-not (= (.getViewCount stream) -1) (.getViewCount stream)) - :uploaded - (when (.getUploadDate stream) - (.. stream (getUploadDate) (offsetDateTime) (toInstant) (toEpochMilli))) - :verified? (.isUploaderVerified stream)}) + :duration (.getDuration stream) + :view-count (when-not (= (.getViewCount stream) -1) + (.getViewCount stream)) + :uploaded (when (.getUploadDate stream) + (.. stream + (getUploadDate) + (offsetDateTime) + (toInstant) + (toEpochMilli))) + :verified? (.isUploaderVerified stream)}) (defn get-channel-item [channel] @@ -118,7 +122,13 @@ :audio-streams (j/from-java (.getAudioStreams info)) :video-streams (j/from-java (.getVideoStreams info)) :hls-url (.getHlsUrl info) - :dash-mpd-url (.getDashMpdUrl info)}))) + :dash-mpd-url (.getDashMpdUrl info) + :preview-frames (.getPreviewFrames info) + :stream-segments (.getStreamSegments info) + :support-info (.getSupportInfo info) + :short? (.isShortFormContent info) + :license (.getLicence info) + :subtitles (.getSubtitles info)}))) (defn get-playlist ([url] |