youtube.h - frontends - front-ends for some sites (experiment) (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- youtube.h (1771B) --- 1 struct item { 2 enum LinkType { Unknown = 0, Channel, Movie, Playlist, Video } linktype; 3 char id[32]; 4 char title[1024]; 5 char channeltitle[1024]; 6 char channelid[256]; 7 char userid[256]; 8 char publishedat[32]; /* "human-friendly" string */ 9 char viewcount[32]; /* view count string, formatted */ 10 char duration[32]; /* duration string */ 11 char shortdescription[4096]; 12 }; 13 14 #define MAX_VIDEOS 50 15 struct search_response { 16 struct item items[MAX_VIDEOS + 1]; 17 size_t nitems; 18 }; 19 20 struct video_format { 21 long itag; 22 char url[2048]; 23 char signaturecipher[2048]; /* encrypted stream */ 24 char mimetype[256]; /* mime-type and video codecs, etc */ 25 long bitrate; 26 long averagebitrate; 27 long width; /* pixel width */ 28 long height; /* pixel width */ 29 long fps; /* frames-per-second */ 30 char qualitylabel[64]; 31 char quality[64]; 32 long long contentlength; /* content length in bytes */ 33 long lastmodified; /* timestamp */ 34 long audiosamplerate; 35 long audiochannels; 36 }; 37 38 #define MAX_FORMATS 50 39 struct video_response { 40 char id[32]; /* video id */ 41 char title[1024]; 42 char author[1024]; /* channel name / title */ 43 char channelid[256]; 44 char publishdate[32]; /* YYYY-mm-dd */ 45 char uploaddate[32]; /* YYYY-mm-dd */ 46 long viewcount; 47 long lengthseconds; 48 char shortdescription[4096 * 4]; 49 char category[256]; 50 int isfamilysafe; 51 int isunlisted; 52 53 int isfound; 54 55 /* expiration for URLs in video formats */ 56 long expiresinseconds; 57 struct video_format formats[MAX_FORMATS + 1]; 58 int nformats; 59 }; 60 61 struct search_response *youtube_search(const char *rawsearch, const char *page, const char *order); 62 struct search_response *youtube_channel_videos(const char *channelid); 63 struct search_response *youtube_user_videos(const char *user); 64 struct video_response *youtube_video(const char *videoid);