diff --git a/BBC.js b/BBC.js index c7d5d45..657fccf 100644 --- a/BBC.js +++ b/BBC.js @@ -62,4 +62,4 @@ addKiller("BBC", { xhr.send(null); } -}); \ No newline at end of file +}); diff --git a/Blip.js b/Blip.js index 6c35c98..0799286 100644 --- a/Blip.js +++ b/Blip.js @@ -31,7 +31,7 @@ addKiller("Blip", { for(var i = 0; i < media.length; i++) { url = media[i].getAttribute("url"); - info = urlInfo(url); + info = extInfo(getExt(url)); if(!info) continue; if(!info.isAudio) audioOnly = false; height = media[i].getAttribute("height"); diff --git a/Brightcove.js b/Brightcove.js index 2e193cb..9b1b047 100644 --- a/Brightcove.js +++ b/Brightcove.js @@ -35,7 +35,7 @@ addKiller("Brightcove", { if(source.videoCodec !== "H264" || !source.defaultURL) return; var bitrate = Math.round(parseInt(source.encodingRate)/100000); var format = bitrate === 0 ? source.frameHeight + "p " : bitrate + "00k "; - var ext = extractExt(source.defaultURL); + var ext = getExt(source.defaultURL); format += ext ? ext.toUpperCase() : "MP4"; sources.unshift({"url": source.defaultURL, "format": format, "height": parseInt(source.frameHeight), "isAudio": source.audioOnly, "isNative": true}); }; @@ -44,7 +44,7 @@ addKiller("Brightcove", { if(sources.length === 0) { media.IOSRenditions.forEach(processRendition); if(sources.length === 0) { - var source = urlInfo(media.FLVFullLengthURL); + var source = extInfo(getExt(media.FLVFullLengthURL)); if(source && !media.FLVFullLengthStreamed) { source.url = media.FLVFullLengthURL; sources.push(source); @@ -61,4 +61,4 @@ addKiller("Brightcove", { xhr.send(null); } -}); \ No newline at end of file +}); diff --git a/Flash.js b/Flash.js index 614a372..7a74916 100644 --- a/Flash.js +++ b/Flash.js @@ -82,7 +82,7 @@ addKiller("Flash", { if(/^https?:\/\/www\.tvn24\.pl/.test(data.location)) sourceURL = sourceURL.replace(".flv", ".mp4"); if(!sourceURL) return; - var ext = extractExt(sourceURL); + var ext = getExt(sourceURL); var isPlaylist = data.file === "playlistfile" || data.hash === "playlist_url" || ext === "xml" || ext === "xspf"; var baseURL = data.src; // used to resolve video URLs @@ -111,7 +111,7 @@ addKiller("Flash", { if(flashvars["hd.file"]) { var hdURL = decodeURIComponent(flashvars["hd.file"]); - var info = urlInfo(hdURL); + var info = extInfo(getExt(hdURL)); if(info) { info.url = makeAbsoluteURL(hdURL, baseURL); info.format = "HD " + info.format; @@ -125,7 +125,7 @@ addKiller("Flash", { getMIMEType(sourceURL, function(type) { call(typeInfo(type)); }); - } else call(urlInfo(sourceURL)); + } else call(extInfo(ext)); } }); diff --git a/Flowplayer.js b/Flowplayer.js index 12247bf..b91b850 100644 --- a/Flowplayer.js +++ b/Flowplayer.js @@ -36,7 +36,7 @@ addKiller("Flowplayer", { if(clip.provider === "rtmp") return; clip.url = decodeURIComponent(clip.url); - var source = urlInfo(clip.url); + var source = extInfo(getExt(clip.url)); if(source) { var base = clip.baseUrl ? clip.baseUrl : baseURL; if(base && !/^https?:/.test(clip.url)) { @@ -60,7 +60,7 @@ addKiller("Flowplayer", { }); if(!source.isAudio) audioOnly = false; } else { - var ext = extractExt(clip.url); + var ext = getExt(clip.url); if(ext === "jpg" || ext === "png") splash = clip.url; else splash = undefined; } diff --git a/Gametrailers.js b/Gametrailers.js index 9b7171d..9d89192 100644 --- a/Gametrailers.js +++ b/Gametrailers.js @@ -26,7 +26,7 @@ addKiller("Gametrailers", { return false; } var src = elements[0].textContent; - var info = urlInfo(src); + var info = extInfo(getExt(src)); if(!info) return; info.url = src; var rendition = xml.getElementsByTagName('rendition'); diff --git a/Generic.js b/Generic.js index 46e0fda..5a9e66d 100644 --- a/Generic.js +++ b/Generic.js @@ -3,7 +3,7 @@ addKiller("Generic", { "canKill": function(data) { // Streaming is not supported if(/^rts?p/.test(data.src) || data.params.href) return false; - return (data.info = typeInfo(data.type)) || (data.info = urlInfo(data.src)); + return (data.info = typeInfo(data.type)) || (data.info = extInfo(getExt(data.src))); }, "process": function(data, callback) { diff --git a/IGN.js b/IGN.js index 34c794d..cd109f8 100644 --- a/IGN.js +++ b/IGN.js @@ -24,7 +24,7 @@ addKiller("IGN", { if(isEmbed) siteInfo = {"name": "IGN", "url": media.metadata.url.replace(/\\\//g, "/")}; var videoURL = media.url.replace(/\\\//g, "/"); - var source = urlInfo(videoURL); + var source = extInfo(getExt(videoURL)); if(!source) return; source.url = videoURL; source.height = 720; @@ -39,5 +39,5 @@ addKiller("IGN", { }] }); } - -}); \ No newline at end of file + +}); diff --git a/MTVNetworks.js b/MTVNetworks.js index c1a8196..b54550b 100644 --- a/MTVNetworks.js +++ b/MTVNetworks.js @@ -11,9 +11,11 @@ addKiller("MTVNetworks", { "arc:episode:southparkstudios.com:": "3", "cms:video:comedycentral.com:": "6", // no example found "arc:playlist:comedycentral.com:": "3", + // "arc:episode:comedycentral.com:": "2", // works without context // "arc:video:comedycentral.com:": "1", // works without context // "cms:video:tosh.comedycentral.com:": "1", // has no working context // "cms:promo:tosh.comedycentral.com:": "1", // works without context + // "arc:episode:tosh:comedycentral.com:": "1", // has no working context "hcx:content:comedycentral.co.uk:": "3"//, // no example found // "cms:video:jokes.com:": "1", // works without context // "uma:video:mtv.com:": "1" // works without context diff --git a/Silverlight.js b/Silverlight.js index 863797b..6f14204 100644 --- a/Silverlight.js +++ b/Silverlight.js @@ -10,7 +10,7 @@ addKiller("Silverlight", { "process": function(data, callback) { var SLvars = parseSLVariables(data.params.initparams); var mediaURL = decodeURIComponent(SLvars[data.file]); - var info = urlInfo(mediaURL); + var info = extInfo(getExt(mediaURL)); var audioOnly = false; var sources = []; diff --git a/Vimeo.js b/Vimeo.js index 6a9cb37..1ab88fe 100644 --- a/Vimeo.js +++ b/Vimeo.js @@ -67,4 +67,4 @@ addKiller("Vimeo", { xhr.send(null); } -}); \ No newline at end of file +}); diff --git a/mediaTypes.js b/mediaTypes.js index 86292aa..f2b867f 100644 --- a/mediaTypes.js +++ b/mediaTypes.js @@ -7,7 +7,7 @@ function typeInfo(type) { } function urlInfo(url) { - url = extractExt(url); + url = getExt(url); if(url === "") return null; for(var type in nativeMediaTypes) { if(nativeMediaTypes[type].exts.indexOf(url) !== -1) return {"isNative": true, "isAudio": /^audio/.test(type), "format": nativeMediaTypes[type].format}; diff --git a/support.js b/support.js index ad45e8e..9857361 100644 --- a/support.js +++ b/support.js @@ -145,7 +145,7 @@ function extractDomain(url) { return /\/\/([^\/]+)\//.exec(url)[1]; } -function extractExt(url) { +function getExt(url) { var i = url.search(/[?#]/); if(i === -1) i = undefined; url = url.substring(url.lastIndexOf("/", i) + 1, i);