Skip to content

Instantly share code, notes, and snippets.

@idolpx
Last active January 7, 2021 08:09
Show Gist options
  • Save idolpx/6cc02a477f4673e4aba7cbb5c4e1234f to your computer and use it in GitHub Desktop.
Save idolpx/6cc02a477f4673e4aba7cbb5c4e1234f to your computer and use it in GitHub Desktop.
Instagram Media Deprotect - Removes elements protecting images & videos from download
// ==UserScript==
// @namespace https://gist.github.com/idolpx
// @name Instagram Media Deprotect
// @version 1.0.5
// @description Removes elements protecting images & videos from download
// @downloadURL https://openuserjs.org/install/idolpx/Instagram_Media_Deprotect.user.js
// @updateURL https://openuserjs.org/meta/idolpx/Instagram_Media_Deprotect.meta.js
// @author Jaime Idolpx
// @copyright 2020, idolpx (https://openuserjs.org/users/idolpx)
// @license MIT
// @match https://www.instagram.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
function remove_protection() {
$('article:visible').each(function() {
$(this).find('img').parent().next().remove();
if($(this).find('video').length > 0 && $(this).find('div.dl').length == 0) {
var src = $(this).find('video').attr('src');
var name = $(this).find('h2').first().text() + '-' + src.split("/").pop();
var html = '<div class="dl" style="text-align: center;font-size: large;font-weight: 900;"><a href="' + src + '" target="_blank" download="' + name + '">>>> Download Video <<<</a></div>';
$(this).find('header').next().after(html);
}
});
}
(function() {
'use strict';
remove_protection();
$('body').on("click",function(){
remove_protection();
});
$(window).scroll(function() {
clearTimeout($.data(this, 'scrollTimer'));
$.data(this, 'scrollTimer', setTimeout(function() {
remove_protection();
}, 250));
});
})();
@Korb
Copy link

Korb commented Jan 5, 2021

Firefox 84.0.1 x64, Tampermonkey 4.11.6120 - операции с изображениями по-прежнему заблокированы.

@idolpx
Copy link
Author

idolpx commented Jan 7, 2021

Try to click on the image first then right click and see if you have the "Save Image As..." option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment