Bypass YouTube age verification

Bypass YouTube age verification without logging in.

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

  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. // @license CC0; https://creativecommons.org/publicdomain/zero/1.0/
  8. // @compatible firefox Works with Firefox and Greasemonkey
  9. // @compatible chrome Works with Chrome and Tampermonkey
  10. // @compatible opera Works with Opera and Tampermonkey Beta or Violent monkey
  11. // @oujs:author tfr
  12. // @include http://www.youtube.com/watch*
  13. // @include https://www.youtube.com/watch*
  14. // @version 5
  15. // @grant none
  16. // ==/UserScript==
  17.  
  18. /* Version 5: Update metadata block */
  19. /* Version 4: Correct string search index from 1 to -1 */
  20. /* Version 3: https://greasyfork.org/es/forum/discussion/4509 */
  21. /* Version 2: Error in code, bypass in playlists was not working */
  22.  
  23. /* This script is licensed under CC0 / Dieses Skript steht unter CC0:
  24. * http://creativecommons.org/publicdomain/zero/1.0/deed.de
  25. * http://creativecommons.org/publicdomain/zero/1.0/deed.en */
  26.  
  27. if(window.document.getElementById("watch7-player-age-gate-content"))
  28. {
  29. var videoid = window.location.search.substr(window.location.search.indexOf("v=") + 2);
  30. if(videoid.indexOf("&") > -1)
  31. {
  32. videoid = videoid.substr(0, videoid.indexOf("&"));
  33. }
  34. videoid = decodeURIComponent(videoid);
  35. window.document.getElementById("player-api").remove();
  36. var playerparent = window.document.getElementById("player-unavailable");
  37. var playerframe = window.document.createElement("iframe");
  38. playerframe.setAttribute("src", "//www.youtube.com/embed/" + videoid + "?autoplay=1&showinfo=0");
  39. playerframe.setAttribute("id", "player-frame");
  40. playerframe.setAttribute("style", "position:absolute; z-index:99999; width:100%; height:100%;");
  41. playerparent.appendChild(playerframe);
  42. }