mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-01 00:32:05 +00:00
feat: add Misskey (misskey.io) fetch support
Fourth site adapter: POST /api/notes/show, renote-aware caption and media normalization, DriveFile type → Illustration/Animated/Video. Empty thumbnailUrl strings filtered out in thumbnail_for.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub(crate) struct Note {
|
||||
pub(crate) id: String,
|
||||
pub(crate) text: Option<String>,
|
||||
#[serde(default)]
|
||||
pub(crate) cw: Option<String>,
|
||||
pub(crate) user: User,
|
||||
#[serde(default)]
|
||||
pub(crate) files: Vec<DriveFile>,
|
||||
/// Embedded original note when this note is a renote; the shell's own
|
||||
/// text/files are usually empty and the content lives here.
|
||||
#[serde(default)]
|
||||
pub(crate) renote: Option<Box<Note>>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub(crate) struct User {
|
||||
pub(crate) name: Option<String>,
|
||||
pub(crate) username: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub(crate) struct DriveFile {
|
||||
#[serde(rename = "type")]
|
||||
pub(crate) mime_type: String,
|
||||
pub(crate) url: String,
|
||||
#[serde(default, rename = "thumbnailUrl")]
|
||||
pub(crate) thumbnail_url: Option<String>,
|
||||
#[serde(default, rename = "isSensitive")]
|
||||
pub(crate) is_sensitive: bool,
|
||||
#[serde(default)]
|
||||
pub(crate) name: Option<String>,
|
||||
}
|
||||
Reference in New Issue
Block a user