Use cookie frontend over config frontend

This commit is contained in:
davidovski 2023-08-24 15:45:45 +01:00
parent 5ce0f2ccd0
commit 508ac0c576
2 changed files with 11 additions and 12 deletions

View File

@ -15,7 +15,7 @@
if ($response["type"] == "video") {
$title = $response["title"];
$url = "https://youtube.com/watch?v=" . $response["videoId"];
$url = check_for_privacy_frontend($url, $this-opts);
$url = check_for_privacy_frontend($url, $this->opts);
$uploader = $response["author"];
$views = $response["viewCount"];
$date = $response["publishedText"];

View File

@ -6,19 +6,19 @@
$this->opts = $opts;
$url = $this->get_request_url();
error_log($url);
if ($url) {
$this->ch = curl_init($url);
if (!$url)
return;
if ($opts->curl_settings)
curl_setopt_array($this->ch, $opts->curl_settings);
$this->ch = curl_init($url);
if ($mh)
curl_multi_add_handle($mh, $this->ch);
}
if ($opts->curl_settings)
curl_setopt_array($this->ch, $opts->curl_settings);
if ($mh)
curl_multi_add_handle($mh, $this->ch);
}
public function get_request_url(){
public function get_request_url() {
return "";
}
@ -55,8 +55,7 @@
$opts->number_of_results ??= trim(htmlspecialchars($_COOKIE["number_of_results"]));
foreach (array_keys($opts->frontends ?? array()) as $frontend) {
if (!$opts->frontends[$frontend]["instance_url"])
$opts->frontends[$frontend]["instance_url"] = $_COOKIE[$frontend] ?? "";
$opts->frontends[$frontend]["instance_url"] = $_COOKIE[$frontend] ?? $opts->frontends[$frontend]["instance_url"];
}
return $opts;
}