Execute a code when detecting livestream

Yeah, I will definitely replace the setInterval function and terminate the request if it takes too long, thanks