Fixed download error by adding cookie support

This commit is contained in:
Tufayel Ahmed 2020-11-01 16:04:40 +06:00 committed by GitHub
parent 27e3b9ff36
commit 459fe82b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,