how is work get name from orginal link example(https://www.blutv.com/ar-en/movies/turkish/sonsuz-ask)
make folder blutv in html dir and chmod it 777
make file name session.dat and token.dat
put session in session.dat
No quote
and put token in token.dat
No quoteNo quote
and for final link like that http://localhost/blutv/blutv.php?name=sonsuz-ask&ql=1280
if you need to put direct in xtream the link will be like that http://localhost/blutv/blutv.php?name=sonsuz-ask&ql=1280&id=xtream
to download add ffmpeg in the blutv folder and chmod it and the link will be like that http://localhost/blutv/blutv.php?name=sonsuz-ask&ql=1280&id=ffmpeg
this script is for vod only
No quote
You really should consider using switch staments in stead of if in your code it can work a lot better in some cases and provides a default fall back. Also i would consider putting your curl into a function of its own and simply passing it the headers you need as an array along with the request type and the payload