VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 8 of 8
  1. Hi, I'm trying to record the Mega Channel's Greek stream
    https://www.megatv.com/live/
    from the network log, it loads a placeholder 1 second video
    Code:
    https://streamcdnh4-0df53bbc22ae482295dbcf7370989099.msvdn.net/vod/JCAyrKr2UqYk/original.mp4
    and then after about 5 seconds, it loads a player from embed.vindral.com which isn't some known m3u/mpd stream, it's something like this
    Code:
    https://lb.cdn.vindral.com/api/v2/connect/?channelId=alteregomedia_megatv1_ci_6cc490c7-e5c6-486b-acf0-9bb9c20fa670
    and then the last thing on the log is a "wss" URL like this that seems to contain an AV1 video
    Code:
    wss://ume3-node-07.cdn.vindral.com/subscribe?channelId=alteregomedia_megatv1_ci_6cc490c7-e5c6-486b-acf0-9bb9c20fa670&sessionId=REDACTED&clientId=REDACTED&audio.bitRate=128000&audio.codec=aac&video.width=1280&video.height=720&video.bitRate=2200000&video.codec=av1&burstMs=2000
    Does anyone know what's this? If it's supported by the usual ffmpeg/N_m3u8DL-RE somehow?
    Quote Quote  
  2. WSS would mean WebSocket in this case. I've never seen it used in this way, usually it's used to open a channel for things like a webchat, where your browser 'subscribes' to new messages or status updates and sends its own messages through that same channel. In this case, it's the audio and video content that flows to the browser once the channel is opened and the link is established.

    Which is why I don't think tyou will have much luck with the usual software that you mention as the model of communicating is quite different conpared to requesting a playlist, receiving links to packages of audio and video and doing that in a loop. Apparently, not even VLC supports this.
    Quote Quote  
  3. Code:
    https://wow.anixa.tv/live/mega/chunklist_.m3u8
    Quote Quote  
  4. Took me a while, but this will record AV1 and AAC data and write them to files live (don't select h264 streams, didn't get them to work):
    Code:
    import json
    import struct
    import threading
    import time
    
    import websocket
    
    if __name__ == '__main__':
        def parse_rendition_data(data):
            payload_offset = struct.unpack('>H', data[1:3])[0]
            flags = data[3]
            rendition_id = data[4]
            payload = data[payload_offset:]
    
            return {
                'renditionId': rendition_id,
                'flags': flags,
                'payload': payload
            }
    
        def generate_adts_header(frame_length):
            # Settings:
            #  + MPEG-4
            #  + No CRC
            #  + AAC Low Complexity
            #  + 2 Channels
            #  + 48000 Hz
            #  + 1 Frame/ADTS header
    
            adts_header = bytearray([
                0b11111111,
                0b11110001,
                0b01001100,
                (0b10000000 | ((frame_length >> 11) & 0b00000011)),
                (frame_length >> 3) & 0xFF,
                ((frame_length & 0b111) << 5) | 0b00011111,
                0b11111100
            ])
    
            return adts_header
    
        def on_message(ws, message):
            if isinstance(message, str):
                print(">", message)
            else:
                message_data = parse_rendition_data(message)
                payload = message_data["payload"]
    
                if message_data["flags"] & 0x08 == 0 and message_data["flags"] & 0x04 == 0:
                    if not (message_data["flags"] & 0x02):
                        if message_data["renditionId"] == 10:
                            with open("y_video.mp4", "ab") as f:
                                f.write(payload)
                        elif message_data["renditionId"] == 1:
                            with open("y_audio.aac", "ab") as f:
                                f.write(generate_adts_header(len(payload) + 7))
                                f.write(payload)
    
        def on_open(ws):
            print("[Opened connection]")
    
        def on_error(ws, error):
            print(f"[ERROR: {error}]")
            exit()
    
        def on_close(ws, close_status_code, close_msg):
            print(f"[Closed connection: Code: {close_status_code}, Reason: {close_msg}]")
    
        def heartbeat(ws):
            while True:
                time.sleep(5)
                ping_message = json.dumps({
                    "type": "ping"
                })
                print("<", ping_message)
                ws.send(ping_message.encode())
    
        WSS_URL = "wss://ume3-edge-01.cdn.vindral.com/subscribe?channelId=alteregomedia_megatv1_ci_6cc490c7-e5c6-486b-acf0-9bb9c20fa670&sessionId=ece2f6d2-b264-48c6-a3fe-2a0f3265b8df&clientId=36e4a9f8-8f57-40c0-92f4-0eadc9caaed2&audio.bitRate=128000&audio.codec=aac&video.width=1280&video.height=720&video.bitRate=2200000&video.codec=av1&burstMs=2000"
    
        ws = websocket.WebSocketApp(
            WSS_URL,
            on_message=on_message,
            on_open=on_open,
            on_error=on_error,
            on_close=on_close
        )
    
        thread = threading.Thread(target=heartbeat, args=(ws,))
        thread.daemon = True
        thread.start()
    
        ws.run_forever()
    Bypass HMACs, One-time-tokens and Lic.Wrapping: https://github.com/DevLARLEY/WidevineProxy2
    Quote Quote  
  5. Originally Posted by Frieren View Post
    Code:
    https://wow.anixa.tv/live/mega/chunklist_.m3u8
    That's a re-stream that will probably get down, Mega has shut down its direct m3u stream before with a message on the video stream as an overlay covering the whole video about unofficial re-streams before they took it down

    Originally Posted by larley View Post
    Took me a while, but this will record AV1 and AAC data and write them to files live (don't select h264 streams, didn't get them to work):
    Code:
    import json
    That's great, thanks a ton! It surprises me that there hasn't been a stream like this before. Do you know if it would be possible for it to be piped to mpv or VLC to play directly? Or it would probably require the players to support the protocol?
    Last edited by Hackerpcs; 25th Mar 2025 at 20:27.
    Quote Quote  
  6. You can just open the file with mpv as soon as it is created. What I haven't figured out yet is how to mux both 'raw' aac audio and this av1 stuff.
    Bypass HMACs, One-time-tokens and Lic.Wrapping: https://github.com/DevLARLEY/WidevineProxy2
    Quote Quote  
  7. Originally Posted by larley View Post
    You can just open the file with mpv as soon as it is created. What I haven't figured out yet is how to mux both 'raw' aac audio and this av1 stuff.
    mkvmerge when the python script stops with Ctrl-C works fine, there is though an about -1500ms audio delay
    Quote Quote  
  8. I mean live. I need to merge ~5-10 10-50kb chunks of audio/video into an mkv file while it's running while being in sync
    Bypass HMACs, One-time-tokens and Lic.Wrapping: https://github.com/DevLARLEY/WidevineProxy2
    Quote Quote  



Similar Threads

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