diff options
Diffstat (limited to 'src/extractors/bilibili.h')
-rw-r--r-- | src/extractors/bilibili.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/extractors/bilibili.h b/src/extractors/bilibili.h new file mode 100644 index 0000000..5d609b0 --- /dev/null +++ b/src/extractors/bilibili.h @@ -0,0 +1,94 @@ +#ifndef BILIBILI_H_ +#define BILIBILI_H_ + +#include "../utils.h" +#include "extractor.h" +#include <stddef.h> + +#define BILIBILI_API "https://api.bilibili.com/x/player/playurl?" +#define BILIBILI_BANGUMI_API "https://api.bilibili.com/pgc/player/web/playurl?" +#define BILIBILI_TOKEN_API "https://api.bilibili.com/x/player/playurl/token?" + +typedef struct video_pages_data { + int cid; + char *part; + int page; +} Video_pages_data; + +typedef struct multipage_video_data { + char *title; + generic_array_t pages; +} Multipage_video_data; + +typedef struct episode { + int aid; + char *bvid; + int cid; + char *title; +} Episode; + +typedef struct multi_episode_data { + int season_id; + generic_array_t episodes; +} Multi_episode_data; + +typedef struct multipage { + int aid; + char *bvid; + generic_array_t sections; + Multipage_video_data videoData; + cJSON *json; +} Multipage; + +typedef struct bilibili_options { + char *url; + char *html; + char *api; + char *cookie; + bool is_bangumi; + bool is_page; + int aid; + int cid; + char *bvid; + int page; + char *title; +} Bilibili_options; + +typedef struct durl { + char *url; + size_t size; +} Durl; + +typedef struct dash_stream { + int id; + char *baseUrl; + int bandwidth; + char *mimeType; + int codecid; + char *codecs; +} Dash_stream; + +typedef struct dash_streams { + generic_array_t video; + generic_array_t audio; +} Dash_streams; + +typedef struct dash_info { + int quality; + str_array_t accept_description; + generic_array_t accept_quality; + Dash_streams dash; + char *format; + generic_array_t durl; +} Dash_info; + +typedef struct dash { + int code; + char *message; + Dash_info dashinfo; + cJSON *json; +} Dash; + +void bilibili_extract(struct options *); + +#endif |