+async function waitUntilLiveSaved (url: string, token: string, videoId: number | string) {
+ let video: VideoDetails
+
+ do {
+ const res = await getVideoWithToken(url, token, videoId)
+ video = res.body
+
+ await wait(500)
+ } while (video.isLive === true && video.state.id !== VideoState.PUBLISHED)
+}
+
+async function waitUntilLivePublishedOnAllServers (servers: ServerInfo[], videoId: string) {
+ for (const server of servers) {
+ await waitUntilLivePublished(server.url, server.accessToken, videoId)
+ }
+}
+