( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/..//googlefonttoFile.php
<?php


include('Connections/videoondemand.php');
require("DbSql2.inc.php");
require("NewsSql2.inc.php");
$db = new NewsSQL;
//a class to handle database operations
ini_set('max_execution_time', 300000); //300 seconds = 5 minutes

error_reporting(1);

 function downloadFile($url, $path)
{
    $newfname = $path;
    $file = fopen ($url, 'rb');
    if ($file) {
        $newf = fopen ($newfname, 'wb');
        if ($newf) {
            while(!feof($file)) {
                fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
            }
        }
    }
    if ($file) {
        fclose($file);
    }
    if ($newf) {
        fclose($newf);
    }
}
include("assets/fonts/google-fonts-v2.php");
$data = json_decode($json , true);
//print_r($data);

$count = 0;
 foreach ($data["fonts"] as $row) {
             $count++;
             $id = $row['id'];
           $family = $row['family'];
           $fullName = $row['fullName'];
           $postScriptName = $row['postScriptName'];
           $preview = $row['preview'];
           $style = $row['style'];
           $url = $row['url'];
           $category = $row['category'];

         echo "<br>";
         echo "<br>";
         if($count > 0 && $count < 5700) {
         $path = $url;
         $file_name = basename($path);
             $destinationFilePath = '/var/www/html/assets/gfonts2/' . $file_name;
             if (!file_exists($destinationFilePath)) {

                 downloadFile($url, $destinationFilePath);
                 echo "downloaded".$file_name."<br>";

         }


     }



 }