Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Youtube
  3. // @namespace Youtube
  4. // @description +
  5. // @version 0.1
  6. // @author anon
  7. // @grant none
  8. // @include http://www.youtube.com/*
  9. // @include https://www.youtube.com/*
  10. // ==/UserScript==
  11.  
  12. function ready() {
  13. if (document.getElementsByClassName('message')[0].innerHTML.indexOf('Видео удалено')!=-1) {
  14. document.location.href='https://webcache.googleusercontent.com/search?q=cache:'+document.location.href;
  15. }
  16.  
  17. if (document.location.href.indexOf('/watch?')!=-1) {
  18.  
  19. //Удаление плейлистов
  20. if (document.location.href.indexOf('list=')!=-1) {
  21. var video_id=window.location.search.split('v=')[1];
  22. document.location.href='https://www.youtube.com/watch?v='+video_id.substring(0, video_id.indexOf('&'));
  23. }
  24.  
  25. //Добавление кнопок
  26. document.getElementById('watch-uploader-info').innerHTML='<form style="padding:0;float:left;"><button onclick="javascript:document.location=\'http://convert2mp3.net/addon_call.php?url=\'+document.location.href+\'&format=mp3\'" style="margin-bottom:8px;" role="button" type="button" class="under-movie-div-button yt-uix-button yt-uix-button-text yt-uix-tooltip"><span>Скачать аудио</span></button></form>'+
  27. '<form action="http://www.vidtomp3.com/process.php" method="post" style="padding:0;float:left;"><input style="display:none;" type="text" name="url" value='+document.location.href+'><button style="margin-bottom:8px;" role="button" type="submit" class="under-movie-div-button yt-uix-button yt-uix-button-text yt-uix-tooltip"><span>Скачать аудио 2</span></button></form>'+
  28. '<button onclick="javascript:window.location=\'http://ru.savefrom.net/#url='+document.URL+'\';" style="margin-bottom:8px;" role="button" class="under-movie-div-button yt-uix-button yt-uix-button-text yt-uix-tooltip"><span>Скачать видео</span></button><div style="float:none;"></div>'+document.getElementById('watch-uploader-info').innerHTML;
  29. }
  30. }
  31.  
  32. document.addEventListener("DOMContentLoaded", ready);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement