<?php
header('Content-Type: application/json');

/*
|--------------------------------------------------------------------------
| SECRET KEY (শুধু play.php জানবে)
|--------------------------------------------------------------------------
*/
$SECRET_KEY = 'eplayhd_2026';

/*
|--------------------------------------------------------------------------
| 1️⃣ Secret key check (সবচেয়ে জরুরি)
|--------------------------------------------------------------------------
*/
if (!isset($_GET['key']) || $_GET['key'] !== $SECRET_KEY) {
    http_response_code(403);
    echo json_encode(['error' => 'Forbidden']);
    exit;
}

/*
|--------------------------------------------------------------------------
| 2️⃣ Allowed domain check (extra security)
|--------------------------------------------------------------------------
*/
$allowedDomains = [
    'eplayhd.com',
    'cricfoots.com'
];

$referrer = $_SERVER['HTTP_REFERER'] ?? '';
$host = parse_url($referrer, PHP_URL_HOST);

$allowed = false;
foreach ($allowedDomains as $domain) {
    if ($host && stripos($host, $domain) !== false) {
        $allowed = true;
        break;
    }
}

if (!$allowed) {
    http_response_code(403);
    echo json_encode(['error' => 'Unauthorized domain']);
    exit;
}

/*
|--------------------------------------------------------------------------
| 3️⃣ Channel data
|--------------------------------------------------------------------------
*/
$channels = [
    'tnt3' => [
        'name' => 'TNT 3',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://ottb.live.cf.ww.aiv-cdn.net/lhr-nitro/live/dash/enc/lsdasbvglv/out/v1/bb548a3626cd4708afbb94a58d71dce9/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'a93c1cbfdccd23233bac13540c693e7f' => '2f6ab2e6693eb847eff3c9da8f9d01fc'
            ]
        ]
    ], 
    
    
    'skypremier' => [
        'name' => 'Sky Premier',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://abe4mdzaaaaaaaampzanwc57oxzti.otte.live.cf.ww.aiv-cdn.net/lhr-nitro/live/clients/dash/enc/9o6jmlyjpm/out/v1/ad80a9bfecc6438f82f2af41c58d7fb8/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'ca4316630f56d6f33e9ff73b7ad211d1' => '72c54e5646055f444e99bc1123919e89'
            ]
        ]
    ],
    
    

'cbs' => [
        'name' => 'CBS Sports',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://ottb.live.cf.ww.aiv-cdn.net/lhr-nitro/live/clients/dash/enc/rbem8rorcw/out/v1/5318821e2c3c44c2a439681b9aa86e9b/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'd9623774ac5c8c351aafe97c5fe70267' => '5164e6d05164a2d65fa8fcc962aa4861'
            ]
        ]
    ],    



'fubo1' => [
        'name' => 'Fubo 1',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://abm5x5xaaaaaaaamjgudev5k44qb3.otte.live.cf.ww.aiv-cdn.net/pdx-nitro/live/clients/dash/enc/3b7qwiqzk3/out/v1/9f14895badca43e6a716db021dcd0c31/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'dc69b6159a0f9f0a4e03b3ff91cbacd5' => 'd0dcbcd7723bc40df0bf34c9c092d51f'
            ]
        ]
    ], 


'fubo2' => [
        'name' => 'TNT Sports 2',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://otte.cache.aiv-cdn.net/bom-nitro/live/clients/dash/enc/iayg0kyrof/out/v1/91dc04907f56415b897faccfa9d252da/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '1223d5105392cabf1bb9c2c1fdf6539a' => '340b409f4b8f78a343e0363a7938df38'
            ]
        ]
    ],

    
   'fubo3' => [
        'name' => 'Fubo 3',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://a122aivottlinear-a.akamaihd.net/OTTB/lhr-nitro/live/clients/dash/enc/loriybwupj/out/v1/bf776668825447539220300ccce9bd77/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'f2bead1a52a4158a5c1a54f37ccf84e5' => '7df878181417ca34041d0e6d89c2e95a'
            ]
        ]
    ], 


'fubo4' => [
        'name' => 'Fubo 4',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://a122aivottlinear-a.akamaihd.net/OTTB/lhr-nitro/live/clients/dash/enc/39pdxu2c9d/out/v1/8568039930fe48c5ac249642f167e694/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'c1e7601b13d9674e6824ef26f578766c' => '7c94319f024f378ea751039224f6d618'
            ]
        ]
    ], 
    
'laliga' => [
        'name' => 'La Liga',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://abclxdjaaaaaaaamkqb6y4p6ie2zk.ottb.live.cf.ww.aiv-cdn.net/dub-nitro/live/clients/dash/enc/k0duzgfejg/out/v1/70a50b1bda944628b8e7e66ab4069419/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '620e51b82596475517a27aa425c52280' => '2b9ba811e9c5aeafc8ae1b71cdca4d6a'
            ]
        ]
    ],    
    
    
