mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
Update CruncyrollBridge.php
This commit is contained in:
parent
671b2948d8
commit
03681ae4b4
@ -47,28 +47,16 @@ class CrunchyrollBridge extends BridgeAbstract {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Define HTTP headers for the API request
|
// Define HTTP headers for the API request
|
||||||
$options = [
|
$headers = [
|
||||||
'http' => [
|
'User-Agent: Mozilla/5.0 (compatible; RSSBridge/2025)',
|
||||||
'method' => 'GET',
|
'Accept: application/json',
|
||||||
'header' => [
|
'Accept-Language: en-US,en;q=0.5',
|
||||||
'User-Agent: Mozilla/5.0 (compatible; RSSBridge/2025)',
|
'Origin: https://www.crunchyroll.com',
|
||||||
'Accept: application/json',
|
'Referer: https://www.crunchyroll.com/',
|
||||||
'Accept-Language: en-US,en;q=0.5',
|
|
||||||
'Origin: https://www.crunchyroll.com',
|
|
||||||
'Referer: https://www.crunchyroll.com/',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Create a context for the HTTP request
|
|
||||||
$context = stream_context_create($options);
|
|
||||||
|
|
||||||
// Fetch data from the API
|
// Fetch data from the API
|
||||||
$response = file_get_contents($apiUrl, false, $context);
|
$response = getContents($apiUrl, $headers);
|
||||||
|
|
||||||
if ($response === false) {
|
|
||||||
throw new Exception('Failed to fetch data from the Crunchyroll API.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse the JSON response
|
// Parse the JSON response
|
||||||
$data = json_decode($response, true);
|
$data = json_decode($response, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user