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:
As you can see, the URL is protected by an hdnea token with an expiration timestamp (exp).Code:https://raicinque1-dash-live.akamaized.net/dash/live/664003/raicinque1/manifest.mpd?hdnea=st=1755196335~exp=1755196485~acl=/*~hmac=4b085a28df5f8024c495aebc5b38d349776c6109ebd866c6b940a536196d0b2d
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:
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.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))
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:
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.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}"')
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
Support our site by donate $5 directly to us Thanks!!!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
+ Reply to Thread
Results 1 to 3 of 3
-
Discord Sei#0555
-
Try to do it with N_m3u8-RE.
AddCode:--mux-after-done mp4 --use-shaka-packager --live-keep-segments false
-
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”
Discord Sei#0555
Similar Threads
-
1080p DASH stream conjoined to (4x64) video
By Chox in forum Video ConversionReplies: 9Last Post: 20th Aug 2025, 04:36 -
Problem getting dash segmented subs with correct timings from MPD stream
By jaydomas in forum Video Streaming DownloadingReplies: 2Last Post: 1st Jul 2022, 16:27 -
Help downloading .mpd dash stream with no manifest
By JustPassing in forum Video Streaming DownloadingReplies: 9Last Post: 19th Nov 2021, 05:51 -
need help with downloading a DASH stream using mpd and key.
By ramennoodles in forum Video Streaming DownloadingReplies: 1Last Post: 22nd Jun 2021, 07:56 -
How to download a mpd dash stream 8?) from munin.live ?
By Gwar in forum Video Streaming DownloadingReplies: 5Last Post: 24th May 2021, 13:53