@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // Initialize session with age verification cookies |
| 84 | 84 | $this->initializeSession(); |
| 85 | 85 | |
| 86 | - $searchUrl = self::BASE_URL . self::SEARCH_URL . rawurlencode($movie); |
|
| 86 | + $searchUrl = self::BASE_URL.self::SEARCH_URL.rawurlencode($movie); |
|
| 87 | 87 | $response = $this->fetchHtml($searchUrl, $this->cookie); |
| 88 | 88 | |
| 89 | 89 | if ($response === false) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $highestSimilarity = $similarity; |
| 120 | 120 | $bestMatch = [ |
| 121 | 121 | 'title' => trim($title), |
| 122 | - 'url' => str_starts_with($url, 'http') ? $url : self::BASE_URL . $url, |
|
| 122 | + 'url' => str_starts_with($url, 'http') ? $url : self::BASE_URL.$url, |
|
| 123 | 123 | ]; |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | if ($trailersResponse !== false) { |
| 198 | 198 | if (preg_match("/([\"|'])(?P<swf>[^\"']+.swf)([\"|'])/i", $trailersResponse, $hits)) { |
| 199 | - $res['trailers']['url'] = self::BASE_URL . trim(trim($hits['swf']), '"'); |
|
| 199 | + $res['trailers']['url'] = self::BASE_URL.trim(trim($hits['swf']), '"'); |
|
| 200 | 200 | |
| 201 | 201 | if (preg_match('#(?:streamID:\s\")(?P<streamid>[0-9A-Z]+)(?:\")#', $trailersResponse, $hits)) { |
| 202 | 202 | $res['trailers']['streamid'] = trim($hits['streamid']); |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | usleep(300000); // 300ms delay |
| 388 | 388 | |
| 389 | 389 | } catch (\Exception $e) { |
| 390 | - \Illuminate\Support\Facades\Log::debug('ADE session initialization: ' . $e->getMessage()); |
|
| 390 | + \Illuminate\Support\Facades\Log::debug('ADE session initialization: '.$e->getMessage()); |
|
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | if (isset(self::$lastRequestTime[$providerName])) { |
| 178 | 178 | $elapsed = $now - self::$lastRequestTime[$providerName]; |
| 179 | 179 | if ($elapsed < $this->rateLimitDelay) { |
| 180 | - usleep((int)(($this->rateLimitDelay - $elapsed) * 1000)); |
|
| 180 | + usleep((int) (($this->rateLimitDelay - $elapsed) * 1000)); |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -250,12 +250,12 @@ discard block |
||
| 250 | 250 | return null; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - $cacheKey = 'adult_search_' . $this->getName() . '_' . md5(strtolower($movie)); |
|
| 253 | + $cacheKey = 'adult_search_'.$this->getName().'_'.md5(strtolower($movie)); |
|
| 254 | 254 | $cached = Cache::get($cacheKey); |
| 255 | 255 | |
| 256 | 256 | if ($cached !== null) { |
| 257 | 257 | if ($this->echoOutput) { |
| 258 | - $this->getColorCli()->info('Using cached result for: ' . $movie); |
|
| 258 | + $this->getColorCli()->info('Using cached result for: '.$movie); |
|
| 259 | 259 | } |
| 260 | 260 | return $cached; |
| 261 | 261 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | return; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $cacheKey = 'adult_search_' . $this->getName() . '_' . md5(strtolower($movie)); |
|
| 275 | + $cacheKey = 'adult_search_'.$this->getName().'_'.md5(strtolower($movie)); |
|
| 276 | 276 | Cache::put($cacheKey, $result, now()->addMinutes($this->cacheDuration)); |
| 277 | 277 | } |
| 278 | 278 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | // Check for common error pages |
| 323 | 323 | if ($this->isErrorPage($body)) { |
| 324 | - Log::warning('Received error page from ' . $this->getName() . ': ' . $url); |
|
| 324 | + Log::warning('Received error page from '.$this->getName().': '.$url); |
|
| 325 | 325 | if ($attempt < $this->maxRetries) { |
| 326 | 326 | usleep($this->retryDelay * 1000); |
| 327 | 327 | continue; |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $this->httpClient = null; |
| 343 | 343 | $this->cookieJar = null; |
| 344 | 344 | |
| 345 | - Log::info('Refreshed age verification cookies for ' . $this->getName() . ', retrying...'); |
|
| 345 | + Log::info('Refreshed age verification cookies for '.$this->getName().', retrying...'); |
|
| 346 | 346 | continue; |
| 347 | 347 | } |
| 348 | 348 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | } catch (ConnectException $e) { |
| 358 | 358 | $lastException = $e; |
| 359 | - Log::warning('Connection failed for ' . $this->getName() . ' (attempt ' . $attempt . '): ' . $e->getMessage()); |
|
| 359 | + Log::warning('Connection failed for '.$this->getName().' (attempt '.$attempt.'): '.$e->getMessage()); |
|
| 360 | 360 | |
| 361 | 361 | if ($attempt < $this->maxRetries) { |
| 362 | 362 | usleep($this->retryDelay * 1000 * $attempt); // Exponential backoff |
@@ -367,11 +367,11 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | // Don't retry on 4xx client errors (except 429 rate limit) |
| 369 | 369 | if ($statusCode >= 400 && $statusCode < 500 && $statusCode !== 429) { |
| 370 | - Log::error('HTTP ' . $statusCode . ' for ' . $this->getName() . ': ' . $url); |
|
| 370 | + Log::error('HTTP '.$statusCode.' for '.$this->getName().': '.$url); |
|
| 371 | 371 | return false; |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | - Log::warning('Request failed for ' . $this->getName() . ' (attempt ' . $attempt . '): ' . $e->getMessage()); |
|
| 374 | + Log::warning('Request failed for '.$this->getName().' (attempt '.$attempt.'): '.$e->getMessage()); |
|
| 375 | 375 | |
| 376 | 376 | if ($attempt < $this->maxRetries) { |
| 377 | 377 | // Longer delay for rate limit errors |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | } catch (\Exception $e) { |
| 382 | 382 | $lastException = $e; |
| 383 | - Log::error('Unexpected error for ' . $this->getName() . ': ' . $e->getMessage()); |
|
| 383 | + Log::error('Unexpected error for '.$this->getName().': '.$e->getMessage()); |
|
| 384 | 384 | |
| 385 | 385 | if ($attempt < $this->maxRetries) { |
| 386 | 386 | usleep($this->retryDelay * 1000); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | if ($lastException) { |
| 392 | - Log::error('All retry attempts failed for ' . $this->getName() . ': ' . $lastException->getMessage()); |
|
| 392 | + Log::error('All retry attempts failed for '.$this->getName().': '.$lastException->getMessage()); |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | return false; |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | ]; |
| 475 | 475 | |
| 476 | 476 | foreach ($contentIndicators as $pattern) { |
| 477 | - if (preg_match('/' . $pattern . '/is', $html)) { |
|
| 477 | + if (preg_match('/'.$pattern.'/is', $html)) { |
|
| 478 | 478 | return false; // This is a content page, not an age verification page |
| 479 | 479 | } |
| 480 | 480 | } |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | // Re-initialize cookies from the manager and retry |
| 534 | 534 | if ($this->cookieJar) { |
| 535 | 535 | // The manager already handles setting cookies, but let's ensure they're fresh |
| 536 | - Log::info('Attempting to handle age verification for ' . $this->getName() . ' with domain: ' . $domain); |
|
| 536 | + Log::info('Attempting to handle age verification for '.$this->getName().' with domain: '.$domain); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | // Try to find and submit age verification form |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | if (!empty($postData)) { |
| 557 | 557 | $submitUrl = $action; |
| 558 | 558 | if (!str_starts_with($submitUrl, 'http')) { |
| 559 | - $submitUrl = $this->getBaseUrl() . '/' . ltrim($submitUrl, '/'); |
|
| 559 | + $submitUrl = $this->getBaseUrl().'/'.ltrim($submitUrl, '/'); |
|
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | // Submit the age verification |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | return $body; |
| 574 | 574 | } |
| 575 | 575 | } catch (\Exception $e) { |
| 576 | - Log::warning('Age verification submission failed for ' . $this->getName() . ': ' . $e->getMessage()); |
|
| 576 | + Log::warning('Age verification submission failed for '.$this->getName().': '.$e->getMessage()); |
|
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | 579 | } |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | if (!empty($matches[1])) { |
| 587 | 587 | $enterUrl = $matches[1]; |
| 588 | 588 | if (!str_starts_with($enterUrl, 'http')) { |
| 589 | - $enterUrl = $this->getBaseUrl() . '/' . ltrim($enterUrl, '/'); |
|
| 589 | + $enterUrl = $this->getBaseUrl().'/'.ltrim($enterUrl, '/'); |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | try { |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | return $body; |
| 600 | 600 | } |
| 601 | 601 | } catch (\Exception $e) { |
| 602 | - Log::warning('Age verification link follow failed for ' . $this->getName() . ': ' . $e->getMessage()); |
|
| 602 | + Log::warning('Age verification link follow failed for '.$this->getName().': '.$e->getMessage()); |
|
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | 605 | } |
@@ -616,11 +616,11 @@ discard block |
||
| 616 | 616 | return $body; |
| 617 | 617 | } |
| 618 | 618 | } catch (\Exception $e) { |
| 619 | - Log::warning('Age verification retry failed for ' . $this->getName() . ': ' . $e->getMessage()); |
|
| 619 | + Log::warning('Age verification retry failed for '.$this->getName().': '.$e->getMessage()); |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | // If we couldn't handle age verification, log and return false |
| 623 | - Log::warning('Could not handle age verification for ' . $this->getName() . ': ' . $url); |
|
| 623 | + Log::warning('Could not handle age verification for '.$this->getName().': '.$url); |
|
| 624 | 624 | return false; |
| 625 | 625 | } |
| 626 | 626 | |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | */ |
| 811 | 811 | protected function outputMatch(string $title): void |
| 812 | 812 | { |
| 813 | - if (! $this->echoOutput) { |
|
| 813 | + if (!$this->echoOutput) { |
|
| 814 | 814 | return; |
| 815 | 815 | } |
| 816 | 816 | |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | */ |
| 823 | 823 | protected function outputNotFound(): void |
| 824 | 824 | { |
| 825 | - if (! $this->echoOutput) { |
|
| 825 | + if (!$this->echoOutput) { |
|
| 826 | 826 | return; |
| 827 | 827 | } |
| 828 | 828 | |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | ]; |
| 868 | 868 | |
| 869 | 869 | foreach ($metaTags as $property => $key) { |
| 870 | - $meta = $this->getHtmlParser()->findOne('meta[property="' . $property . '"]'); |
|
| 870 | + $meta = $this->getHtmlParser()->findOne('meta[property="'.$property.'"]'); |
|
| 871 | 871 | if ($meta && isset($meta->content)) { |
| 872 | 872 | $og[$key] = trim($meta->content); |
| 873 | 873 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | // Initialize session with age verification |
| 85 | 85 | $this->initializeSession(); |
| 86 | 86 | |
| 87 | - $searchUrl = self::BASE_URL . self::SEARCH_URL . urlencode($movie) . self::EXTRA_SEARCH; |
|
| 87 | + $searchUrl = self::BASE_URL.self::SEARCH_URL.urlencode($movie).self::EXTRA_SEARCH; |
|
| 88 | 88 | $response = $this->fetchHtml($searchUrl, $this->cookie); |
| 89 | 89 | |
| 90 | 90 | if ($response === false) { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $highestSimilarity = $similarity; |
| 121 | 121 | $bestMatch = [ |
| 122 | 122 | 'title' => trim($title), |
| 123 | - 'url' => str_starts_with($url, 'http') ? $url : self::BASE_URL . $url, |
|
| 123 | + 'url' => str_starts_with($url, 'http') ? $url : self::BASE_URL.$url, |
|
| 124 | 124 | ]; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | usleep(300000); // 300ms delay |
| 354 | 354 | |
| 355 | 355 | } catch (\Exception $e) { |
| 356 | - \Illuminate\Support\Facades\Log::debug('HotMovies session initialization: ' . $e->getMessage()); |
|
| 356 | + \Illuminate\Support\Facades\Log::debug('HotMovies session initialization: '.$e->getMessage()); |
|
| 357 | 357 | } |
| 358 | 358 | } |
| 359 | 359 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // First, establish a session by visiting the AgeConfirmation endpoint to set cookies |
| 84 | 84 | $this->acceptAgeVerification(); |
| 85 | 85 | |
| 86 | - $searchUrl = self::BASE_URL . self::SEARCH_ENDPOINT . urlencode($movie); |
|
| 86 | + $searchUrl = self::BASE_URL.self::SEARCH_ENDPOINT.urlencode($movie); |
|
| 87 | 87 | $response = $this->fetchHtml($searchUrl, $this->cookie); |
| 88 | 88 | |
| 89 | 89 | if (empty($response)) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $highestSimilarity = $similarity; |
| 118 | 118 | $bestMatch = [ |
| 119 | 119 | 'title' => trim($title), |
| 120 | - 'url' => str_starts_with($url, 'http') ? $url : self::BASE_URL . $url, |
|
| 120 | + 'url' => str_starts_with($url, 'http') ? $url : self::BASE_URL.$url, |
|
| 121 | 121 | ]; |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | |
| 481 | 481 | // First, make a request that disables redirects to see where we're being sent |
| 482 | 482 | try { |
| 483 | - $response = $client->get(self::BASE_URL . '/', [ |
|
| 483 | + $response = $client->get(self::BASE_URL.'/', [ |
|
| 484 | 484 | 'headers' => $this->getDefaultHeaders(), |
| 485 | 485 | 'allow_redirects' => false, |
| 486 | 486 | 'http_errors' => false, |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | // The redirect URL includes ?url2= parameter, we need to visit it |
| 497 | 497 | $ageConfirmUrl = $location; |
| 498 | 498 | if (!str_starts_with($ageConfirmUrl, 'http')) { |
| 499 | - $ageConfirmUrl = self::BASE_URL . $ageConfirmUrl; |
|
| 499 | + $ageConfirmUrl = self::BASE_URL.$ageConfirmUrl; |
|
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | // Visit the age confirmation page |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | 'http_errors' => false, |
| 507 | 507 | ]); |
| 508 | 508 | |
| 509 | - \Illuminate\Support\Facades\Log::debug('PopPorn age confirmation visited: ' . $ageConfirmUrl); |
|
| 509 | + \Illuminate\Support\Facades\Log::debug('PopPorn age confirmation visited: '.$ageConfirmUrl); |
|
| 510 | 510 | } |
| 511 | 511 | } |
| 512 | 512 | } catch (\Exception $e) { |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | |
| 519 | 519 | } catch (\Exception $e) { |
| 520 | 520 | // Log but don't fail - we'll try the search anyway |
| 521 | - \Illuminate\Support\Facades\Log::debug('PopPorn age verification setup: ' . $e->getMessage()); |
|
| 521 | + \Illuminate\Support\Facades\Log::debug('PopPorn age verification setup: '.$e->getMessage()); |
|
| 522 | 522 | } |
| 523 | 523 | } |
| 524 | 524 | } |