Bushel_sync.PeertubeVideo metadata and thumbnails from PeerTube
PeerTube API client for video metadata and thumbnails
val src : Logs.srctype video = {id : int;uuid : string;name : string;description : string option;url : string;embed_path : string;published_at : Ptime.t;originally_published_at : Ptime.t option;thumbnail_path : string option;}Simplified video type used in bushel - projects relevant fields from PeerTube API
module PT = Peer_tubeval int_of_json : Jsont.json -> intExtract int from Jsont.json
val string_of_json : Jsont.json -> stringExtract string from Jsont.json
val video_of_peertube : PT.Video.T.t -> videoConvert from generated Peertube.Video.T.t to our simplified video type
val decode_channel_response : string -> (channel_response, string) Result.tExtract UUID from a PeerTube video URL. Handles formats like:
val find_server_for_url :
Bushel_config.peertube_server list ->
string ->
Bushel_config.peertube_server optionFind a configured server that matches the URL's origin
val fetch_video_details :
http:Requests.t ->
endpoint:string ->
string ->
(video, string) Result.tval fetch_channel_videos :
http:Requests.t ->
endpoint:string ->
channel:string ->
?count:int ->
?start:int ->
unit ->
int * video listval fetch_all_channel_videos :
http:Requests.t ->
endpoint:string ->
channel:string ->
?page_size:int ->
unit ->
video listval thumbnail_url : string -> video -> string optionval download_thumbnail :
http:Requests.t ->
endpoint:string ->
video ->
string ->
fetch_resultmodule VideoIndex : sig ... endval try_fetch_from_server :
http:Requests.t ->
endpoint:string ->
output_path:string ->
string ->
fetch_result optionTry to fetch a video from a specific server
val try_all_servers :
http:Requests.t ->
servers:Bushel_config.peertube_server list ->
output_path:string ->
string ->
(Bushel_config.peertube_server * fetch_result) optionTry each server until one succeeds, return the server that worked
val fetch_thumbnails :
http:Requests.t ->
servers:Bushel_config.peertube_server list ->
output_dir:string ->
videos:Bushel.Video.t list ->
index:(string, string) Hashtbl.t ->
(string * fetch_result) listFetch thumbnails for videos, using URL field, index, or server discovery. Updates the index when servers are discovered.
val fetch_thumbnails_from_index :
http:Requests.t ->
servers:Bushel_config.peertube_server list ->
output_dir:string ->
(string, string) Hashtbl.t ->
(string * fetch_result) listLegacy function for compatibility - calls fetch_thumbnails with empty video list