summaryrefslogtreecommitdiff
path: root/src/extractors/extractor.h
blob: 9daf0ff28fdf770d77a0c863cfab68f13c9af9a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef EXTRACTOR_H_
#define EXTRACTOR_H_

#include <cjson/cJSON.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>

enum site { SITE_BILIBILI, SITE_HAOKAN, SITE_YOUKU };
typedef enum site site_t;

typedef struct site_map {
  struct {
    char domain[SHRT_MAX];
    site_t site;
  } pairs[3];
  unsigned char size;
} Site_map;

typedef struct options {
  site_t site;
  char *URL;
  char *path;
  char *query;
  char *pagedata;
} Options;

void options_cleanup(Options *);

int extract(void *);

#endif