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 3 of 3
  1. Hello everyone,

    I'm trying to download the live 1080p stream for RaiPlay channels (specifically Rai 5) using an .mpd URL I've extracted from Kodi's logs. However, I consistently run into 404 Not Found errors on the stream segments, and I'm hoping someone here might have some insight.

    Using Streamlink with the public RaiPlay page URL (https://www.raiplay.it/dirette/rai5) only allows me to access up to the 720p stream. I know a higher quality stream exists.

    A PVR addon within Kodi is able to play the same channel in perfect 1080p. To understand how, I enabled Kodi's debug logs and found that the addon generates a direct .mpd URL that points to the 1080p stream. The URL is structured as follows:

    Code:
    https://raicinque1-dash-live.akamaized.net/dash/live/664003/raicinque1/manifest.mpd?hdnea=st=1755196335~exp=1755196485~acl=/*~hmac=4b085a28df5f8024c495aebc5b38d349776c6109ebd866c6b940a536196d0b2d
    As you can see, the URL is protected by an hdnea token with an expiration timestamp (exp).

    Troubleshooting Steps & The Persistent Problem:

    Attempt 1: Manual URL Usage (Copy & Paste)
    I copied the full URL from the Kodi log the moment it was generated and immediately passed it to Streamlink via the command prompt. Streamlink correctly identifies the 1080p stream and successfully begins downloading for about 10-12 seconds. After that, the download fails with a barrage of 404 Client Error: Not Found on all subsequent video and audio segments.

    This is the output I receive:

    Code:
    [cli][info] Found matching plugin dash for URL https://raicinque1-dash-live.akamaized.net/dash/live/...
    [cli][info] Available streams: 1080p (worst, best)
    [cli][info] Opening stream: 1080p (dash)
    [cli][info] Writing output to output.ts
    [stream.dash][error] audio/mp4 segment 32240: failed (Unable to open URL: .../media_audio_raicinque_5000-32240.m4s (404 Client Error: Not Found))
    [stream.dash][error] video/mp4 segment 32240: failed (Unable to open URL: .../media_video_raicinque_5000-32240.m4s (404 Client Error: Not Found))
    [stream.dash][error] audio/mp4 segment 32241: failed (Unable to open URL: .../media_audio_raicinque_5000-32241.m4s (404 Client Error: Not Found))
    My initial hypothesis was that the hdnea token has a very short validity period (6 seconds circa), and the time it takes to manually copy and paste the URL is long enough for it to expire.

    Attempt 2: Automation via Kodi Addon Modification
    To eliminate any manual delay, with Google AI Gemini I modified the Kodi addon's Python script (player.py). Instead of passing the URL to Kodi's internal player, I intercepted the newly generated URL and used Python's os.system() to immediately launch an external Streamlink process.

    The modified code in the addon executes the following command as soon as it gets the URL:

    HTML Code:
    streamlink_command = f'py -3.9 -m [url=https://www.videohelp.com/software/Streamlink]streamlink[/url] "{url_to_play}" best -o "output.ts"'
    os.system(f'start "Streamlink Download" cmd /c "{streamlink_command}"')
    Even with this automation, the result is identical: Streamlink launches in a new window but fails with the same 404 Not Found error on the segments.

    My Question:

    It seems that even the overhead of launching a new process from Python is too slow for this token. The time between the URL's generation and Streamlink's actual request for the .m4s segments is enough to invalidate the authentication.

    Does anyone have experience with these ultra-short-lived hdnea tokens from Akamai? Are there any tricks or Streamlink parameters that might help?

    Is it possible that the token is only valid for the exact IP address and User-Agent that initially requested the URL? (Though I don't see any special headers in the Kodi logs).

    Is there a faster way to "pipe" a URL to an already running instance of Streamlink to minimize the startup latency?

    I would appreciate any suggestions or ideas. Thanks in advance
    Discord Sei#0555
    Quote Quote  
  2. Try to do it with N_m3u8-RE.

    Add
    Code:
     --mux-after-done mp4 --use-shaka-packager --live-keep-segments false
    to the command and --key (key) if needed.
    Quote Quote  
  3. After numerous attempts, I automated everything with:

    Code:
    N_m3u8DL-RE.exe “link.mpd” --auto-select --live-real-time-merge --live-pipe-mux --live-keep-segments False --live-record-limit “06:00:00” --save-name “name”
    Now I can get RAI channels at 1080p.
    Discord Sei#0555
    Quote Quote  



Similar Threads

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