···147147 let mut embed_embeds = Vec::new();
148148 for blob in blobs {
149149 println!("blob: {:?}", blob);
150150- // todo: get blob url? - might have to cook our own "API" for this as bsky's require auth
151151- // for images we might get away with a simple CDN url, although those have bad quality
150150+ let url = format!("https://bsky.social/xrpc/com.atproto.sync.getBlob?did={}&cid={}", did, blob.r#ref.0);
151151+ if blob.mime_type.starts_with("image/") {
152152+ embed_embeds.push(EmbedEmbed::Image(url));
153153+ } else {
154154+ embed_embeds.push(EmbedEmbed::Video(url));
155155+ }
152156 }
153157154158 println!("embed embeds aaa: {:?}", &embed_embeds);
+5
src/meow.rs
···33use rocket::{response, Request, Response};
44use serde::ser::SerializeMap;
55use serde::Serialize;
66+use std::str::FromStr;
67use thiserror::Error;
7889#[derive(Debug)]
···5859 r#"<meta property="og:video:secure_url" content="{}">"#,
5960 url
6061 ));
6262+ html.push('\n');
6363+ // THIS IS NEEDED FOR DISCORD !!
6464+ // todo: maybe don't hardcode video/mp4 as content type for all videos?
6565+ html.push_str(r#"<meta property="og:video:type" content="video/mp4">"#)
6166 }
6267 }
6368 }