From 9d44f64a23552d420abefb8c952fec34e49f4ea0 Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Wed, 9 Aug 2023 17:33:03 +0800 Subject: Revert "process_url: always match substrings instead of comparing" Target video files can also be under the domain, revert the commit for now. Needs further implemention. This reverts commit 9c2b0b39d73da02bb9d255e9dc7f81db200930b1. --- src/extractors/extractor.c | 3 ++- src/process_url.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/extractors/extractor.c b/src/extractors/extractor.c index 5317945..ccc1ec6 100644 --- a/src/extractors/extractor.c +++ b/src/extractors/extractor.c @@ -6,7 +6,8 @@ #include "haokan.h" Site_map site_map = { - {{"bilibili.com", SITE_BILIBILI}, {"haokan.baidu.com", SITE_HAOKAN}}, 2}; + {{"www.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 c20b3eb..7723d45 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 (strstr(domain, site_map.pairs[i].domain)) { + if (!strcmp(domain, site_map.pairs[i].domain)) { append_log("Got site: %s\n", domain); thrd_t t; options.site = site_map.pairs[i].site; -- cgit v1.2.3