Skip to content

Instantly share code, notes, and snippets.

@klepto
Created August 22, 2016 14:11
Show Gist options
  • Select an option

  • Save klepto/a8d2cd0f714944c9e3e5e8f222b84be7 to your computer and use it in GitHub Desktop.

Select an option

Save klepto/a8d2cd0f714944c9e3e5e8f222b84be7 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name KissAnime Linker
// @namespace https://github.com/kLeptO-
// @version 0.1
// @description Direct linker for KissAnime.
// @author kLeptO
// @match *.me/Anime/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none
// ==/UserScript==
(function() {
$(".listing a").each(function() {
var link = $(this);
var href = link.attr("href");
var directLink = $("<a>");
$.ajax({
url: href,
type: 'GET',
success: function(data) {
var directHref = $(data).find('[itemprop="video"] iframe').attr("src");
directLink.html(" [Direct Link]");
directLink.attr("href", directHref);
directLink.attr("target", "_blank");
link.after(directLink);
}
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment