blob: c38c1f23ca212adcd61d61501f392d75b3cf9e32 (
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
33
34
35
36
|
#include <stdlib.h>
#include "../utils/utils.h"
#include "bilibili.h"
#include "extractor.h"
#include "haokan.h"
#include "youku.h"
Site_map site_map = {{{"www.bilibili.com", SITE_BILIBILI},
{"haokan.baidu.com", SITE_HAOKAN},
{"v.youku.com", SITE_YOUKU}},
3};
void options_cleanup(Options *options) {
free_and_nullify(options->URL);
free_and_nullify(options->path);
free_and_nullify(options->query);
free_and_nullify(options->pagedata);
}
int extract(void *v) {
Options *options = (Options *)v;
switch (options->site) {
case SITE_BILIBILI:
bilibili_extract(options);
break;
case SITE_HAOKAN:
haokan_extract(options);
break;
case SITE_YOUKU:
youku_extract(options);
break;
}
options_cleanup(options);
return 0;
}
|