Skip to content

Commit

Permalink
tiktok tts
Browse files Browse the repository at this point in the history
  • Loading branch information
thoriqazzikraa committed Sep 10, 2023
1 parent 8533783 commit 4f966c3
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 40 deletions.
107 changes: 68 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,92 @@
`npm i scrape-websitee`

# Usage
`const scrape = require("scrape-websitee")`
```js
const scrape = require("scrape-websitee")
```

# Endpoints
- ttsModel
```js
scrape.tools.ttsModel()
```
- tiktokTts
```js
scrape.tools.tiktokTts(text) // Audio result will be return as base64
```
- textToImage
`scrape.ai.textToImage(text)`

```js
scrape.ai.textToImage(text)
```
- uploadFile
`scrape.tools.uploadFile(buffer)`

```js
scrape.tools.uploadFile(buffer)
```
- enhanceImg
`scrape.tools.enhanceImg(url)`

```js
scrape.tools.enhanceImg(url)
```
- twitterdl2
`scrape.downloader.twitterdl2(url)`

```js
scrape.downloader.twitterdl2(url)
```
- igdl2
`scrape.downloader.igdl2(url)`

```js
scrape.downloader.igdl2(url)
```
- Threads
`scrape.downloader.threads(url)`

```js
scrape.downloader.threads(url)
```
- getCerpenHorror
`scrape.random.getCerpenHorror()`

```js
scrape.random.getCerpenHorror()
```
- fbdl
`scrape.downloader.fbdl(url)`

```js
scrape.downloader.fbdl(url)
```
- twitterdl
`scrape.downloader.twitterdl(url)`

```js
scrape.downloader.twitterdl(url)
```
- tiktokdl
`scrape.downloader.tiktokdl(url)`

```js
scrape.downloader.tiktokdl(url)
```
- igdl
`scrape.downloader.igdl(url)`

```js
scrape.downloader.igdl(url)
```
- cekResi
`scrape.tools.cekResi(kurir, resi)`

```js
scrape.tools.cekResi(kurir, resi)
```
- similarBand
`scrape.search.similarBand(query)`

```js
scrape.search.similarBand(query)
```
- pindl
`scrape.downloader.pindl(url)`

```js
scrape.downloader.pindl(url)
```
- igStalk
`scrape.search.igStalk(username)`

```js
scrape.search.igStalk(username)
```
- getCerpen
`scrape.random.getCerpen()`

```js
scrape.random.getCerpen()
```
- filmApikS
`scrape.search.filmApikS(query)`

```js
scrape.search.filmApikS(query)
```
- filmApikDl
`scrape.search.filmApikDl(url)`

```js
scrape.search.filmApikDl(url)
```
- otakuDesuSearch
`scrape.search.otakuDesuSearch(query)`

```js
scrape.search.otakuDesuSearch(query)
```
95 changes: 95 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,99 @@ const pickRandom = async (ext) => {
return ext[Math.floor(Math.random() * ext.length)];
};

function ttsModel() {
const model = {
source: `You can find model on this web https://tiktokvoicegenerator.com/`,
englishUS: {
female: "en_us_001",
male1: "en_us_006",
male2: "en_us_007",
male3: "en_us_009",
male4: "en_us_010",
},
englishUK: {
male1: "en_uk_001",
male2: "en_uk_003",
},
englishAU: {
female1: "en_au_001",
male1: "en_au_002",
},
french: {
male1: "fr_001",
male2: "fr_002",
},
german: {
female1: "de_001",
male1: "de_002",
},
spanish: {
male1: "es_002",
},
spanishMX: {
male1: "es_mx_002",
},
portugueseBR: {
female2: "br_003",
female3: "br_004",
male1: "br_005",
},
indonesian: {
female1: "id_001",
},
japanese: {
female1: "jp_001",
female2: "jp_003",
female3: "jp_005",
male1: "jp_006",
},
korean: {
male1: "kr_002",
male2: "kr_004",
female1: "kr_003",
},
chara: {
ghostFace: "en_us_ghostface",
chewbacca: "en_us_chewbacca",
cepo: "en_us_c3po",
stitch: "en_us_stitch",
stormtrooper: "en_us_stormtrooper",
rocket: "en_us_rocket",
},
singing: {
alto: "en_female_f08_salut_damour",
tenor: "en_male_m03_lobby",
sunshine: "en_male_m03_sunshine_soon",
warmy: "en_female_f08_warmy_breeze",
glorious: "en_female_ht_f08_glorious",
itGoesUp: "en_male_sing_funny_it_goes_up",
chipmunk: "en_male_m2_xhxs_m03_silly",
dramatic: "en_female_ht_f08_wonderful_world",
},
};
return model;
}

async function tiktokTts(text, model) {
try {
const modelVoice = model ? model : "en_us_001";
const { status, data } = await axios(
`https://tiktok-tts.weilnet.workers.dev/api/generation`,
{
method: "post",
data: { text: text, voice: modelVoice },
headers: {
"content-type": "application/json",
},
}
);
return data;
} catch (err) {
console.log(err.response.data);
return err.response.data;
}
}

async function textToImage(text) {
try {
const { data } = await axios.get(
Expand Down Expand Up @@ -578,6 +671,8 @@ module.exports = {
uploadFile,
enhanceImg,
cekResi,
tiktokTts,
ttsModel,
},
downloader: {
twitterdl2,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scrape-websitee",
"version": "1.0.28",
"version": "1.0.29",
"description": "Website Scraping",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 4f966c3

Please sign in to comment.