youtube: show cipher string for now - frontends - front-ends for some sites (experiment) (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit d278df39b1e6a28ada817813ecb6a2ed96817b90 (DIR) parent 4eef4fb9b890ae71f554e996a3a7a542302e68f4 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 24 Feb 2023 22:49:33 +0100 youtube: show cipher string for now Diffstat: M youtube/cli.c | 28 ++++++++++++++++++---------- M youtube/youtube.c | 2 ++ M youtube/youtube.h | 1 + 3 files changed, 21 insertions(+), 10 deletions(-) --- (DIR) diff --git a/youtube/cli.c b/youtube/cli.c @@ -229,27 +229,35 @@ render_video(struct video_response *r) #endif #if 0 - OUT("itag: "); - OUTESCAPE(f->itag); - OUT("\n"); - OUT("Last modified: "); OUTESCAPE(f->lastmodified); OUT("\n"); - - #endif - OUT("URL: "); - OUTESCAPE(f->url); - OUT("\n"); + if (f->url[0]) { + OUT("URL: "); + OUTESCAPE(f->url); + OUT("\n"); + } + + /* encrypted stream */ + if (f->signaturecipher[0]) { + OUT("Signature: "); + OUTESCAPE(f->signaturecipher); + OUT("\n"); + } if (f->mimetype[0]) { - OUT("Mime-type: "); + OUT("Mime: "); OUTESCAPE(f->mimetype); OUT("\n"); } + if (f->itag > 0) { + OUT("itag: "); + printf("%ld\n", f->itag); + } + if (f->qualitylabel[0]) { OUT("Quality: "); OUTESCAPE(f->qualitylabel); (DIR) diff --git a/youtube/youtube.c b/youtube/youtube.c @@ -335,6 +335,8 @@ processnode_video(struct json_node *nodes, size_t depth, const char *value, f->height = getnum(value); } else if (!strcmp(nodes[4].name, "url")) { strlcpy(f->url, value, sizeof(f->url)); + } else if (!strcmp(nodes[4].name, "signatureCipher")) { + strlcpy(f->signaturecipher, value, sizeof(f->signaturecipher)); } else if (!strcmp(nodes[4].name, "qualityLabel")) { strlcpy(f->qualitylabel, value, sizeof(f->qualitylabel)); } else if (!strcmp(nodes[4].name, "quality")) { (DIR) diff --git a/youtube/youtube.h b/youtube/youtube.h @@ -23,6 +23,7 @@ struct search_response { struct video_format { long itag; char url[2048]; + char signaturecipher[2048]; /* encrypted stream */ char mimetype[256]; /* mime-type and video codecs, etc */ long bitrate; long averagebitrate;