1. Dear visitor, you are viewing Rapid IPTV as a guest member who has restricted access to our forum. You can either sign-up or login with your username here: http://www.rapidiptv.com/login/

RapidIPTV M3U Playlist Tweaker - Script to order and simplify channel list

Discussion in 'Tutorials & Installation Guides' started by suley, Nov 6, 2016.

Watchers:
This thread is being watched by 30 users.
  1. suley

    suley New Member

    30%
    Joined:
    Oct 22, 2016
    Messages:
    18
    Likes Received:
    12
    Liked:
    0
    Trophy Points:
    3
    Device:
    N/A
    I did see someone posted a script to strip only sections you want and remove others. I was thinking it would be better if we could build a script that was more flexible and offered more options.

    If we had someone who could code that would be great otherwise if a few people are willing to contribute I think we could get our own script made by hiring a freelancer, what do people think? Would be good for resellers who could setup a config and auto preps files

    Let me know your thoughts guys

    My thoughts are;
    Only Prep Countrys you want
    Order in a set order
    Replace User and Pass
    Notify New Channels compared to last prepped list
     
    Tags:
    Crankyman22, Bvdpas and Jansson like this.
  2. 129

    129 Reseller Reseller

    20%
    Joined:
    Aug 8, 2016
    Messages:
    60
    Likes Received:
    38
    Liked:
    8
    Trophy Points:
    18
    Device:
    RPI
    Reseller Username:
    Rpi129
    I'll probably release something that will be able to do most of those in the upcoming week.
     
    Crankyman22 likes this.
  3. Sonia1969

    Sonia1969 New Member

    10%
    Joined:
    Nov 5, 2016
    Messages:
    3
    Likes Received:
    0
    Liked:
    0
    Trophy Points:
    1
    Gender:
    Female
    Device:
    SmartTV?
    just took me hour to build Asian and USA / UK list. if 129 can come up with good soultion it will be awesome.

    somthing that can put out Logo's and epg as well?
     
  4. trebiasgreg

    trebiasgreg New Member

    30%
    Joined:
    Sep 17, 2016
    Messages:
    13
    Likes Received:
    2
    Liked:
    3
    Trophy Points:
    3
    Gender:
    Male
    Device:
    VU+ Solo2
    Please do you have a converter from m3u to enigma2 iptv list?
     
  5. suley

    suley New Member

    30%
    Joined:
    Oct 22, 2016
    Messages:
    18
    Likes Received:
    12
    Liked:
    0
    Trophy Points:
    3
    Device:
    N/A
    Nice, let me know how you get on, I had a great list build and the other week noticed Rapid had moved a bunch of Asian channels from the list, I was going to report but realised they removed from service. I think if we could automate a script to provide the output it would be good, for security it could have in the url request the user and pass required so its not easy to hack ie

    server.com/script.php?user=USERNAME&pass=PASS and it outputs on demand or its coded within the users and passes and runs on cron so inside the settings it says

    #Users and Outputs.m3u
    Timmy=Timmmys Direct Link = Output is Timmy.m3u

    I personally dont code but use freelancers for coding so I am sure we could find someone if a few of us are willing to chip in a couple pounds but lets see 129's code. Save us all a couple pounds.
     
  6. Rapid IPTV

    Rapid IPTV Administrator Staff Member Administrator

    100%
    Joined:
    Jun 3, 2015
    Messages:
    1,275
    Likes Received:
    1,114
    Liked:
    491
    Trophy Points:
    214
    Gender:
    Male
    Home Page:
    Device:
    Everything
    And you know there is bonus waiting for you for doing this, don't you? :)
     
    tarmin likes this.
  7. Rapid IPTV

    Rapid IPTV Administrator Staff Member Administrator

    100%
    Joined:
    Jun 3, 2015
    Messages:
    1,275
    Likes Received:
    1,114
    Liked:
    491
    Trophy Points:
    214
    Gender:
    Male
    Home Page:
    Device:
    Everything
    Topic was stickied. @129 please upload your script here also.
     
  8. goxa

    goxa Reseller Reseller

    80%
    Joined:
    Nov 7, 2016
    Messages:
    56
    Likes Received:
    23
    Liked:
    16
    Trophy Points:
    8
    Gender:
    Male
    Home Page:
    Device:
    KODI
    Reseller Username:
    goxa
     
  9. goxa

    goxa Reseller Reseller

    80%
    Joined:
    Nov 7, 2016
    Messages:
    56
    Likes Received:
    23
    Liked:
    16
    Trophy Points:
    8
    Gender:
    Male
    Home Page:
    Device:
    KODI
    Reseller Username:
    goxa
    try this:
    http://xtream-editor.ch/
    [​IMG]
     
    Last edited: Nov 8, 2016
  10. 129

    129 Reseller Reseller

    20%
    Joined:
    Aug 8, 2016
    Messages:
    60
    Likes Received:
    38
    Liked:
    8
    Trophy Points:
    18
    Device:
    RPI
    Reseller Username:
    Rpi129
    I have a very raw version of the script up and running (I will most likely improve it with another web page to create your own url, as well as adding an option to sort the M3U)

    To download a playlist, create an url following this example.
    This url will create a playlist containing the groups France, Germany and Arab Countries, using login123 as the login, and password456 as the password.


    Code:
    http://iptv-playlist-editor.tk/Playlist/?login=login123&password=password&groups[]=France&groups[]=Germany&groups[]=Arab Countries
    You can add as many groups as you want, as long as they exist on the RapidIPTV playlist.
    You can view all the possible groups on this page : http://iptv-playlist-editor.tk/Playlist/group_list.php

    You should be able to use the URL that you created directly into your player (VLC, Kodi, etc ...), it will be updated daily with any modification on Rapid's servers.


    DISCLAIMER : This is running on my personal server, if you don't trust me I advise you not to use your real login and passwords and replace them in the downloaded file manually.
     
    Last edited: Nov 7, 2016
    Muhammad Tufail likes this.
  11. suley

    suley New Member

    30%
    Joined:
    Oct 22, 2016
    Messages:
    18
    Likes Received:
    12
    Liked:
    0
    Trophy Points:
    3
    Device:
    N/A
    Great Work, can you provide the code of this script? I will try improve the code and maybe Rapid can add it to its servers to assist others.
     
  12. 129

    129 Reseller Reseller

    20%
    Joined:
    Aug 8, 2016
    Messages:
    60
    Likes Received:
    38
    Liked:
    8
    Trophy Points:
    18
    Device:
    RPI
    Reseller Username:
    Rpi129
    Sure, I'll try to release it tomorrow after cleaning it up if RapidIPTV is ok with it.
     
    Last edited: Nov 8, 2016
  13. Cuvillier

    Cuvillier Reseller Reseller Active Member

    100%
    Joined:
    Feb 19, 2016
    Messages:
    3,000
    Likes Received:
    600
    Liked:
    200
    Trophy Points:
    213
    Gender:
    Male
    Device:
    MINIX Neo U1
    Reseller Username:
    cuvillier
    I think he will agree because it's a great work
     
  14. goxa

    goxa Reseller Reseller

    80%
    Joined:
    Nov 7, 2016
    Messages:
    56
    Likes Received:
    23
    Liked:
    16
    Trophy Points:
    8
    Gender:
    Male
    Home Page:
    Device:
    KODI
    Reseller Username:
    goxa
    Here a script

    PHP:
    $urlnull;
    $groups null;
     
    if (isset(
    $_GET['u']))
    {
    $url base64_decode($_GET['u']);
    }
    if (isset(
    $_GET['g']))
    {
    $groups $_GET['g'];
    }
    if ((
    $url == null) || ($groups == null))
    return;
     
    $lb "\n";
    $output "#EXTM3U" $lb;
    $m3u file_get_contents($url);
    $lines explode ("\n"$m3u );
    $regex "/(\S+)=[\"']?((?:.(?![\"']?\s+(?:\S+)=|[>\"']))+.)[\"']?/";
     
    for(
    $i 0$i sizeof $lines ); $i ++) {
    if (
    substr $lines [$i], 0) === '#EXTINF:') {
    $options = array ();
    $str explode ','$lines [$i] );
    preg_match_all $regextrim $str [0] ), $options );
    $group = (array_search('group-title'$options[1] ) > - 1) ? trim($options[2][array_search('group-title'$options [1])]) : '';
    if (
    in_array($group$groups)) {
    $output .= $lines[$i].$lb.$lines[$i+1].$lb;
    }
    }
    }
     
    header('Content-Type: application/octet-stream');
    header("Content-Disposition: attachment; filename='your.m3u'");
    echo 
    $output;
    exit();
    Parameter "u" = Base64 encoded download URL like (http://clientportal.link:8080/get.php?username=xxx&password=xxx&type=m3u_plus&output=ts)
    Parameter "g" = Groups
     
    Last edited: Nov 8, 2016
    Muhammad Tufail likes this.
  15. 129

    129 Reseller Reseller

    20%
    Joined:
    Aug 8, 2016
    Messages:
    60
    Likes Received:
    38
    Liked:
    8
    Trophy Points:
    18
    Device:
    RPI
    Reseller Username:
    Rpi129
    Your regex FU is stronger than mine ;)
     
  16. goxa

    goxa Reseller Reseller

    80%
    Joined:
    Nov 7, 2016
    Messages:
    56
    Likes Received:
    23
    Liked:
    16
    Trophy Points:
    8
    Gender:
    Male
    Home Page:
    Device:
    KODI
    Reseller Username:
    goxa
    :smile:
    it's free. enjoy
     
  17. KAS

    KAS New Member

    30%
    Joined:
    Nov 8, 2016
    Messages:
    1
    Likes Received:
    1
    Liked:
    0
    Trophy Points:
    3
    Device:
    Kodi
    Very useful, thank you!
     
    goxa likes this.
  18. Swift IPTV

    Swift IPTV Reseller Reseller

    45%
    Joined:
    Aug 1, 2016
    Messages:
    180
    Likes Received:
    50
    Liked:
    61
    Trophy Points:
    28
    Gender:
    Male
    Home Page:
    Device:
    Kodi / Android / MAG
    Reseller Username:
    swiftiptv
    Very nice...

    Ps. I don't know if this is supposed to be like this but "filename='your.m3u'" downloads a file that has no extension and you have to change/add the extension manually. I just changed it to "filename=your.m3u" and it worked great. The rest of the code, however, is brilliant.

    ... Now all that's left is to build a form in which the user enters their data and selects desired groups from a set of check boxes, parse the info to the php file and generate the m3u ;)

    I'm going to code something... But I expect you guys will do it a lot quicker and cleaner!
     
    goxa likes this.
  19. goxa

    goxa Reseller Reseller

    80%
    Joined:
    Nov 7, 2016
    Messages:
    56
    Likes Received:
    23
    Liked:
    16
    Trophy Points:
    8
    Gender:
    Male
    Home Page:
    Device:
    KODI
    Reseller Username:
    goxa
    You're right. I wrote the script before breakfast :smile:
     
    Swift IPTV likes this.
  20. goxa

    goxa Reseller Reseller

    80%
    Joined:
    Nov 7, 2016
    Messages:
    56
    Likes Received:
    23
    Liked:
    16
    Trophy Points:
    8
    Gender:
    Male
    Home Page:
    Device:
    KODI
    Reseller Username:
    goxa
    Try that my frend:
    http://xtream-editor.ch/
     
    Swift IPTV likes this.

Share This Page

Loading...