Use a 500v rated capacitor and 1n4004 diode. note this circuit is only useful as a simple 'on' indicator for mains voltage and you should check if the components overheat. the led flashes at 60 Hz this should not be noticeable by humans. Use at own risk as a failure in the diodes or capacitor could cause a short that can trip power. if you build this circuit use well separated tracks on your pcb. (edited)