diff options
Diffstat (limited to 'ytdlsb-main.c')
| -rw-r--r-- | ytdlsb-main.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ytdlsb-main.c b/ytdlsb-main.c index 8db1ad0..7b0c0f8 100644 --- a/ytdlsb-main.c +++ b/ytdlsb-main.c @@ -181,10 +181,11 @@ int ytdlsb_process_preload(struct ytdlsb_task *t){ CURLINFO_CONTENT_TYPE, &mtype)); if(respc == 200){ f->state = YTDLSB_SB_FAILED; - if(!mtype - || strcmp(mtype, "application/octet-stream") == 0 - || strcmp(mtype, "binary/octet-stream") == 0 - ){ + if(mtype && strcmp(mtype, "image/jpeg") == 0){ + f->state = YTDLSB_SB_JPEG; + }else if(mtype && strcmp(mtype, "image/webp") == 0){ + f->state = YTDLSB_SB_WEBP; + }else{ // twitch returns jpeg images in binary/octet-stream if(f->data && f->data_len >= 12){ if(memcmp(f->data, "\xff\xd8", 2) == 0){ @@ -196,10 +197,6 @@ int ytdlsb_process_preload(struct ytdlsb_task *t){ f->state = YTDLSB_SB_WEBP; } } - }else if(strcmp(mtype, "image/jpeg") == 0){ - f->state = YTDLSB_SB_JPEG; - }else if(strcmp(mtype, "image/webp") == 0){ - f->state = YTDLSB_SB_WEBP; } if(f->state == YTDLSB_SB_FAILED){ eprintf("invalid storyboard type: %s\n", mtype); |
