TV News example

Shortcut :

videoFinder script :

// credits to @memalign creator of original DPDL shortcut.

// cleaned & updated by @sjshaiks. 

let url = args.shortcutParameter;
let wv = new WebView()
await wv.loadURL(url)
let js = `
var plainHTMLVideoSourceResults = new Array();
function addPlainHTMLVideoSourceResult(res) {
//console.log("Inside addPlainHTMLVideoSourceResult function " );
    if (plainHTMLVideoSourceResults.indexOf(res) < 0) {

function updateVideoResultTable(showEmpty) {
    collectCurlCommandsForDocument(document, 'video');

function recursivelyInspectIFrames(doc) {
var iframes = doc.getElementsByTagName('iframe'); 
for (var i = 0; i < iframes.length; i++) {
        var iframe = iframes.item(i);
        var iframeDocument = iframe.contentDocument;
        //console.log("iframeDocument : " + iframeDocument);
        if (iframeDocument) {
            collectCurlCommandsForDocument(iframeDocument, 'video');
        } else {
            console.log("Found cross-origin iframe which might contain a video: " + iframe.src);

function collectCurlCommandsForDocument(doc, tagName) {
//console.log("Inside collectCurlCommandsForDocument function " );
var vids = doc.getElementsByTagName(tagName);
// vids is an HTMLCollection
for (var i = 0; i < vids.length; i++) { 
	var videoSrc = vids.item(i).src;
		if (!videoSrc) {
			var potentialSources = vids.item(i).getElementsByTagName('source');
			if (potentialSources && potentialSources.item(0)) {
				videoSrc = potentialSources.item(0).src;
		console.log("Video url: " + videoSrc);
		if (videoSrc) {


setTimeout(function() {
}, 10000);
let vidString = plainHTMLVideoSourceResults[0];

let vidTemp = await wv.evaluateJavaScript(js);

let stream_url = encodeURI(vidTemp)

hls_player script:

   // updated by @sjshaiks. contributed by jtokash 
    var url = args.shortcutParameter;
    let html = `
    body {
      margin: 0;
      padding 0;
      background: black;
    .vid {
      width: 100%;
      height: 100%;
    <video src="${url}" autoplay controls></video>
    WebView.loadHTML(html, null, new Size(0, 202))
1 Like

Thanks!! Works like a charm on my phone.

On iPad, the Scriptable box at the end is completely black, with no audio. I’ve tried CNN, BBC and MSNBC so far. I used quick look to verify that the streaming URL is correct. Still investigating.

I didn’t test on iPad. Please test this stand alone shortcut.

@slmkdp, that also failed with a black box on iPad Pro 11" iOS 13.3.

I think it’s something funky with hls.js. For what it’s worth I suggest not leveraging the hls.js library and instead doing one of the following (which are working perfectly on iPad and iPhone):

  • In the shortcut, load the resulting m3u8 url in Safari with the Open action, or
  • Replace the hls_player script with one that just populates an HTML5 video tag directly <video src="${url}" autoplay controls></video>

Given that Shortcuts and Scriptable are both iOS-only, I’m not sure what the benefit of using hls.js is.

1 Like

Thanks for the suggestions. You are right hls.js is not needed for iOS when hls format is supported natively.
Updated the hls script with your contributions.

Only BBC, Aljazeera, and Weather Channel are working for me. I’m on an iPhone XS, iOS 13.3. Looks like the m3u8 feeds are working; but, the others are not.

Also, there’s a small typo in Bloomberg in the Shortcut.

The links in the shortcut are for only demo purpose. You can google for sites that has live streams playable on iOS and edit the shortcuts with site URLs or direct .m3u8 links.

1 Like

Hiya, thanks for such a fun script. Just wanted to share a shortcut to which I added a bit more examples :stuck_out_tongue_winking_eye:

1 Like

Updated shortcut

More channels can be found at