pablouser1 / ProxiTok

Open source alternative frontend for TikTok made using PHP
https://github.com/pablouser1/ProxiTok/wiki/Public-instances
GNU Affero General Public License v3.0
1.86k stars 135 forks source link

[INSTANCES] "New" public instance proxitok.privacydev.net #72

Closed PrivacyDevel closed 2 years ago

PrivacyDevel commented 2 years ago

Since ProxiTok is working again, I am now hosting it again as well. :)

NoPlagiarism commented 2 years ago

Discover/Trending is not working Maybe because version is lower Despite, it's working

PrivacyDevel commented 2 years ago

Thanks for letting me know! I updated everything and tested it. Should be working now. :)

x0rld commented 2 years ago

I can't access to any profile image

NoPlagiarism commented 2 years ago

@x0rld proxitok/tik tok problem Official too 2.4 ProxiTok or 2.2 TikTok Scraper* problem

x0rld commented 2 years ago

ok

pablouser1 commented 2 years ago

I can't access to any profile image

That issue has been fixed thanks to pablouser1/TikScraperPHP@53024570fe8a0258d911e5a245fe582090739a19

The official instance has been updated so it should work now. Looks like TikTok is making changes again?

Also, @PrivacyDevel thanks for hosting it again! I've added it to the instance list, make sure to update to the latest version of the Scraper (2.2.1.0), it should work properly now.

PrivacyDevel commented 2 years ago

I can't access to any profile image

That's strange. Profiles seem to be working just fine for me. Could you maybe give me a link to a profile that's broken?

Thank you, @pablouser1! I'll update it now.

PrivacyDevel commented 2 years ago

Uhm... I updated it and after that it stopped working for me... Rolled back to 67c080e5f49ad34baefa9399dbe1cf2d8ca49e78 for now, as that actually still works for me.

x0rld commented 2 years ago

it works for me too thx ! 🎉

PrivacyDevel commented 2 years ago

Never mind. I've replaced tiktok-signature with SignTok now and updated ProxiTok to the newest version. Everything seems to be working like this and it's much lighter on resources too. Nice. :)

NoPlagiarism commented 2 years ago

Everything seems to be working like this and it's much lighter on resources too. Nice. :)

@PrivacyDevel, so you can close issue now, if no problems anymore :D

PrivacyDevel commented 2 years ago

I was about to close it but... Now now profiles don't seem to be working anymore for some reason... :( I didn't change anything and even tried to use the official signer, just to make sure. Still broken... And yet there are other instances, like the official herokuapp one that still work... Any ideas how I could fix that? Or do I just have to wait it out again...?

NoPlagiarism commented 2 years ago

How did you set up your instance?

PrivacyDevel commented 2 years ago

I set it up manually. I've used https://signtok.vercel.app/api/signature as well as my own and it doesn't really work with either of them. I just get the same error from that screenshot before. I don't see anything in the logs that would help me in any way. When I start a server with php -S ADDRESS and read the console output, I don't see anything either. And when I comment out API_SIGNER_URL completely, not even the discover page will load anymore, and I get an error saying that it can't connect to the signer..

I tried to revert back to the second newest commit but that did not help either. And apparently I'm not blacklisted either.

I'm starting to run out of ideas... And I really don't want to go back to the second second newest commit with the old chromium based signer if I can avoid it.

NoPlagiarism commented 2 years ago

It's kinda strange, that video works So it's double weird, and signer maybe not the problem

NoPlagiarism commented 2 years ago

What if IP ban? Have you tried curl request?

NoPlagiarism commented 2 years ago

Also, can make theory that something wrong with cache engine

PrivacyDevel commented 2 years ago

Yeah, Idk... I removed the files inside of the cache folder before (not including the directories themselves) and that didn't make any difference either. And now I re-cloned it and executed the composer install again as well. Exact same situation. The video you linked me works as well but user pages do not.

I tried the curl command and got an HTML document with a lot of JS as a response. The HTTP code was 200 and the title was just "TikTok". And to be extra sure, I used my server as a proxy for Firefox real quick to check if https://tiktok.com still works correctly, and it does. So no problems there, apparently.

