Fixed HTTP REFERER issue when downloading

Unfortunately, it doesn't work for video with a watermark as no HTTP referer is passed when it is opened directly.
This commit is contained in:
Tufayel Ahmed 2020-09-18 14:12:52 +06:00 committed by GitHub
parent 4da5bd739a
commit 1d365f54a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,8 @@ function getContent($url, $geturl = false)
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_USERAGENT => 'okhttp',
CURLOPT_ENCODING => "utf-8",
CURLOPT_AUTOREFERER => true,
CURLOPT_AUTOREFERER => false,
CURLOPT_REFERER => 'https://www.tiktok.com/',
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
@ -49,7 +50,8 @@ function getContent($url, $geturl = false)
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0',
CURLOPT_ENCODING => "utf-8",
CURLOPT_AUTOREFERER => true,
CURLOPT_AUTOREFERER => false,
CURLOPT_REFERER => 'https://www.tiktok.com/',
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,