Last active
August 16, 2016 12:05
-
-
Save blizzy78/bfc5dd50cd263a14fa14 to your computer and use it in GitHub Desktop.
Revisions
-
blizzy78 revised this gist
Aug 16, 2016 . 1 changed file with 43 additions and 27 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,39 +1,55 @@ // ==UserScript== // @name Remove Golem.de Pre-Video Ads // @namespace http://blizzy.de/ // @version 1.0 // @description Removes pre-video ads from videos on golem.de // @match http://*.golem.de/* // @copyright 2014-2016, Maik Schreiber // @require //code.jquery.com/jquery-3.1.0.min.js // @grant none // ==/UserScript== function createVideo(id, width, height, poster) { return $.parseHTML('<video width="' + width + '" height="' + height + '" poster="' + poster + '" preload="auto" controls>' + '<source src="http://video.golem.de/download/' + id + '?q=high"/>' + '<source src="http://video.golem.de/download/' + id + '?q=medium"/>' + '</video>'); } function replaceVideos() { $('div[id^="NVBPlayer"]').each(function(idx, el) { el = $(el); var id = el.attr('id').substring(9); var embedded = el.find('embed'); var width = embedded.attr('width'); var height = embedded.attr('height'); var poster = embedded.attr('flashvars').replace(/^.*&image_src=([^&]+)&.*$/, '$1'); var video = createVideo(id, width, height, poster); el.replaceWith(video); }); $('object[id^="NVBPlayer"]').each(function(idx, el) { el = $(el); var id = el.attr('id').substring(9); var width = el.attr('width'); var height = el.attr('height'); var flashvars = el.find('param[name="flashvars"]').attr('value'); var poster = flashvars.replace(/^.*&image_src=([^&]+)&.*$/, '$1'); var video = createVideo(id, width, height, poster); el.replaceWith(video); }); $('figure[id^="gvideo_"]').each(function(idx, el) { el = $(el); var id = el.attr('id').substring(7); var playerEl = el.find('div[id="rmpPlayer' + id + '"]'); var width = playerEl.css('width').replace(/^([0-9]+).*/, '$1'); var height = playerEl.css('height').replace(/^([0-9]+).*/, '$1'); var posterEl = el.find('img[class="rmp-poster-img"]'); var poster = posterEl.attr('src'); var video = createVideo(id, width, height, poster); el.replaceWith(video); }); } window.setTimeout(replaceVideos, 2000); -
blizzy78 revised this gist
Jan 27, 2015 . 1 changed file with 23 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,39 @@ // ==UserScript== // @name Remove Golem.de Pre-Video Ads // @namespace http://blizzy.de/ // @version 0.3 // @description Removes pre-video ads from videos on golem.de // @match http://*.golem.de/* // @copyright 2014-2015, Maik Schreiber // @require //code.jquery.com/jquery-2.1.3.min.js // @grant none // ==/UserScript== function createVideo(id, width, height, poster) { return $.parseHTML('<video width="' + width + '" height="' + height + '" poster="' + poster + '" preload="auto" controls>' + '<source src="http://video.golem.de/download/' + id + '?q=high"/>' + '<source src="http://video.golem.de/download/' + id + '?q=medium"/>' + '</video>'); } $('div[id^="NVBPlayer"]').each(function(idx, el) { el = $(el); var id = el.attr('id').substring(9); var embedded = el.find('embed'); var width = embedded.attr('width'); var height = embedded.attr('height'); var poster = embedded.attr('flashvars').replace(/^.*&image_src=([^&]+)&.*$/, '$1'); var video = createVideo(id, width, height, poster); el.replaceWith(video); }); $('object[id^="NVBPlayer"]').each(function(idx, el) { el = $(el); var id = el.attr('id').substring(9); var width = el.attr('width'); var height = el.attr('height'); var flashvars = el.find('param[name="flashvars"]').attr('value'); var poster = flashvars.replace(/^.*&image_src=([^&]+)&.*$/, '$1'); var video = createVideo(id, width, height, poster); el.replaceWith(video); }); -
blizzy78 revised this gist
Sep 20, 2014 . 1 changed file with 12 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,26 +1,23 @@ // ==UserScript== // @name Remove Golem.de Pre-Video Ads // @namespace http://blizzy.de/ // @version 0.2 // @description Removes pre-video ads from videos on golem.de // @match http://*.golem.de/* // @copyright 2014, Maik Schreiber // @require //code.jquery.com/jquery-2.1.1.min.js // ==/UserScript== $('div[id^="NVBPlayer"]').each(function(idx, el) { el = $(el); var id = el.attr('id').substring(9); var embedded = el.find('embed'); var width = embedded.attr('width'); var height = embedded.attr('height'); var poster = embedded.attr('flashvars').replace(/^.*&image_src=([^&]+)&.*$/, '$1'); var video = $.parseHTML('<video width="' + width + '" height="' + height + '" poster="' + poster + '" preload="auto" controls>' + '<source src="http://video.golem.de/download/' + id + '?q=high"/>' + '<source src="http://video.golem.de/download/' + id + '?q=medium"/>' + '</video>'); el.replaceWith(video); }); -
blizzy78 created this gist
Sep 12, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ // ==UserScript== // @name Remove Golem.de Pre-Video Ads // @namespace http://blizzy.de/ // @version 0.1 // @description Removes pre-video ads from videos on golem.de // @match http://*.golem.de/* // @copyright 2014, Maik Schreiber // @require //code.jquery.com/jquery-2.1.1.min.js // ==/UserScript== $('figure').each(function(idx, el) { el = $(el); var id = el.attr('id'); if (id.indexOf('gvideo_') === 0) { id = id.substring(7); var embedded = el.find('embed'); var width = embedded.attr('width'); var height = embedded.attr('height'); var poster = embedded.attr('flashvars').replace(/^.*&image_src=([^&]+)&.*$/, '$1'); var video = $.parseHTML('<video width="' + width + '" height="' + height + '" poster="' + poster + '" controls>' + '<source src="http://video.golem.de/download/' + id + '?q=high"/>' + '<source src="http://video.golem.de/download/' + id + '?q=medium"/>' + '</video>'); el.replaceWith(video); } });