Skip to content

Commit

Permalink
Merge pull request #51 from TentacleSama4254/main
Browse files Browse the repository at this point in the history
Typescript rewrite + Save cookies(LoginInfo)
  • Loading branch information
fawazahmed0 committed Oct 27, 2021
2 parents 5044ae5 + 9b584a4 commit 7fc68d8
Show file tree
Hide file tree
Showing 13 changed files with 226 additions and 117 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -106,3 +106,4 @@ dist
*.mp4
test.js
thumbnail.png
yt-auth/
7 changes: 7 additions & 0 deletions .prettierrc
@@ -0,0 +1,7 @@
{
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 4
}
8 changes: 4 additions & 4 deletions README.md
@@ -1,7 +1,7 @@
<h1 align="center">Youtube Videos Uploader</h1>

<p align="center">
<img width="460" height="300" src="https://github.com/fawazahmed0/youtube-uploader/raw/main/youtube.png">
<img width="460" height="300" src="assets/youtube.png">

[![npm version](https://img.shields.io/npm/v/youtube-videos-uploader.svg?style=flat)](https://www.npmjs.com/package/youtube-videos-uploader)

Expand All @@ -12,7 +12,7 @@
Please star this repo by clicking on [:star: button](#) above [:arrow_upper_right:](#)

### Features:
- No upload Limits (100 videos/day limit set by youtube for every channel)
- No upload Limits (50+ videos/day limit set by youtube for every channel)
- Free & Easy to use

### Prerequisite:
Expand All @@ -28,7 +28,7 @@ npm i youtube-videos-uploader
2. Go to your [Youtube settings](https://studio.youtube.com/) and Setup your upload defaults Settings:


![Upload Defaults Settings](https://github.com/fawazahmed0/youtube-uploader/raw/main/defaultsettings.png)
![Upload Defaults Settings](assets/defaultsettings.png)



Expand Down Expand Up @@ -68,7 +68,7 @@ upload (credentials, [video1, video2], {headless:false}).then(console.log)

### Contributors 🎉:
- [Pierre Miniggio( @pierreminiggio )](https://ggio.link/twitter) - For Adding [Youtube UI English Language Support](https://github.com/fawazahmed0/youtube-uploader/pull/16), [JSDoc](https://github.com/fawazahmed0/youtube-uploader/pull/18), and [debug message](https://github.com/fawazahmed0/youtube-uploader/pull/34)
- [TentacleSama4254 ](https://github.com/TentacleSama4254) - For Adding [Thumbnail option](https://github.com/fawazahmed0/youtube-uploader/pull/22) and fixing [tags error](https://github.com/fawazahmed0/youtube-uploader/pull/23)
- [TentacleSama4254 ](https://github.com/TentacleSama4254) - For Adding [Thumbnail option](https://github.com/fawazahmed0/youtube-uploader/pull/22), fixing [tags error](https://github.com/fawazahmed0/youtube-uploader/pull/23), [TypeScript Rewrite and storing login session](https://github.com/fawazahmed0/youtube-uploader/pull/51)
- [Sai Charan](https://github.com/charan0017) - For [onSuccess Option](https://github.com/fawazahmed0/youtube-uploader/pull/32)
- [Tue Nguyen](https://github.com/TueNguyen2911) - For [Better error messages](https://github.com/fawazahmed0/youtube-uploader/pull/46)
- [weizhiqimail](https://github.com/weizhiqimail) - For [Extra Debug messages](https://github.com/fawazahmed0/youtube-uploader/pull/47)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
58 changes: 57 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 22 additions & 3 deletions package.json
Expand Up @@ -2,16 +2,32 @@
"name": "youtube-videos-uploader",
"version": "1.3.25",
"description": "Uploads videos to youtube without any limits",
"main": "upload.js",
"main": "dist/index.js",
"types": "dist",
"files": [
"dist",
"auth",
"test"
],
"directories": {
"test": "test"
},
"dependencies": {
"prettier": "^2.4.1",
"puppeteer": "latest",
"puppeteer-extra": "latest",
"puppeteer-extra-plugin-stealth": "latest"
"puppeteer-extra-plugin-stealth": "latest",
"typescript": "^4.4.4"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fawazahmed0/youtube-uploader.git"
},
"scripts": {
"build": "tsc -p .",
"prepublish": "npm run build",
"format": "prettier --config .prettierrc \"src/**/*.ts\" --write"
},
"keywords": [
"youtube uploader",
"No limits",
Expand All @@ -28,5 +44,8 @@
"bugs": {
"url": "https://github.com/fawazahmed0/youtube-uploader/issues"
},
"homepage": "https://github.com/fawazahmed0/youtube-uploader#readme"
"homepage": "https://github.com/fawazahmed0/youtube-uploader#readme",
"devDependencies": {
"@types/fs-extra": "^9.0.13"
}
}
22 changes: 22 additions & 0 deletions src/index.ts
@@ -0,0 +1,22 @@
export * from './upload'

/*
Usage:
const { upload } = require('youtube-videos-uploader');
// recoveryemail is optional, only required to bypass login with recovery email if prompted for confirmation
const credentials = { email: 'email', pass: 'pass', recoveryemail: 'recoveryemail' }
// minimum required options to upload video
const video1 = { path: 'video1.mp4', title: 'title 1', description: 'description 1' }
const onVideoUploadSuccess = (videoUrl) => {
// ..do something..
}
// Extra options like tags, thumbnail, language, playlist etc
const video2 = { path: 'video2.mp4', title: 'title 2', description: 'description 2', thumbnail:'thumbnail.png', language: 'english', tags: ['video', 'github'], playlist: 'playlist name', onSuccess:onVideoUploadSuccess }
// Returns uploaded video links in array
upload (credentials, [video1, video2]).then(console.log)
// OR
// This package uses Puppeteer, you can also pass Puppeteer launch configuration
upload (credentials, [video1, video2], {headless:false}).then(console.log)
// Refer Puppeteer documentation for more launch configurations like proxy etc
// https://pptr.dev/#?product=Puppeteer&version=main&show=api-puppeteerlaunchoptions
*/
17 changes: 17 additions & 0 deletions src/types.ts
@@ -0,0 +1,17 @@
export interface Video {
path: string
title: string
description: string
tags?: string[]
language?: string
playlist?: string
function?: any
thumbnail?: string
onSuccess?: Function
}

export interface Credentials {
email: string
pass: string
recoveryemail?: string | undefined
}

0 comments on commit 7fc68d8

Please sign in to comment.