Weilbyte / tiktok-tts

Generate TikTok Text-to-Speech voices in your browser
https://weilbyte.github.io/tiktok-tts/
MIT License
401 stars 87 forks source link

API Link returns 404 #10

Closed rschoolu closed 2 years ago

rschoolu commented 2 years ago

The API Link returns a 404 error.

Weilbyte commented 2 years ago

Hi, I am aware

rschoolu commented 2 years ago

I don't think it's something in the code that's faulty. It's probably the API link itself.

Weilbyte commented 2 years ago

Yes, they have changed the API endpoint for TTS

rschoolu commented 2 years ago

How would this be fixed? Or is it unfixable?

Petter1515 commented 2 years ago

I hope it will be fixed.

elidigital commented 2 years ago

Is this fixable?

rschoolu commented 2 years ago

I don't know. Maybe if like a new link can be found or something? For the api cuz the api link returns a 404, meaning it doesn't exist anymore, maybe it got moved.

ItsFreshify commented 2 years ago

i believe if you sign up to become a tiktok devolper they give you the api info

Weilbyte commented 2 years ago

@ItsFreshify I looked around and it's a very limited subset of their API that they give you access to. It does not include the TTS engine.

rschoolu commented 2 years ago

so does this mean that tiktok tts rip?

On Mon, Aug 29, 2022 at 6:03 PM Weilbyte @.***> wrote:

@ItsFreshify https://github.com/ItsFreshify I looked around and it's a very limited subset of their API that they give you access to. It does not include the TTS engine.

— Reply to this email directly, view it on GitHub https://github.com/Weilbyte/tiktok-tts/issues/10#issuecomment-1230909905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZRSAYXVDVCN6J2MED7JN3TV3UXSHANCNFSM57I3PHCQ . You are receiving this because you authored the thread.Message ID: @.***>

Weilbyte commented 2 years ago

If I recall correctly, oscie57's python CLI tool. Generally yes but I have not been successful in intercepting the HTTPS traffic from the app, because it crashes on every emulator I tried it on, now, the TikTok Lite app works but It doesn't seem to have TTS support so it's not making those requests anyway.

And I don't have a rooted Android phone at hand. Even if I did I'm pretty sure if this was a deliberate action towards tools like this, that they would have also added authentication requirements to the endpoint.

pcurz commented 2 years ago

I have a device with root, and properly hiding it from tiktok, but can't intercept the requests too, it does work triggering the tts when editing a video tho

Also for emulator, nox works but you can't hide root since it isn't magisk and you can not log in

Weilbyte commented 2 years ago

@xfrcc which android version? iirc if above 6.0, you need to patch the APK to accept the MITM proxy's CA

pcurz commented 2 years ago

@xfrcc which android version? iirc if above 6.0, you need to patch the APK to accept the MITM proxy's CA

7.1.2, i've tried patching with apk-mitm, but not working because apktool it's parsing bad the xml's

pcurz commented 2 years ago

Got news, new endpoint is api22-normal-c-useast1a.tiktokv.com, however, you must replicate now the headers like if it was in the app, i will test which one is necessary and which one is redundant

EDIT: Ok the url must be of the formhttps://api22-normal-c-useast1a.tiktokv.com/media/api/text/speech/invoke/?text_speaker=code&req_text=text&aid=1233 (can't really confirm if aid is static, please check)

Now the headers, the User Agent should be com.zhiliaoapp.musically/2022600030 (Linux; U; Android 7.1.2; es_ES; SM-G988N; Build/NRD90M;tt-ok/3.12.13.1) Cookie header should be sessionid=xxxxxxxxxxxxxxxxxxxxx

How to get the sessionid?, install nox and install Magisk Delta follow the steps to download, why magisk if nox already includes root?, because nox's built-in root is old and you can't hide it from apps, if you don't hide it from tiktok you won't be able to login

Also install http toolkit, and connect via adb Setup frida-server so you can inject scripts for SSL unpinning run this script Look at the headers in HTTP Toolkit from your PC and copy the sessionid

Weilbyte commented 2 years ago

Thank you! I will attempt to reproduce and see how this can be implemented within this tool.

rschoolu commented 2 years ago

does this mean that the tts could work again?

AdamAtomus commented 2 years ago

couldn't you use the session id from the web on pc? image

AdamAtomus commented 2 years ago

I get the Couldn't load speach, maybe it requires it to be a sessionid generated by logging in on phone? Not too sure, https://i.imgur.com/oPSNJiI.png

Weilbyte commented 2 years ago

A solution is in the works and expected to be out by Friday, if everything goes smoothly.

@AdamAtomus the aid parameter is wrong, it needs to be 1233

AdamAtomus commented 2 years ago

A solution is in the works and expected to be out by Friday, if everything goes smoothly.

@AdamAtomus the aid parameter is wrong, it needs to be 1233

yeah same issue, what SID did you use? from the app or from website on pc

also sent you a friend request on discord, If you can accept and help me there thanks ;)

Weilbyte commented 2 years ago

Should be working now (thanks to @xfrcc). It might not be stable initially, but It'll get improved more.

Petter1515 commented 2 years ago

Thank you! @xfrcc and @Weilbyte ! Cheers!