Skip to content

Commit

Permalink
Merge pull request #55 from DaddyFrosty/patch-1
Browse files Browse the repository at this point in the history
Path escaping, adding email domain for better Google for work support.
  • Loading branch information
fawazahmed0 committed Nov 1, 2021
2 parents e9712e6 + 0478818 commit e10b597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const upload = async (
puppeteerLaunch?: PuppeteerNodeLaunchOptions
) => {
cookiesDirPath = path.join('.', 'yt-auth')
cookiesFilePath = path.join(cookiesDirPath, `cookies-${credentials.email.split('@')[0]}.json`)
cookiesFilePath = path.join(cookiesDirPath, `cookies-${credentials.email.split('@')[0].replace(/\./g, "_")}-${credentials.email.split('@')[1].replace(/\./g, "_")}.json`)

await launchBrowser(puppeteerLaunch)
await loadAccount(credentials)
Expand Down Expand Up @@ -254,7 +254,7 @@ export const update = async (
puppeteerLaunch?: PuppeteerNodeLaunchOptions
) => {
cookiesDirPath = path.join('.', 'yt-auth')
cookiesFilePath = path.join(cookiesDirPath, `cookies-${credentials.email.split('@')[0]}.json`)
cookiesFilePath = path.join(cookiesDirPath, `cookies-${credentials.email.split('@')[0].replace(/\./g, "_")}-${credentials.email.split('@')[1].replace(/\./g, "_")}.json`)

await launchBrowser(puppeteerLaunch)
if (!fs.existsSync(cookiesFilePath)) await loadAccount(credentials)
Expand Down

0 comments on commit e10b597

Please sign in to comment.