I'll elaborate more later on.
Here are a few tools that I use to directly record any/all sound coming from any app on my computer. This pertains mostly to PC, but I know these plugins and apps are also available for Apple Macintosh computer systems.
It can be a bit to wrap your head around, as it involves selecting the correct set of input and output devices in your DAW or audio app, as well as the main system devices.
Voicemeeter Banana (FREE/Donate)
With Voicemeeter, you can aggregate and route any audio devices, as well as virtual audio devices, and feed them into your DAW as separate inputs. Voicemeeter also installs its own "virtual audio cable" similar to ASIO4All, or Virtual Audio Cable.
Once you have the preferred routing set up, you can record with Voicemeeter directly, using its tape recorder feature (see screenshot above), or you can use a VST like TapeIT or MeldaProductions MRecorder (Free/Nag).
MeldaProduction MRecorder
If you aren't using Voicemeeter to record, you can use MeldaProduction MRecorder on any channel in your daw to record the input. I'll use this for a digital input, like Voicemeeter's system-wide virtual audio device, or the analog inputs from my USB soundcard/mixer.
One very important tip is to check off the "append number to the filename" when recording (screenshot above), otherwise you'll likely overwrite the previous recording you just made and it will be lost in time forever.
Now you can record anything!
Links:
MeldaProduction free bundle that includes MRecorder
Voicemeeter Banana. There are other variants like Potato and plain, but I think banana has the best mix of features without getting too complex.
Also...
If you goal is to directly and quickly rip audio or video from various services like YouTube, Soundcloud, Vimeo, DailyMotion, Mixcloud, etc, youtube-dl rips from dozens more services than its namesake. Just be sure to use the latest version as it's always a cat/mouse game with the various streaming service providers.