How To Download Videos Directly From Youtube By Changing Url

When ever I change the output device on windows from wired headphones to wired speakers apple music doesn't update the output device. This also applies to bluetooth devices as well. Is there anyway to fix it or change it manually?