From 07a6ea723e9198a44173b934334d24c137e81e20 Mon Sep 17 00:00:00 2001 From: h0m3us3r Date: Tue, 29 Dec 2020 01:54:16 -0500 Subject: [PATCH 1/2] update replaceFromURL's user-agent to avoid TI ban --- .../UploadedFileBundle/Services/UploadedFileService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php b/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php index 24c43d16b..99cb83065 100644 --- a/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php +++ b/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php @@ -125,8 +125,8 @@ public function replaceFromURL(UploadedFile $file, $url) $header[] = 'Accept-Language: en-us,en;q=0.5'; $header[] = 'Pragma: '; - $browser = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092510 '; - $browser .= 'Ubuntu/8.04 (hardy) Firefox/3.0.3'; + $browser = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 '; + $browser .= '(KHTML, like Gecko) Version/14.0.1 Safari/605.1.15'; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, $browser); From 094d08c1dc2bca829ede1419e2f5169d336fbebc Mon Sep 17 00:00:00 2001 From: h0m3us3r Date: Wed, 30 Dec 2020 16:39:48 -0500 Subject: [PATCH 2/2] change user-agent to a more generic one --- .../UploadedFileBundle/Services/UploadedFileService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php b/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php index 99cb83065..74ea5fb76 100644 --- a/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php +++ b/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php @@ -125,8 +125,8 @@ public function replaceFromURL(UploadedFile $file, $url) $header[] = 'Accept-Language: en-us,en;q=0.5'; $header[] = 'Pragma: '; - $browser = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 '; - $browser .= '(KHTML, like Gecko) Version/14.0.1 Safari/605.1.15'; + $browser = 'Mozilla/5.0 (X11; Linux x86_64; rv:83.0) '; + $browser .= 'Gecko/20100101 Firefox/83.0'; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, $browser);