I have this code to fetch links from fastream.to, but it only brings the lowest quality. I want it to bring the highest quality available. Here is the code:
```php
<?php
function curl_url($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_REFERER, 'https://google.com');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36');
$resp = curl_exec($ch);
curl_close($ch);
return $resp;
}
$url = 'https://fastream.to/api/file/direct_link?key=3370psbgmln6y12029v0&file_code=zoxznqxz362d';
$get = curl_url($url);
$json = json_decode($get, true);
if(!empty($json['result']['versions'][0]['url'])){
$video_url = $json['result']['versions'][0]['url'];
header('Location: '.$video_url);
}
?>
```
```php
<?php
function curl_url($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_REFERER, 'https://google.com');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36');
$resp = curl_exec($ch);
curl_close($ch);
return $resp;
}
$url = 'https://fastream.to/api/file/direct_link?key=3370psbgmln6y12029v0&file_code=zoxznqxz362d';
$get = curl_url($url);
$json = json_decode($get, true);
if(!empty($json['result']['versions'][0]['url'])){
$video_url = $json['result']['versions'][0]['url'];
header('Location: '.$video_url);
}
?>
```