• Welcome to IPTV Community! You need login/register in-order to access forum without restriction.

Script for EX-YU Chanel Sorting

Bilal

New Member
Jan 23, 2017
5
1
3
Reseller ID
bilalbekim
Sorting over my webserver:
When loading your list, just put http://nidis.info/iptv/configurator.php?listURL= before your list URL with http://
example:
http://nidis.info/iptv/configurator...a&password=PaSsWoRd&type=m3u_plus&output=m3u8

It generates groups:
SRBIJA
BOSNA
HRVATSKA
MAKEDONIJA
SLOVENIJA
DECIJI
FILMSKI
DOKUMENTARNI
SPORT EX-YU
SPORT SVI

If anyone want script for hosting on own server PM me.
Thanks, it works. I tested it and after i deleted it because de don't know what your script make with the link (username and password). Send me the script please.
It's possible to do it with albanian and french Channel?

Thanks
Best regards
 

dragan88ar

New Member
Sep 29, 2018
9
11
3
Thanks, it works. I tested it and after i deleted it because de don't know what your script make with the link (username and password). Send me the script please.
It's possible to do it with albanian and french Channel?

Thanks
Best regards
It does not store anything, I made it for my self. Here is the code, you can tweak it little bit to make what ever groups you want.
PHP:
<?php



$AdresaListe=$_GET["listURL"]; // Adresa liste sa http://

echo $_GET["listURL"];

if (isset($_GET["listURL"])){

header("Content-Type: Application/m3u");

header("Content-Disposition: inline; filename=\"playlist.m3u\"");

$string      = file_get_contents($AdresaListe."&password=".$_GET["password"]."&type=".$_GET["type"]."&output=".$_GET['output']);

$index       = 1;

$bre         = true;

$odabrano    = true;

$tv          = true;

$vod         = true;

$zavrsenVOD  = true;

$zavrsenTV   = true;

$prvo        = true;

$trenutno    = true;

$grr         = "";

$Srbija      = Array();

$SportSvi    = Array();

$SportSrbija = Array();

$SportExYu   = Array();

$Bosna       = Array();

$Hrvatska    = Array();

$Makedonija  = Array();

$Slovenija   = Array();

$OstaliKanali= Array();

$Filmski     = Array();

$Deciji      = Array();

$Dokumentarni= Array();

$Muzicki     = Array();



// DEFINISE NAZIVE KOJI SE MOGU NACI U SPORTSKIM KANALIMA

$DefinicijaSPORT = array(

    "sport",

    "arena",

    "lega",

    "liga",

    "league",

    "calcio",

    "gol ",

    "liga",

    "futbol",

    "fussball",

    "match",

    "soccer",

    "basket",

    "formula",

    "bike",

    "fight",

    "moto",

    "spfl",

    "nfl",

    "nhl",

    "eishockey",

    "tennis",

    "espn",

    "fuel",

    "ufc",

    "olympic",

    "pac 12",

    "red bull",

    "mlb network",

    "hockey",

    "efl",

    "dazn",

    "spfl",

    "partizan",

    "sos"

);



$DefinicijaFILM = array(

    "fox",

    "cine",

    "amc",

    "film",

    "hbo ",

    "HBO ",

    "klasik",

    "max select",

    "action",

    "classic",

    "comedy",

    "crime",

    "horror",

    "movies",

    "premium",

    "romance",

    "fantasy",

    "serije",

    "soap",

    "thriller",

    "western",

    "scifi",

    "1000"

);

$DefinicijaDECIJI= array(

    "minimax",

    "ultra",

    "kids",

    "baby",

    "boomerang",

    "mini tv",

    "nick",

    "pikaboo",

    "kockica"

);

$DefinicijaDOKUMENTARNI= array(

    "discovery",

    "h2",

    "history",

    "animal",

    "investigation",

    "vinci",

    "docu",

    "living",

    "food",

    "kitchen",

    "ribolov",

    "pink world",

    "fashion",

    "kuvar",

    "pedia",

    "tlc",

    "travel",

    "viasat"

);

$DefinicijaMUZICKI= array(

    "music",

    "mtv",

    "play",

    "dm sat",

    "grand",

    "idj tv",

    "izvorna",

    "kcn 3",

    "folk",

    "hits",

    "n roll",

    "sound",

    "yu planet"

);



// FUNKCIJA ZA PRETRAZIVANJE ARRAY-A

function match($Brisanje, $haystack)

{

    foreach ($Brisanje as $needle) {

        if (strpos($haystack, $needle) !== false) {

            return true;

        }

    }

    return false;

}



// FUNCIJA ZA IZMENU PODATAKA IZMEDJU OZNAKA

function replace_between($str, $needle_start, $needle_end, $replacement)

{

    $pos   = strpos($str, $needle_start);

    $start = $pos === false ? 0 : $pos + strlen($needle_start);

    

    $pos = strpos($str, $needle_end, $start);

    $end = $start === false ? strlen($str) : $pos;

    

    return substr_replace($str, $replacement, $start, $end - $start);

}



// BRISE PRVI RED IZ LISTE I ORGANIZUJE JE RADI LAKSE MANIPULACIJE

$string = str_replace("#EXTM3U", "", $string);

$string = preg_replace('/^[ \t]*[\r\n]+/m', '', $string);

$arr    = explode("\n", $string);



foreach ($arr as $str) {

    if ($index % 2 == 0) {

        $index = 0;

        $str   = $str . "OVDERAZDVOJI \n";

    }

    $bre .= $str;

    $index++;

}

$obrada = explode("OVDERAZDVOJI", $bre);

$kan    = Array();

foreach ($obrada as $obr) {

if (strpos($obr, 'â–¬ ') !== false)

{

    $obr="";

}   

else if (match($DefinicijaFILM, strtolower($obr))) {

        if (strpos($obr, ' RS"') !== false || strpos($obr, ' BA"') !== false || strpos($obr, ' HR"') !== false) {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'FILMSKI');

                array_push($Filmski, $grr);

            }             

        }

        }

