Video is absolutely terrible and would be corrected day 1 if you walked on the mat doing some shyt like that.

If someone is committing to an actual single /double leg, you are done for anyways and shouldn't be fighting strangers. But on the real, if you are inexperienced your best defense is to sprawl as much as possible while attempting to push their head down, ideally with your body, but as a beginner just focus on keeping their head down. You can maneuver towards the side if possible, so push the head down and away for you to get away. Your entire goal should be sprawl, keep their head down, and looking for an exit.
But as I said, if an actual wrestler has your leg, you are done for, you need to be focussing on protecting your head and getting from under them, because they have essentially already taken you down, the next step is just positioning you properly to do what they want.
edit: And a takedown isn't supposed to hurt, it's about positioning. That slam in the OP video was a bit silly because depending on how you land, you forfeit positioning, of course he gets away with it because most will be shocked upon being slammed and won't have the experience to scramble following an uncontrolled slam like that.