lKinderBueno / Streamity-Xtream-IPTV-Web-player

Streamity.tv XTREAM Api. Advanced IPTV webplayer fully customizable with easy installer
269 stars 140 forks source link

Unable to login. #21

Open hamzaalmali opened 3 years ago

hamzaalmali commented 3 years ago

Although I tried too many times, I could not login.

Links I Try;

http://site.com:8080/get.php?username=test&password=test http://site.com:8080/get.php?username=test&password=test&type=m3u&output=ts http://site.com:8080/get.php?username=test&password=test&type=m3u&output=m3u8

I changed it in login php file;

    $uri = $host . "player_api.php?username=" . $user . "&password=" . $password;
    i changed it like this
    $uri = $host . "get.php?username=" . $user . "&password=" . $password . "&type=m3u&output=m3u8";

I can not login in any way, what should I follow?

thewebexpert commented 3 years ago

Based on what I have read on google, file_get_contents is not consistent, the main issue you are having is the get_file_contents is encoding the URL that is posted to the new server, meaning & becomes & which breaks the query string.

replace the every single spot you find a file_get_contents with this code $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL,$uri); curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); $data = curl_exec($ch); curl_close($ch);

Then assign $data to whatever variable file_get_contents was setting... for example this code:         //$info = json_decode(file_get_contents($uri, false, $context) , true); becomes this: $info = json_decode ($data, true);

There are a number of player files to correct as well

thewebexpert commented 3 years ago

Update! I replaced all file_get_contents with the code snipped above in the player etc. and now it is working perfectly! beautiful!

MMELA15 commented 3 years ago

Thanks for the solution, but I couldn't solve it. Please give me a ready-made code if you want please