else if (match($DefinicijaDECIJI, strtolower($obr))) {

        if (strpos($obr, ' RS"') !== false || strpos($obr, ' BA"') !== false || strpos($obr, ' HR"') !== false) {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'DECIJI');

                array_push($Deciji, $grr);

            }           

        }

        }     

else if (match($DefinicijaDOKUMENTARNI, strtolower($obr))) {

        if (strpos($obr, ' RS"') !== false || strpos($obr, ' BA"') !== false || strpos($obr, ' HR"') !== false) {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'DOKUMENTARNI');

                array_push($Dokumentarni, $grr);

            }           

        }

        }         

else if (match($DefinicijaMUZICKI, strtolower($obr))) {

        if (strpos($obr, ' RS"') !== false || strpos($obr, ' BA"') !== false || strpos($obr, ' HR"') !== false) {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'MUZICKI');

                array_push($Muzicki, $grr);

            }           

        }

        }           

    // TRAZI SVE SRPSKE KANALE I SORTIRA IH

   else if (strpos($obr, ' RS') !== false) {

        // TRAZI SRPSKE SPORTSKE KANALE I SORTIRA IH

        if (match($DefinicijaSPORT, strtolower($obr))) {

            $grr = replace_between($obr, 'group-title="', '",', 'SPORT SRBIJA');

            if ($grr != '') {

                array_push($SportSrbija, $grr);

            }

        }

        // TRAZI OSTALE SRPSKE KANALE

        

        else {

            $grr = replace_between($obr, 'group-title="', '",', 'SRBIJA');

            if ($grr != '') {

                array_push($Srbija, $grr);

            }

        }

    }

    //   

    // TRAZI SVE SPORTSKE KANALE I SORTIRA IH

    

    else if (match($DefinicijaSPORT, strtolower($obr))) {

        if (strpos($obr, ' BA"') !== false || strpos($obr, ' HR"') !== false || strpos($obr, ' SI"') !== false || strpos($obr, ' MK"') !== false) {

            $grr = replace_between($obr, 'group-title="', '",', 'SPORT EX-YU');

            if ($grr != '') {

                array_push($SportExYu, $grr);

            }

        } else {

            $grr = replace_between($obr, 'group-title="', '",', 'SPORT SVI');

            if ($grr != '') {

                array_push($SportSvi, $grr);

            }

        }

    }   

    else if (strpos($obr, ' BA"') !== false )

    {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'BOSNA');

                array_push($Bosna, $grr);

            }         

    }

    else if (strpos($obr, ' HR"') !== false )

    {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'HRVATSKA');

                array_push($Bosna, $grr);

            }         

    }

    else if (strpos($obr, ' SI"') !== false )

    {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'SLOVENIA');

                array_push($Bosna, $grr);

            }         

    }

    else if (strpos($obr, ' MK"') !== false )

    {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'MAKEDONIJA');

                array_push($Bosna, $grr);

            }         

    }

    else if (strpos($obr, ' ME"') !== false )

    {

            if ($obr != '') {

                $grr = replace_between($obr, 'group-title="', '",', 'CRNA GORA');

                array_push($Bosna, $grr);

            }         

    }               

    else

    {

            if ($obr != '') {

                $grr=$obr;

                array_push($OstaliKanali, $grr);

            }       

    }

    

    

    //

}



/*

SKUPOVI ZA UPOTREBU



$SportSrbija

$SportExYu

$SportSvi

$Srbija

$Bosna

$OstaliKanali



*/



// SPAJA SVE SKUPOVE U JEDAN PO REDOSLEDU PO KOJEM CE SE PRIKAZIVATI GRUPE

$zavrsenTV=array_merge($SportSrbija,$SportExYu,$SportSvi,$Filmski,$Deciji,$Dokumentarni,$Muzicki,$Srbija,$Bosna,$OstaliKanali);

echo "#EXTM3U\n";

foreach ($zavrsenTV as $piece1) {

    if ($piece1 != '')

    {

 

        $tv.=$piece1; // DEFINISE STRING KOJI CE SE KORISTITI PRILIKOM GENGERISANJA LISTE

    }

}

    $tv=trim($tv);

    $tv= preg_replace('/^[ \t]*[\r\n]+/m', '', $tv);

    print $tv; // ISPISUJE LISTU

}

else

{

    echo "ENTER LIST URL.";

}





?>