11-28-2017 - This module has been discontinued so no more updates will be posted anywhere. Users are encouraged to get the "official" stuff. Using this template will give you an error when building. Smart move, but rather selfish IMO.
This module works only in Magisk 13.3 and 14.0. Template has been rewritten so there's no backwards compatibility.
Previous version was based on vemacs' Adfree YouTube Template and Master_T's iYTBP.
Props go out for ZaneZam, Razerman and laura almeida from XDA for their new Vanced version which is the new YouTube mod this module is based on.
Its main purpose is to have an ad-free and background playback, as we had with the the Xposed's module YouTube Background Play.
Inside system/app/YouTube there's a "lib" folder with another named "Architecture" inside. This is, as name suggests, the library folder that contains extra features for YT, i.e. support for 360º videos. To use it properly, you need to rename the folder to "arm", "arm64", "x86" or "x86_64" and place inside the contents of the "lib" folder for the original YT apk.
It has been tested in AOSP/Lineage based ROMs, Motorola and Samsung's stock ROMs. Just flash it within Magisk Manager or TWRP.
For downloads please visit the XDA thread
All credit goes to the original developers, I just put stuff together.