Bypass YouTube age verification

Bypass YouTube age verification without logging in.

  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. // @author tfr (https://github.com/t-fr/)
  8. // @license CC0; https://creativecommons.org/publicdomain/zero/1.0/
  9. // @license MIT license; https://pastebin.com/raw.php?i=4TMeeUXC
  10. // @compatible firefox Works with Firefox and Greasemonkey
  11. // @compatible chrome Works with Chrome and Tampermonkey
  12. // @compatible opera Works with Opera and Tampermonkey Beta or Violent monkey
  13. // @compatible tfrbmlconv-1 Works with / Funktioniert mit: Firefox 40, Chrome 44, Opera 31; Does not work with / Funktioniert nicht mit: IE 8, IE 11, Opera 12
  14. // @oujs:author tfr
  15. // @include http://www.youtube.com/watch*
  16. // @include https://www.youtube.com/watch*
  17. // @version 6
  18. // @grant none
  19. // ==/UserScript==
  20.  
  21. /* This script is dual-licensed under CC0 and the MIT license.
  22. * You can choose which one you want to use.
  23. * CC0 license: http://creativecommons.org/publicdomain/zero/1.0/deed.en
  24. * MIT license: https://pastebin.com/raw.php?i=4TMeeUXC
  25. *
  26. * Dieses Skript steht sowohl unter CC0 als auch unter der MIT-Lizenz.
  27. * Sie können sich aussuchen, welche Lizenz Sie nutzen.
  28. * CC0-Lizenz: http://creativecommons.org/publicdomain/zero/1.0/deed.de
  29. * MIT-Lizenz: https://pastebin.com/raw.php?i=4TMeeUXC
  30. */
  31.  
  32. /* Version 6: Update license information
  33. * Version 5: Update metadata block
  34. * Version 4: Correct string search index from 1 to -1
  35. * Version 3: https://greasyfork.org/forum/discussion/4509
  36. * Version 2: Error in code, bypass in playlists was not working
  37. */
  38.  
  39. if(window.document.getElementById("watch7-player-age-gate-content"))
  40. {
  41. var videoid = window.location.search.substr(window.location.search.indexOf("v=") + 2);
  42. if(videoid.indexOf("&") > -1)
  43. {
  44. videoid = videoid.substr(0, videoid.indexOf("&"));
  45. }
  46. videoid = decodeURIComponent(videoid);
  47. window.document.getElementById("player-api").remove();
  48. var playerparent = window.document.getElementById("player-unavailable");
  49. var playerframe = window.document.createElement("iframe");
  50. playerframe.setAttribute("src", "//www.youtube.com/embed/" + videoid + "?autoplay=1&showinfo=0");
  51. playerframe.setAttribute("id", "player-frame");
  52. playerframe.setAttribute("style", "position:absolute; z-index:99999; width:100%; height:100%;");
  53. playerparent.appendChild(playerframe);
  54. }