Here are some changes in stream url and I changed the script a bit accordingly.
I watch the stream now without US VPN.
What hasn't changed is that livecli can open this stream and streamlink can't.
Code:
$header = '"Accept: application/json;pk=BCpkADawqM1UIU4favtR1Jj4rqM0ZAkYwMEbgN9bsEpJ2150CdxJmRIG8jK-Up_9w4w37x3tP1AsoO_MZhD_XoAGkdKWxymaaw4OHuhPn_lEJczODTm3AO7S08gLFPnLnb-FcKJwXhbxCQ10"'
$s = ' "https://edge.api.brightcove.com/playback/v1/accounts/5377161796001/videos/6168209415001"'
$iPID = Run('cmd.exe /c curl.exe -k -H '& $header & $s,'',@SW_MINIMIZE,2)
ProcessWaitClose($iPID)
$s = StdoutRead($iPID)
$s = StringTrimLeft($s,StringInStr($s,'"https://i24alive2'))
$s = StringTrimRight($s,(StringLen($s)+1)-StringInStr($s,'"'))
$s = stringreplace($s,'\u0026','&')
run('cmd.exe /c livecli.exe --player=ffplay.exe "'& $s &'" 540p','',@SW_MINIMIZE)
Code:
[cli][info] Found matching plugin hls for URL https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001&hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3&__nn__=5476555825001&hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1&__nn__=5476555825001&hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5
[cli][info] Available streams: 180p (worst), 270p, 360p, 480p, 540p, 720p (best)
[cli][info] Opening stream: 540p (hls)
[cli][info] Starting player: ffplay.exe
New url contains unicode character \u0026 which has to be replaced with ampersand ( & ).
It can be noticed by comparing url from http sniffer and one returned from cmd.exe and curl.
bad url can be seen by running livecli with --loglevel debug switch.
Code:
run('cmd.exe /c livecli.exe --loglevel debug --player=ffplay.exe hls://"'& $s &'" 540p & pause')
Code:
[cli][debug] OS: Windows 10
[cli][debug] Python: 3.6.6
[cli][debug] Livecli: 4.0.5+6.gca94a27
[cli][debug] Crypto(3.6.5), Requests(2.19.1), Socks(1.6.7), Websocket(0.51.0)
[cli][info] Found matching plugin hls for URL hls://https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001\u0026hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3\u0026__nn__=5476555825001\u0026hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1\u0026__nn__=5476555825001\u0026hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5
[plugin.hls][debug] URL=https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001\u0026hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3\u0026__nn__=5476555825001\u0026hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1\u0026__nn__=5476555825001\u0026hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5; params={}
error: Unable to open URL: https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001\u0026hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3\u0026__nn__=5476555825001\u0026hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1\u0026__nn__=5476555825001\u0026hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5 (403 Client Error: Forbidden for url: https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001%5Cu0026hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3%5Cu0026__nn__=5476555825001%5Cu0026hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1%5Cu0026__nn__=5476555825001%5Cu0026hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5)
And here is fix for url:
Code:
$s = stringreplace($s,'\u0026','&')
run('cmd.exe /c livecli.exe --loglevel debug --player=ffplay.exe hls://"'& $s &'" 540p & pause')
Code:
[cli][debug] OS: Windows 10
[cli][debug] Python: 3.6.6
[cli][debug] Livecli: 4.0.5+6.gca94a27
[cli][debug] Crypto(3.6.5), Requests(2.19.1), Socks(1.6.7), Websocket(0.51.0)
[cli][info] Found matching plugin hls for URL hls://https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001&hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3&__nn__=5476555825001&hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1&__nn__=5476555825001&hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5
[plugin.hls][debug] URL=https://i24alive2.akamaized.net/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/playlist-all_dvr.m3u8?__nn__=5476555825001&hdnea=st=1606195800~exp=1606199400~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=a3988149e8d3f2d6d82d5838ffec4290ff3579c92b417edc965c59c2e439bad3&__nn__=5476555825001&hdnea=st=1593502200~exp=1593505800~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=e10085a246c4608e9f04e7d4b925449af4c8477024068d6ca8e4e3f9de7364b1&__nn__=5476555825001&hdnea=st=1579100400~exp=1579104000~acl=/773a2fa387914315ad11e6957cd54f6e/eu-central-1/5377161796001/*~hmac=c186cee77d80e35d26659b79813e3945270ce3339b49292ac0a39914dba1ffc5; params={}
[cli][info] Available streams: 180p (worst), 270p, 360p, 480p, 540p, 720p (best)
[cli][info] Opening stream: 540p (hls)
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Segments in this playlist are encrypted
[stream.hls][debug] First Sequence: 319701; Last Sequence: 320901
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 320899; End Sequence: None
[stream.hls][debug] Adding segment 320899 to queue
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] Adding segment 320900 to queue
[stream.hls][debug] Adding segment 320901 to queue
[stream.hls][debug] Download of segment 320899 complete - Time 534:49:54
[cli][info] Starting player: ffplay.exe
[cli.output][debug] Opening subprocess: f f p l a y . e x e " " -
[cli][debug] Writing stream to output
[stream.hls][debug] Download of segment 320900 complete - Time 534:50:00
[stream.hls][debug] Download of segment 320901 complete - Time 534:50:06