From 459fe82b8d2949ce2e8906f790baa29abd0e89c0 Mon Sep 17 00:00:00 2001 From: Tufayel Ahmed <39314838+TufayelLUS@users.noreply.github.com> Date: Sun, 1 Nov 2020 16:04:40 +0600 Subject: [PATCH] Fixed download error by adding cookie support --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 9041e58..f1e8609 100644 --- a/index.php +++ b/index.php @@ -29,7 +29,7 @@ function downloadVideo($video_url, $geturl = false) CURLOPT_ENCODING => "utf-8", CURLOPT_AUTOREFERER => true, CURLOPT_COOKIEJAR => 'cookie.txt', - CURLOPT_COOKIEFILE => 'cookie.txt', + CURLOPT_COOKIEFILE => 'cookie.txt', CURLOPT_REFERER => 'https://www.tiktok.com/', CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_SSL_VERIFYHOST => false, @@ -81,7 +81,7 @@ function getContent($url, $geturl = false) CURLOPT_ENCODING => "utf-8", CURLOPT_AUTOREFERER => false, CURLOPT_COOKIEJAR => 'cookie.txt', - CURLOPT_COOKIEFILE => 'cookie.txt', + CURLOPT_COOKIEFILE => 'cookie.txt', CURLOPT_REFERER => 'https://www.tiktok.com/', CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_SSL_VERIFYHOST => false, @@ -122,6 +122,8 @@ function getContent($url, $geturl = false) CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0', CURLOPT_ENCODING => "utf-8", CURLOPT_AUTOREFERER => false, + CURLOPT_COOKIEJAR => 'cookie.txt', + CURLOPT_COOKIEFILE => 'cookie.txt', CURLOPT_REFERER => 'https://www.tiktok.com/', CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_SSL_VERIFYHOST => false,