laruche / audiotolunii

Audio to Lunii (studio)
MIT License
21 stars 1 forks source link

tts required API key #9

Open nherbaut opened 2 years ago

nherbaut commented 2 years ago

Hello, I'm not able to use the library with the following message: googletss being an entreprise feature, it requires me to allow billing, which I don't want. Could you please make it possible to opt-out of tts through the CLI ?

sudo audioToLunii podcast -url https://feed.ausha.co/B6r8OclKP6gn -limit 30
We will convert 30 of your podcast url : https://feed.ausha.co/B6r8OclKP6gn
 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA: 0s | 0/38/usr/lib/node_modules/audiotolunii/node_modules/google-tts-api/lib/key.js:30
    if (!matches.length) throw new Error('get key failed from google');
                               ^

Error: get key failed from google
    at /usr/lib/node_modules/audiotolunii/node_modules/google-tts-api/lib/key.js:30:32
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.exports.podcast (/usr/lib/node_modules/audiotolunii/lib/parser.js:92:18)
(base) nherbaut@ares:~/tmp/oli$ sudo audioToLunii podcast -url https://feed.ausha.co/B6r8OclKP6gn -limit 30
We will convert 30 of your podcast url : https://feed.ausha.co/B6r8OclKP6gn
 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA: 0s | 0/38/usr/lib/node_modules/audiotolunii/node_modules/google-tts-api/lib/key.js:30
    if (!matches.length) throw new Error('get key failed from google');
                               ^

Error: get key failed from google
    at /usr/lib/node_modules/audiotolunii/node_modules/google-tts-api/lib/key.js:30:32
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.exports.podcast (/usr/lib/node_modules/audiotolunii/lib/parser.js:92:18)
nherbaut commented 1 year ago

@laruche any news on this? Xmas is coming, and we would love to have it for the calendrier de l'avent...

mathemagie commented 1 year ago

Hello, much better after updating to version 2.0.2 of google-tts-api

https://www.npmjs.com/package/google-tts-api

and replace all calls to googleTTS by googleTTS.getAudioUrl in the source code, which gives

var titleUrl = await googleTTS.getAudioUrl(story.title, 'en', 1) for example.

I test this after with the zip generated by the tool.

pierrecorsini commented 9 months ago

Is a solution available without having to edit the code ?