Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the possibility to toggle off the checkbox for publish to subscription feed and notify subscribers #232

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/types.ts
Expand Up @@ -17,6 +17,7 @@ export interface Video {
isNotForKid?: boolean
isChannelMonetized?: boolean
gameTitleSearch?: string
publishToSubscriptionFeedAndNotifySubscribers?: boolean
gameSelector?: ( arg0: GameData ) => Promise<boolean> | null
}

Expand Down
5 changes: 5 additions & 0 deletions src/upload.ts
Expand Up @@ -332,6 +332,11 @@ async function uploadVideo(videoJSON: Video, messageTransport: MessageTransport)
} catch (err) {}
}

// Set pusblish to subscription feed and notify subscribers to false
if(videoJSON.publishToSubscriptionFeedAndNotifySubscribers === false) {
await page.waitForSelector("#notify-subscribers > div:nth-child(1) > div:nth-child(1)")
await page.click("#notify-subscribers > div:nth-child(1) > div:nth-child(1)")
}
// Selecting video language
if (videoLang) {
const langHandler = await page.$x("//*[normalize-space(text())='Video language']")
Expand Down