I have the solution for this error with Safari and Youtube. It's very easy, after all. Follow these steps:
1. Download ADWARE MEDIC (http://www.adwaremedic.com/). It's the ONLY APPLICATION authorized by Apple.
2. Install, open and click on "Scan".
3. Remove all malware.
4. Close the application.
5. Open "Finder", hold down the Alt button and click on "Go to" > "Library".
6. Look for the "Preferences " folder and duplicate it in the same place.
7. Now, you must have "Preferences" and "Preferences copy". If you have, delete "Preferences".
8. Restart your computer.
9. Check Youtube.
😉