From 77b6102e84ecbf1bf06e6f04b784b9a9539dc4e7 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Sun, 21 Aug 2022 14:18:03 -0600 Subject: [PATCH] add video templating --- main.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/main.c b/main.c index 591b822..c24ef42 100644 --- a/main.c +++ b/main.c @@ -255,6 +255,49 @@ int fphimg(FILE* f, char* s) { return 1; } +int fpvideo(FILE* f, char* s) { + char id[1024] = {0}; + char href[1024] = {0}; + char src[1024] = {0}; + char alt[1024] = {0}; + char thumb[1024] = {0}; + + char* c = s; + int i = 0; + while (i < 4) { + if (*c == '|' || !(*c)) { + i++; + c++; + continue; + } + switch (i) { + case 0: + ccat(id, *c++); + break; + case 1: + ccat(href, *c++); + break; + case 2: + ccat(src, *c++); + break; + case 3: + ccat(alt, *c++); + break; + } + } + thumbtrans(src, thumb); + + fprintf( + f, + "\n"); + return 1; +} + int fpaudio(FILE* f, char* s) { fputs("