'tnt1' => [
        'name' => 'TNT Sports 1',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://ottb.live.cf.ww.aiv-cdn.net/lhr-nitro/live/dash/enc/wf8usag51e/out/v1/bd3b0c314fff4bb1ab4693358f3cd2d3/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                'd0f2e5c39e70c18f29bf77768a1ad89a' => 'd6853c51fcf37a18905f0609972395d7'
            ]
        ]
    ], 


'tnt2' => [
        'name' => 'TNT Sports 2',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://ottb.live.cf.ww.aiv-cdn.net/lhr-nitro/live/dash/enc/f0qvkrra8j/out/v1/f8fa17f087564f51aa4d5c700be43ec4/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '9f51f3dc6313ac8bc668e2d9d1c04dfa' => '74bc63e5a193454a91ca494975db33f9'
            ]
        ]
    ], 



'prime' => [
        'name' => 'Prime',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://otte.cache.aiv-cdn.net/bom-nitro/live/clients/dash/enc/ptptpteoh7/out/v1/564bb083afea4561a5a60c4447258379/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '470a5bda0ae8965c3ab4004c302bc1c8' => 'b04888df6ed570c9435b97471504bd9b'
            ]
        ]
    ],


'tnt4' => [
        'name' => 'tnt4',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://ottb.live.cf.ww.aiv-cdn.net/lhr-nitro/live/dash/enc/i2pcjr4pe5/out/v1/912e9db56d75403b8a9ac0a719110f36/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '192b1115da041585c77200128549efa1' => '634e10efe4abbb14be400a3ccbac0258'
            ]
        ]
    ],    
    
    
'tnt5' => [
        'name' => 'TNT Sports 2',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://mag03.tvx.prd.tv.odido.nl/wh7f454c46tw266117884_-1972819316/PLTV/86/224/3221241560/3221241560.mpd?accountinfo=~~V2.0~OhA1DF4svOZppKxb-t-Ngw144cce44121c63284a33d5453493e5c8~1_Fmlu5PevHMYnEi9Z_HX2goKAd0VHSuxZMoIcAXcawYvG1meqGp2eQ2Ibhjvh7e59e7f6df3d57f23a32024ad67f0f19dc:UTC',
        'drm'  => [
            'clearKeys' => [
                '3cfa8625f650406ebf6a4d1ea737f572' => '0534e747c70b364aa7210e1bf3191df0'
            ]
        ]
    ],    
    
'bein2' => [
        'name' => 'Bein Sports 2',
        'logo' => 'https://cdn2.eplayhd.com/icon/eplaylogo.webp',
        'url'  => 'https://aba5sdmaaaaaaaamdwujas5g6mg4r.otte.live.cf.ww.aiv-cdn.net/syd-nitro/live/clients/dash/enc/8m8cd46i1t/out/v1/83985c68e4174e90a58a1f2c024be4c9/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '0b42be2664d7e811d04f3e504e0924c5' => 'ae24090123b8c72ac5404dc152847cb8'
            ]
        ]
    ],    
    
    'bein3' => [
        'name' => 'Bein Sports 3',
        'logo' => 'https://example.com/sports1-logo.png',
        'url'  => 'https://aba5sdmaaaaaaaamhq2w5oosrf5ae.otte.live.cf.ww.aiv-cdn.net/syd-nitro/live/clients/dash/enc/q4u5nwaogz/out/v1/18de6d3e65934f3a8de4358e69eab86c/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '7995c724a13748ed970840a8ab5bb9b3' => '67bdaf1e2175b9ff682fcdf0e2354b1e'
            ]
        ]
    ],
    'bein1' => [
        'name' => 'Bein Sports 1',
        'logo' => 'https://example.com/news24-logo.png',
        'url'  => 'https://aba5sdmaaaaaaaamooyrewxky2c4j.otte.live.cf.ww.aiv-cdn.net/syd-nitro/live/clients/dash/enc/ghwcl6hv68/out/v1/83536910d8034e9b9895a20fbe1c1687/cenc.mpd',
        'drm'  => [
            'clearKeys' => [
                '335dad778109954503dcbb21dc92015f' => '24bfd75d436cbf73168a2a2dccd40281'
            ]
        ]
    ]
];

echo json_encode($channels, JSON_UNESCAPED_SLASHES);4dc152847cb8'
            ]
        ]
    ],    
    
    'bein3' => [
        'name' => 'Bein Sports 3',
        'logo' => 'https://example.com/sports1-logo.png',
        'url'  => 'https://aba5sdmaaaaaaaamhq2w5oosrf5ae.otte.live.cf.ww.aiv-cdn.net/syd-nitro/live/clients/dash/enc/q4u5nwaogz/out/v1/18de6d3e65934f3a8de4358e69eab86c/cenc.mpd',
        'drm'