Legends of Tomorrow
The One Where We're Trapped on TV
S5 E14:
After Charlie tries to protect the Legends by scattering them in different television shows, the Legends figure out a way to end up messing with the system.