YouTube does load up the data download & packet receives upload a lot, so it might be a WiFi driver problem. Have a look in Device Manager & see if there are any yellow exclamation marks showing.
The fact that when it restarts the WiFi is disabled also points a problem in this area.
My Computer
At a glance
Windows 7 Home Premium 64 bit sp1Intel i5 3570 3.4Ghz Ivy Bridge SKT 1155 quad...G-Skill Rip Jaws 16Gb (8x2) DDR3 -1600 PC3 12...Gigabyte NVIDIA GT610 1Gb DDR3 810/1200 PCI-E...
Is the WiFi adapter lugged directly into a USB port or are you using a USB hub. USB hubs can cause problems with USB devices.
Also is the WiFi adapter powered by the USB, if it is it might be drawing too much power from the USB. Does it have an AC adapter that you can use to power it, to see if that fixes the problem.
My Computer
At a glance
Windows 7 Home Premium 64 bit sp1Intel i5 3570 3.4Ghz Ivy Bridge SKT 1155 quad...G-Skill Rip Jaws 16Gb (8x2) DDR3 -1600 PC3 12...Gigabyte NVIDIA GT610 1Gb DDR3 810/1200 PCI-E...
something to keep in mind - your motherboard is 13 years old. When they go bad they can produce some weird symptoms. I had a system once that would restart when I played videos when using Chrome, but was fine when using firefox. Fortunately I had a spare motherboard that was an exact replacement, and after putting it in everything was fine. That board was 8 years old.
My Computer
At a glance
Win7 pro x64stock i7 7700kCorsair Vengeance LPX 16GB (2x8GB) DDR4 @ 320...integrated Intel HD 630
Computer type
PC/Desktop
Computer Manufacturer/Model Number
diy
OS
Win7 pro x64
CPU
stock i7 7700k
Motherboard
Gigabyte Z270N-WIFI mini-ITX
Memory
Corsair Vengeance LPX 16GB (2x8GB) DDR4 @ 3200MHz
Graphics Card(s)
integrated Intel HD 630
Sound Card
onboard Realtek ALC1220
Monitor(s) Displays
two vertically mounted samsung 55" 4k un55mu8000
Screen Resolution
1920x1280
Hard Drives
256GB Samsung EVO 960 M.2 pci-e NVMe SSD
PSU
SilverStone Nightjar ST45NF 450Watt Fanless
Case
No case. Motherboard is mounted directly onto power supply
Cooling
Evercool low profile 815EP with Panaflow 12L fan at 7v
Normally you don't need to take the heat sink from the CPU. What you need to do is to take the fan from the heat sink. Then with a vacuum cleaner and a paint brush clean the heat sink. When done, attach the fan back and connect it to the MB.