Skip to content

Instantly share code, notes, and snippets.

@FusRoDah061
Created March 9, 2019 22:18
Show Gist options
  • Save FusRoDah061/d3c29e0213db8618dc00d804242d3912 to your computer and use it in GitHub Desktop.
Save FusRoDah061/d3c29e0213db8618dc00d804242d3912 to your computer and use it in GitHub Desktop.
Entre na página do vídeo (dailymotion apenas). Clique para redirecionar para o embed, clique denovo para baixar o vídeo.
javascript: (function () {
appPath = 'https://savevideo.me/pt/';
function redirect (){
var url = window.location.href;
if(url.indexOf("embed") == -1)
{
var position = url.indexOf(".com/") + 5;
url = [url.slice(0, position), "embed/", url.slice(position)].join('');
window.location.href = url;
return true;
}
return false;
}
function l(script, id, hasScriptCallback, bookmarkletFunction) {
if(redirect()){ return; }
var d = document;
if (!d.getElementById(id)) {
var s = d.createElement('script');
s.src = script;
s.id = id;
d.body.appendChild(s);
}
s = setInterval(function () {
script = 0;
try {
script = hasScriptCallback.call();
} catch (id) {}
if (script) {
clearInterval(s);
bookmarkletFunction.call();
}
}, 200);
}
l('https://savevideo.me/js/bookmarklet.js', 'SV', function () {
return !!(typeof bookmarklet == 'function')
}, function () {
bookmarklet();
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment