Add (ai gen)

This commit is contained in:
2023-10-01 04:35:44 +08:00
parent fcfd320215
commit 165328b7fd
3 changed files with 23 additions and 17 deletions

View File

@@ -64,6 +64,7 @@ public static function handle(string $url, $directory, $postfix = null, $strip_h
->get($cached_url);
if ($response->successful()) {
//$costs['html_proxy'] = calculate_smartproxy_cost()
$raw_html = $response->body();
// ... your logic here ...
} else {
@@ -274,7 +275,7 @@ private static function filterImages(array $images, string $proxy, string $user_
];
$image['color_counts'] = self::isMostlyTextBasedOnUniqueColors($interventionImage);
//$image['img'] = $interventionImage;
$costs['count-'.$count] = calculate_smartproxy_cost($sizeKb);
$costs['count-'.$count] = calculate_smartproxy_cost($sizeKb, 'rotating_global');
$filteredImages[] = $image;
@@ -357,7 +358,7 @@ private static function getProductImage(array $jsonLdData, string $proxy, string
$sizeInKb = strlen($interventionImage->encode()) / 1024; // Convert bytes to kilobytes
// Calculate the cost
$cost = calculate_smartproxy_cost($sizeInKb);
$cost = calculate_smartproxy_cost($sizeInKb, 'rotating_global');
$costs['product_image'] = $cost;