VideoHelp Forum


Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!


Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.


+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Hi all

    I'm looking for a way to pull the streams from the broadcaster in my country (SABC) to a m3u format, so that I can connect them into my PVR.

    They seem to be in mp4 segments. I have attached a screenshot detailing one channel Image
    [Attachment 68267 - Click to enlarge]


    There's probably about 4 channels needing to be pulled to a m3u format and streamed. If the steaming token expires, I would need something to renew the token automatically.

    Interlark has designed something similar for another service https://github.com/interlark/ustvgo-iptv

    Assuming I would need something like this, unfortunately I have no idea how to use Python, or where to even start, but I love to learn.

    So if anyone can offer me detailed info, on how to do this please let me know.

    If I need to submit more info, please let me know what.

    Thanks in advance. (:
    Quote Quote  
  2. Hi paul92, you can help your cause greatly if you provide URL of the streams that you desire.

    If login is required then any action for your cause will be greatly demished.


    If your provider, SABC, uses encryption then you may be SOL as these require keys and these keys usually expire.


    unfortunately I have no idea how to use Python, or where to even start, but I love to learn
    Your lack of knowledge on programming is excusable but "not knowing where to start" is not. Ever heard of YouTube?, what about books?
    Quote Quote  
  3. Ok, I did some checking on my own



    Need mobile number to access.


    I know of fake email addresses but fake mobile numbers with sms eludes me.
    Quote Quote  
  4. Try this:
    https://receive-sms.cc/France-Phone-Number/33644623966
    France and European numbers worked for me where others didn't.
    Quote Quote  
  5. Originally Posted by jack_666 View Post
    Ok, I did some checking on my own



    Need mobile number to access.


    I know of fake email addresses but fake mobile numbers with sms eludes me.
    Check your PMs.

    I sent my registered login details

    Paul
    Quote Quote  
  6. it's been quite a while since I last even thought about this - but had a look at this again, this time my knowledge is slightly better. First thing is that the channels are geoblocked to South African IP address, so one would need a South African VPN. Secondly from what I've found is that there seems to be some sort of token protection, as a unique token is provided, upon each connection, which seems to be valid for at least close to 4 hours. Using an extension called The Stream detector, I was able to grab the stream URL (which eventually expire) pasted it into VLC, and it played immediately - which would seem to me that the only protection there, is that there needs to be a tokenID.
    Quote Quote  
  7. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Out of curiosity, what's the site and could you give a few stream URLs? The link @jack wrote is dead
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  8. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Out of curiosity, what's the site and could you give a few stream URLs? The link @jack wrote is dead

    website is
    Code:
    https://sabc-plus.com/
    requires registration - but is free to register.

    URLs to streams
    SABC1
    Code:
    https://sabc-plus.com/live/320/SABC-1
    SABC2
    Code:
    https://sabc-plus.com/live/321/SABC-2
    SABC3
    Code:
    https://sabc-plus.com/live/322/S3
    SABC Sport
    Code:
    https://sabc-plus.com/live/323/SABC-Sport
    SABC Education
    Code:
    https://sabc-plus.com/live/325/SABC-Education
    SABC News
    Code:
    https://sabc-plus.com/live/324/SABC-News
    SABC Lehae
    Code:
    https://sabc-plus.com/live/326/SABC-Lehae
    Using The Stream Detector, I was able to get the following URLS

    SABC1
    Code:
     https://sabconeta.cdn.mangomolo.com/sabc1/smil:sabc1.stream.smil/chunklist_b1600000_t64NzIwcA==.m3u8
    SABC2
    Code:
     https://sabctwota.cdn.mangomolo.com/sabc2/smil:sabc2.stream.smil/chunklist_b1600000_t64NzIwcA==.m3u8
    SABC3
    Code:
     https://sabctreta.cdn.mangomolo.com/sabc3/smil:sabc3.stream.smil/chunklist_b1600000_t64NzIwcA==.m3u8
    SABC Sport
    Code:
     https://sabctwotasp.cdn.mangomolo.com/sport/smil:sport.stream.smil/chunklist_b1600000_t64NzIwcA==.m3u8
    SABC Education
    Code:
     https://sabctretaed.cdn.mangomolo.com/edu/smil:edu.stream.smil/chunklist_b2000000_t64NzIwcA==.m3u8
    SABC News
    Code:
     https://sabconetanw.cdn.mangomolo.com/news/smil:news.stream.smil/chunklist_b250000_t64MjQwcA==.m3u8
    SABC Lehae
    Code:
     https://sabctretalh.cdn.mangomolo.com/lehae/smil:lehae.stream.smil/chunklist_b2000000_t64NzIwcA==.m3u8
    these open, and play fine with VLC, but was advised they will probably eventually expire




    so need a way to in a way ) at least from my understanding
    Automatically direct
    Code:
    https://sabc-plus.com/live/320/SABC-1
    to fetch this URL [/code]
    Code:
    https://sabconeta.cdn.mangomolo.com/sabc1/smil:sabc1.stream.smil/chunklist_b1600000_t64NzIwcA==.m3u8
    I have noted in earlier experimentation that this is based on token based authentication, and that it seems to come from something in the cookies file. Happy to provide further info if needed. Just a reminder these will only open with a South African IP address - I'm currently in New Zealand, and using my VPN to do all this.
    Last edited by paul92; 11th Aug 2024 at 09:46.
    Quote Quote  
  9. I wrote a forwarder for these channels a while ago (except SABC Education and SABC Lehae that I missed before they enforced registration). It uses the embedded players (hosted at Mangomolo) and extracts a tokenized m3u8 url from it. I just tested it real quick and as long as both the player domain and the m3u8 domain are called with a South African ip, things still work fine for those channels.

    Someone else is going to have to write the code as I'm really bad with Python, but here's how to do it:

    Open this url, filling in two fixed id's (this is the player page):

    Code:
    https://player.mangomolo.com/v1/live?id=MTk0&channelid=<channelid>&countries=Q0M=&filter=DENY&signature=<signature>
    channelid and signature for the channels that I know of are listed in the code below.

    The resulting html pages will have the tokenized m3u8 link in them, in a long block of Javascript. Really easy to extract with e.g. this regular expression (this is a Python regular expression):

    Code:
    r"src: \"(.+)\""
    And then you can just forward to this url. This is the code I use in Node.js (just the SABC part, it's using Express.js as the server framework to link requests and responses)

    Code:
    import got from 'got'
    
    export default async function (req, res) {
      const channelParameters = {
        news: {
          channelid: 'MzI0',
          signature: '54e386ff3a9b282f709bdbe3cb7f026f'
        },
        1: {
          channelid: 'MzIw',
          signature: 'afef9c2e6bf161cd3b3d929cfa9d51cb'
        },
        2: {
          channelid: 'MzIx',
          signature: '9d92dff59c1eddf29e8f8d87ee3e78da'
        },
        3: {
          channelid: 'MzIy',
          signature: 'c8cb953e450cc1b2b851663b64928cfe'
        },
        sport: {
          channelid: 'MzIz',
          signature: 'bce106f2fb94504e2a3d19cd0c0175cc'
        }
      }
    
      const { id } = req.params
    
      // Get url from player page
      const { channelid, signature } = channelParameters[id]
    
      const playerPage = await got(`https://player.mangomolo.com/v1/live?id=MTk0&channelid=${channelid}&countries=Q0M=&filter=DENY&signature=${signature}`)
      const url = /src: "(.+)"/g.exec(playerPage.body)[1]
    
      res.redirect(url)
    }
    Quote Quote  
  10. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by paul92 View Post
    Happy to provide further info if needed.
    Seems like an easy site to write a script for. Unfortunately, they require phone numbers for registration and all virtual ones are toasted. Without access to an account, I can't do much. Try the solution mentioned above.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  11. Originally Posted by StreamBabyStream View Post
    I wrote a forwarder for these channels a while ago (except SABC Education and SABC Lehae that I missed before they enforced registration). It uses the embedded players (hosted at Mangomolo) and extracts a tokenized m3u8 url from it. I just tested it real quick and as long as both the player domain and the m3u8 domain are called with a South African ip, things still work fine for those channels.

    Someone else is going to have to write the code as I'm really bad with Python, but here's how to do it:

    Open this url, filling in two fixed id's (this is the player page):

    Code:
    https://player.mangomolo.com/v1/live?id=MTk0&channelid=<channelid>&countries=Q0M=&filter=DENY&signature=<signature>
    channelid and signature for the channels that I know of are listed in the code below.

    The resulting html pages will have the tokenized m3u8 link in them, in a long block of Javascript. Really easy to extract with e.g. this regular expression (this is a Python regular expression):

    Code:
    r"src: \"(.+)\""
    And then you can just forward to this url. This is the code I use in Node.js (just the SABC part, it's using Express.js as the server framework to link requests and responses)

    Code:
    import got from 'got'
    
    export default async function (req, res) {
      const channelParameters = {
        news: {
          channelid: 'MzI0',
          signature: '54e386ff3a9b282f709bdbe3cb7f026f'
        },
        1: {
          channelid: 'MzIw',
          signature: 'afef9c2e6bf161cd3b3d929cfa9d51cb'
        },
        2: {
          channelid: 'MzIx',
          signature: '9d92dff59c1eddf29e8f8d87ee3e78da'
        },
        3: {
          channelid: 'MzIy',
          signature: 'c8cb953e450cc1b2b851663b64928cfe'
        },
        sport: {
          channelid: 'MzIz',
          signature: 'bce106f2fb94504e2a3d19cd0c0175cc'
        }
      }
    
      const { id } = req.params
    
      // Get url from player page
      const { channelid, signature } = channelParameters[id]
    
      const playerPage = await got(`https://player.mangomolo.com/v1/live?id=MTk0&channelid=${channelid}&countries=Q0M=&filter=DENY&signature=${signature}`)
      const url = /src: "(.+)"/g.exec(playerPage.body)[1]
    
      res.redirect(url)
    }
    Code:
    news  http://127.0.0.1:3000/MzI0/54e386ff3a9b282f709bdbe3cb7f026f/hls.m3u8
    1  http://127.0.0.1:3000/MzIw/afef9c2e6bf161cd3b3d929cfa9d51cb/hls.m3u8
    2  http://127.0.0.1:3000/MzIx/9d92dff59c1eddf29e8f8d87ee3e78da/hls.m3u8
    3  http://127.0.0.1:3000/MzIy/c8cb953e450cc1b2b851663b64928cfe/hls.m3u8
    sport  http://127.0.0.1:3000/MzIz/bce106f2fb94504e2a3d19cd0c0175cc/hls.m3u8
    Code:
    from flask import Flask, redirect, Response
    import re
    import requests
    
    app = Flask(__name__)
    
    @app.route('/<path:url>', methods=['GET'])
    def on_fetch(url):
        parts = url.split('/')
        if len(parts) < 3:
            return Response('Invalid URL', status=400)
    
        channelid = parts[-3]
        signature = parts[-2]
        api_response = requests.get(f'https://player.mangomolo.com/v1/live?id=MTk0&channelid={channelid}&countries=Q0M=&filter=DENY&signature={signature}')
    
        if api_response.status_code != 200:
            return Response('geo blocked', status=403)
    
        match = re.search(r'src: "(.*)"', api_response.text)
        if match:
            m3u8 = match.group(1)
            return redirect(m3u8, code=301)
        else:
            return Response('m3u8 URL not found', status=404)
    
    if __name__ == '__main__':
        app.run(port=3000)
    Quote Quote  
  12. Thanks everyone - was able to get this up and running. No buffering, and works brilliantly.

    Next thing is how can I convert the EPG to an epg_xml file or whatever, so I can add the EPG as a guide source.

    Thanks in advance.
    Quote Quote  
  13. Thanks imr_saleh! Also: I should make it a habit some day to check for and report errors in this kind of code

    paul92: where would you get EPG info for these channels? From the SABC site itself? I'm currently writing some scripts to get EPG data from a few channels that I watch on a regular basis and always interested to add more.
    Quote Quote  
  14. Originally Posted by StreamBabyStream View Post
    Thanks imr_saleh! Also: I should make it a habit some day to check for and report errors in this kind of code

    paul92: where would you get EPG info for these channels? From the SABC site itself? I'm currently writing some scripts to get EPG data from a few channels that I watch on a regular basis and always interested to add more.
    Should be easy enough get make a XMLTV script to pull from the SABC-plus website, if going by how easy it was to get the live channels working after I figured out what to do. Even Education works now. I asked ChatGPT to make a flask script, installed it as a service on my JHB VPS, pointed NextPVR installed on JHB VPS to those links (to deal with geo-blocking) then forwarded that nextpvr m3u8 to my main PVR VPS. (I have a netmaker WAN which is essentially a high speed Wireguard mesh network)

    and likewise. Not much of a TV person, but there a few channels I watch, but also enjoy the technology side, and building things, and makings work. I use Tinuva has a good EPG which covers a lot of DStv channels, but so much SABC.
    Quote Quote  
  15. Originally Posted by StreamBabyStream View Post
    Thanks imr_saleh! Also: I should make it a habit some day to check for and report errors in this kind of code

    paul92: where would you get EPG info for these channels? From the SABC site itself? I'm currently writing some scripts to get EPG data from a few channels that I watch on a regular basis and always interested to add more.
    Hi any idea what's changed - this was working beautifully but when I checked again - the streams were failing to load

    here's my script
    Code:
    from flask import Flask, redirect, abort
    import requests
    import re
    
    app = Flask(__name__)
    
    # Define the channel parameters
    channel_parameters = {
        'news': {
            'channelid': 'MzI0',
            'signature': '54e386ff3a9b282f709bdbe3cb7f026f'
        },
        '1': {
            'channelid': 'MzIw',
            'signature': 'afef9c2e6bf161cd3b3d929cfa9d51cb'
        },
        '2': {
            'channelid': 'MzIx',
            'signature': '9d92dff59c1eddf29e8f8d87ee3e78da'
        },
        '3': {
            'channelid': 'MzIy',
            'signature': 'c8cb953e450cc1b2b851663b64928cfe'
        },
        'sport': {
            'channelid': 'MzIz',
            'signature': 'bce106f2fb94504e2a3d19cd0c0175cc'
        },
        'education': {
            'channelid': 'MzI5',
            'signature': 'b7b9cef40ca3743a4bb32e528da2df67'
        },
        'lehae': { 
            'channelid': 'MzI2',
            'signature': '414ba5b272e6c9bdfc96faafa454406a'
        }
    }
    
    @app.route('/stream/<channel_id>')
    def stream(channel_id):
        params = channel_parameters.get(channel_id)
        if not params:
            abort(404)  # Channel not found
    
        channelid = params['channelid']
        signature = params['signature']
    
        # Get URL from player page
        url = f"https://player.mangomolo.com/v1/live?id=MTk0&channelid={channelid}&countries=Q0M=&filter=DENY&signature={signature}"
        response = requests.get(url)
    
        # Extract the streaming URL from the response
        match = re.search(r'src: "(.+)"', response.text)
        if match:
            stream_url = match.group(1)
            return redirect(stream_url)
        else:
            abort(500)  # Error extracting URL
    
    if __name__ == '__main__':
        app.run(debug=True)
    when curling SABC3 I get this
    Code:
    paul@paul-Lenovo-ideapad-510-15ISK:~$ curl http://127.0.0.1:5000/stream/3
    <!doctype html>
    <html lang=en>
    <title>500 Internal Server Error</title>
    <h1>Internal Server Error</h1>
    <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
    some URL has obviously been changed somewhere...

    Hopefully someone here will be able to figure out just what changed exactly. I would have a look, but my brain isn't in code mode at the moment....

    Thanks
    Quote Quote  
  16. They made some changes, need access
    Quote Quote  
  17. Well, now I'm paranoid. I'd been using this method with these exact same parameters for the last 8 months, always worked just fine. Now, just a short while after sharing the id's and signatures things have been changed around.

    So while I found a pretty easy solution, I'm a bit hesitant to share it here. Because it's probably just as easy to patch. On the other hand, I'm pretty new here, so I'm not sure if being 'secretive' and only sharing things by PM is appreciated on this forum.
    Quote Quote  
  18. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by StreamBabyStream View Post
    On the other hand, I'm pretty new here, so I'm not sure if being 'secretive' and only sharing things by PM is appreciated on this forum.
    There are some sites that are being monitored for tricks like yours. You're the one to decide but no one will judge you if you keep it to yourself or only share it to trusted forum members.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  19. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    There are some sites that are being monitored for tricks like yours. You're the one to decide but no one will judge you if you keep it to yourself or only share it to trusted forum members.
    Got you, thanks! Seems silly to keep it purely to myself. But equally silly to just spell it out here.
    Quote Quote  
  20. Originally Posted by StreamBabyStream View Post
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    There are some sites that are being monitored for tricks like yours. You're the one to decide but no one will judge you if you keep it to yourself or only share it to trusted forum members.
    Got you, thanks! Seems silly to keep it purely to myself. But equally silly to just spell it out here.
    Just sent you a PM
    Quote Quote  
  21. Code:
    Response Content: This channel is not allowed on the current domain
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!