import promptLoginAndGetCookies from './methods/promptLoginAndGetCookies' ; import checkCookiesValidity from './methods/checkCookiesValidity' ; import uploadVideo , { VideoObj } from './methods/uploadVideo' ; import { Cookies } from './helpers' ; export default class YoutubeUploader { private cookies : Cookies ; async promptLoginAndGetCookies ( ) { this . cookies = await promptLoginAndGetCookies ( ) ; return this . cookies ; } async checkCookiesValidity ( ) { return checkCookiesValidity ( this . cookies ) ; } async loadCookiesFromDisk ( path ) { this . cookies = Cookies . fromJSONFileSync ( path ) ; } async saveCookiesToDisk ( path ) { return this . cookies . saveToFileSync ( path ) ; } async uploadVideo ( videoObj , headlessMode ? , onProgress ? ) { return uploadVideo ( videoObj , this . cookies , headlessMode , onProgress ) ; } }