So i solved my problem by using cURL, I added this
function curl_get_contents($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
And changed
$html = file_get_contents( $link, false, $context );
$html = file_get_contents( str_ireplace( 'https://', 'https://', $link ), false, $context );
$html = file_get_contents( $link , false, $context );
To
$html = curl_get_contents( $link );
$html = curl_get_contents( str_ireplace( 'https://', 'https://', $link ) );
$html = curl_get_contents( $link );