summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2023-08-09 10:47:16 +0800
committerMole Shang <[email protected]>2023-08-09 10:47:16 +0800
commit9c2b0b39d73da02bb9d255e9dc7f81db200930b1 (patch)
treea3b0527938543a695745e1102e82bc048c79ff1c
parent9e733e6232d5047f08a3a9f5f4b7b5cbe2bf33d0 (diff)
downloadhinata-9c2b0b39d73da02bb9d255e9dc7f81db200930b1.tar.gz
hinata-9c2b0b39d73da02bb9d255e9dc7f81db200930b1.tar.bz2
hinata-9c2b0b39d73da02bb9d255e9dc7f81db200930b1.zip
process_url: always match substrings instead of comparing
-rw-r--r--src/extractors/extractor.c3
-rw-r--r--src/process_url.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/extractors/extractor.c b/src/extractors/extractor.c
index ccc1ec6..5317945 100644
--- a/src/extractors/extractor.c
+++ b/src/extractors/extractor.c
@@ -6,8 +6,7 @@
#include "haokan.h"
Site_map site_map = {
- {{"www.bilibili.com", SITE_BILIBILI}, {"haokan.baidu.com", SITE_HAOKAN}},
- 2};
+ {{"bilibili.com", SITE_BILIBILI}, {"haokan.baidu.com", SITE_HAOKAN}}, 2};
void options_cleanup(Options *options) {
free_and_nullify(options->URL);
diff --git a/src/process_url.c b/src/process_url.c
index a1204a1..35abf46 100644
--- a/src/process_url.c
+++ b/src/process_url.c
@@ -171,7 +171,7 @@ static int parse_url(const char *URL, const char *outdir, char *fn) {
DEBUG_PRINT("Query: %s\n", query);
for (unsigned short i = 0; i < site_map.size; i++) {
- if (!strcmp(domain, site_map.pairs[i].domain)) {
+ if (strstr(domain, site_map.pairs[i].domain)) {
append_log("Got site: %s\n", domain);
thrd_t t;
options.site = site_map.pairs[i].site;