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

Trending `No items sent by TikTok!` #107

Closed Cyb3r14n-Security closed 1 year ago

Cyb3r14n-Security commented 1 year ago

Before submitting an issue, please make sure you are using the latest version of ProxiTok.

Describe the bug Whenever I click on the trending button it loads the page but says Warning: Undefined variable $feed in /cache/components-themes-card.latte--f14795951a.php on line 20 Warning: Attempt to read property "items" on null in /cache/components-themes-card.latte--f14795951a.php on line 20 Warning: foreach() argument must be of type array|object, null given in /cache/components-themes-card.latte--f14795951a.php on line 20 No items sent by TikTok!

To Reproduce Steps to reproduce the behavior:

  1. Copy docker-compose.yml file in the repo to portainer stack
  2. deploy stack
  3. go to url of instance
  4. click trending
  5. see error

Expected behavior See all the current trending videos on tiktok

Logs proxitok-web:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message [Thu Dec 01 14:24:14.603369 2022] [mpm_prefork:notice] [pid 9] AH00163: Apache/2.4.54 (Debian) PHP/8.1.12 configured -- resuming normal operations [Thu Dec 01 14:24:14.603460 2022] [core:notice] [pid 9] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND' 172.18.0.8 - - [01/Dec/2022:14:25:08 +0000] "GET /trending HTTP/1.1" 200 1914 "https://proxitok.home.tazy.xyz/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 172.18.0.8 - - [01/Dec/2022:14:26:47 +0000] "GET /about HTTP/1.1" 200 1667 "https://proxitok.home.tazy.xyz/trending" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 172.18.0.8 - - [01/Dec/2022:14:26:49 +0000] "GET /settings HTTP/1.1" 200 1475 "https://proxitok.home.tazy.xyz/about" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 172.18.0.8 - - [01/Dec/2022:14:27:03 +0000] "GET / HTTP/1.1" 200 1437 "https://proxitok.home.tazy.xyz/settings" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 172.18.0.8 - - [01/Dec/2022:14:28:06 +0000] "GET /trending HTTP/1.1" 200 1914 "https://proxitok.home.tazy.xyz/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0"

proxitok-signer:

App listening on port: 8080 Sent data from request with url: https://t.tiktok.com/api/recommend/item_list?count=30&id=1&sourceType=12&itemID=1&insertedItemID=&aid=1988&app_language=en&app_name=tiktok_web&browser_language=en-us&browser_name=Mozilla&browser_online=1&browser_platform=iPhone&browser_version=Mozilla%252F5.0%2B%2528Windows%2BNT%2B10.0%253B%2BWin64%253B%2Bx64%2529%2BAppleWebKit%252F537.36%2B%2528KHTML%252C%2Blike%2BGecko%2529%2BChrome%252F107.0.0.0%2BSafari%252F537.36%2BEdg%252F107.0.1418.35&channel=tiktok_web&cookie_enabled=1&device_platform=web_mobile&focus_state=1&history_len=3&is_fullscreen=0&is_page_visible=1&os=ios&priority_region=&referer=&region=us&screen_width=1920&screen_height=1080&timezone_name=America%2FChicago&webcast_language=en&device_id=8114417276633018211 Sent data from request with url: https://t.tiktok.com/api/recommend/item_list?count=30&id=1&sourceType=12&itemID=1&insertedItemID=&aid=1988&app_language=en&app_name=tiktok_web&browser_language=en-us&browser_name=Mozilla&browser_online=1&browser_platform=iPhone&browser_version=Mozilla%252F5.0%2B%2528Windows%2BNT%2B10.0%253B%2BWin64%253B%2Bx64%2529%2BAppleWebKit%252F537.36%2B%2528KHTML%252C%2Blike%2BGecko%2529%2BChrome%252F107.0.0.0%2BSafari%252F537.36%2BEdg%252F107.0.1418.35&channel=tiktok_web&cookie_enabled=1&device_platform=web_mobile&focus_state=1&history_len=3&is_fullscreen=0&is_page_visible=1&os=ios&priority_region=&referer=&region=us&screen_width=1920&screen_height=1080&timezone_name=America%2FChicago&webcast_language=en&device_id=5415019768026930860

proxitok-redis:

1:C 01 Dec 2022 14:24:14.105 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 1:C 01 Dec 2022 14:24:14.105 # Redis version=7.0.4, bits=64, commit=00000000, modified=0, pid=1, just started 1:C 01 Dec 2022 14:24:14.105 # Configuration loaded 1:M 01 Dec 2022 14:24:14.106 # Server initialized 1:M 01 Dec 2022 14:24:14.106 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

Enviroment (please complete the following information):

You can find the frontend and scrapper version on /about

NoPlagiarism commented 1 year ago

Trending is working on those instances:

So, TikTok isn't the problem this time, I guess?

Cyb3r14n-Security commented 1 year ago

The discovery tab is working fine and urls work just not trending

pablouser1 commented 1 year ago

Can confirm the issue. I'm investigating it

Trending is working on those instances:

* [pussthecat, FrontEnd 2.4.3.2, Scraper 2.3.2.2](https://proxitok.pussthecat.org)

* [manasiwibi, FrontEnd 2.4.2.0, Scraper 2.2.1.1](https://proxitok.manasiwibi.com/)

So, TikTok isn't the problem this time, I guess?

Probably those instances have it on cache, that's why it works ok.

pablouser1 commented 1 year ago

Looks like now TikTok always returns a 403 when doing a HEAD request to the homepage. This was used to get the ttwid cookie required for the Trending endpoint. Doing a GET instead of a HEAD works, but makes the request a little bit slower.

I'll change the HEAD to a GET, if I find another method that doesn't involve doing a GET request I'll change it.