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