Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name SSYoutube Redirect
- // @namespace http://www.semicolonsoftware.de
- // @description Redirect unavailable youtube videos to ssyoutube.com
- // @include /^https?://(?:.*\.)?youtube.com\/watch\?v=.+$/
- // @version 1.0.0
- // @grant none
- // ==/UserScript==
- var $notfound = document.getElementById('watch7-player-unavailable');
- if($notfound) {
- var m = /youtube.com\/watch\?v=([^&]+)(?:&.*)?/.exec(document.URL);
- if(m) {
- var id = m[1];
- console.log(id);
- var $a = document.createElement('a');
- $a.innerHTML = "Try on savefrom.net";
- $a.setAttribute('href', 'http://ssyoutube.com/watch?v=' + id);
- $a.setAttribute('style', 'position: absolute; bottom: 10px; right: 10px; font-size: 12pt; padding: 10px; background-color: #5BB75B; background-image: linear-gradient(to bottom, #62C462, #51A351); color: #FFF; text-decoration: none; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); border-radius: 4px;');
- $notfound.appendChild($a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement