Bypass YouTube age verification

Bypass YouTube age verification without logging in.

目前为 2015-08-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bypass YouTube age verification
  3. // @name:de Youtube-Altersverifikation umgehen
  4. // @namespace tfr
  5. // @description Bypass YouTube age verification without logging in.
  6. // @description:de Umgehe die Altersverifikation ohne Einloggen.
  7. // @include http://www.youtube.com/watch*
  8. // @include https://www.youtube.com/watch*
  9. // @version 4
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. /* Version 4: Correct string search index from 1 to -1 */
  14. /* Version 3: https://greasyfork.org/es/forum/discussion/4509 */
  15. /* Version 2: Error in code, bypass in playlists was not working */
  16.  
  17. /* This script is licensed under CC0 / Dieses Skript steht unter CC0:
  18. * http://creativecommons.org/publicdomain/zero/1.0/deed.de
  19. * http://creativecommons.org/publicdomain/zero/1.0/deed.en */
  20.  
  21. if(window.document.getElementById("watch7-player-age-gate-content"))
  22. {
  23. var videoid = window.location.search.substr(window.location.search.indexOf("v=") + 2);
  24. if(videoid.indexOf("&") > -1)
  25. {
  26. videoid = videoid.substr(0, videoid.indexOf("&"));
  27. }
  28. videoid = decodeURIComponent(videoid);
  29. window.document.getElementById("player-api").remove();
  30. var playerparent = window.document.getElementById("player-unavailable");
  31. var playerframe = window.document.createElement("iframe");
  32. playerframe.setAttribute("src", "//www.youtube.com/embed/" + videoid + "?autoplay=1&showinfo=0");
  33. playerframe.setAttribute("id", "player-frame");
  34. playerframe.setAttribute("style", "position:absolute; z-index:99999; width:100%; height:100%;");
  35. playerparent.appendChild(playerframe);
  36. }