I did not enable JSON nor Redis caching btw. So that should probably not be the issue either, I'd assume.

NoPlagiarism commented 2 years ago

I tried Docker image with no env variable API_CACHE It's not the same error, but No items sent by TikTok! So it could be the problem

Edit: maybe it's problem just with me... But at least try? 🤔

PrivacyDevel commented 2 years ago

I tried it with and with API_CACHE unset, set to json (and it does create those JSON cache files, I checked) and set to redis with the other required host and port envs set accordingly. Still the exact same issue.

PrivacyDevel commented 2 years ago

Aaaand now it just works.... Wtf?

PrivacyDevel commented 2 years ago

Never mind. It's still broken most of the time... Sometimes it works for a short while and then it breaks again.. I even installed php8 and tried it with that to more closely match the Docker image but that did not make any difference either.

Currently I installed the following packages from the default Debian stable repos for ProxiTok: composer php-redis php-curl php-zip php-fpm php-dom

And all of this sits behind an nginx reverse proxy. I set up my own SignTok instance on the same host and my instance works equally well / bad with that one as it does with the official one. I'm pretty damn sure URLs are not incorrect either because the error message changes when I intentionally provide an invalid URL. There are no error messages in the php logs whatsoever. I'm not blocked by tiktok.com, sometimes everything works just fine and then the user pages just break again.. I really don't know what I can try anymore at this point short of using the Docker image, which I do not want to use. Then again, I did follow the commands of the Dockerfile basically verbatim.

NoPlagiarism commented 2 years ago

Again my stupid thoughts, but I just place it here: https://github.com/oberd/php-8.1-apache/blob/main/README.md#pre-installed-php-extensions You can watch through the list if helps

PrivacyDevel commented 2 years ago

Ok, well, I finally bit the bullet and installed and tried to test it with Docker on my server with the exact same results from before...

The command that I used to test this with was the following: docker run -it --rm -p 5112:80 -e LATTE_CACHE=/tmp -e API_SIGNER_URL=https://signtok.vercel.app/api -e API_SIGNER=remote ghcr.io/pablouser1/proxitok:master

PrivacyDevel commented 2 years ago

Oh my.... Would you look at that. Apparently it IS an IP ban of sorts after all! I just tried to change the user agent string before to check if that changes anything, which it didn't. And now I just patched the few curl calls in the tikscraper library to use a proxy and voila! It works!

I guess I will see where this is actually necessary and create a pull request for that workaround to the tikscraper repo.

PrivacyDevel commented 2 years ago

Ok, fixed it now. I just set a proxy for the curl calls in the Sender.php file from tikscraper. It does not seem to be necessary in the other places and would just needlessly slow things down there. I also enabled Redis caching now, which should lower the number of requests that my server sends to TikTok by a lot as well and speed up user page loads.

I'm not sure if I actually should submit a patch to tikscraper tho because it seems like a really ugly hack. But I guess it would be an option to add support for a SENDER_PROXY environment variable?

Anyway, for anybody that runs into this problem as well, this is how I solved it. And really do make sure to enable JSON or Redis caching as well.

pablouser1 commented 2 years ago

Hi @PrivacyDevel, TikScraper has proxy support but ProxiTok doesn't have any enviromental variables to modify it. I'll add it on the next release.

PrivacyDevel commented 2 years ago

That would be great! :) And if you could add a special one that only get used in Sender.php that would be perfect! This is the only place where I seemed to need it the other calls apparently still worked. And using a proxy in places where you don't need to just needlessly slows things down.

pablouser1 commented 2 years ago

I've added Proxy support on 96fb2fd4285cb35ddc2b11438726d185621753fd

Please update both ProxiTok and TikScraper and check https://github.com/pablouser1/ProxiTok/wiki/Configuration#proxy for the env variables required

And if you could add a special one that only get used in Sender.php that would be perfect

Right now requests are only sent through a proxy if it goes to TikTok. Any other required external service (Signer) doesn't has the option to use a proxy