Skip to content

Videos that require login throw a 500 error #229

@Znuff

Description

@Znuff

Describe the bug
Some videos aren't shown without an account on TikTok, and will display something like:

This post may not be comfortable for some audiences. Log in to make the most of your experience.

While I understand why this can't be supported by ProxiTok, it would be nice if this exception was handled properly.

To Reproduce
Steps to reproduce the behavior:

  1. Go to instance-url/@myrraabela/video/7405874502959107360
  2. Receive a HTTP ERROR 500

Expected behavior
Would be nice if the exception was properly handled and the viewer notified of the error.

Logs

proxitok-web           | NOTICE: PHP message: PHP Warning:  Undefined property: stdClass::$author in /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php on line 38
proxitok-web           | NOTICE: PHP message: PHP Fatal error:  Uncaught TypeError: TikScraper\Models\Info::setDetail(): Argument #1 ($detail) must be of type object, null given, called in /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php on line 38 and defined in /var/www/html/vendor/pablouser1/tikscraper/src/Models/Info.php:36
proxitok-web           | Stack trace:
proxitok-web           | #0 /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php(38): TikScraper\Models\Info->setDetail()
proxitok-web           | #1 /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php(15): TikScraper\Items\Video->info()
proxitok-web           | #2 /var/www/html/vendor/pablouser1/tikscraper/src/Api.php(57): TikScraper\Items\Video->__construct()
proxitok-web           | #3 /var/www/html/app/Controllers/UserController.php(29): TikScraper\Api->video()
proxitok-web           | #4 [internal function]: App\Controllers\UserController::video()
proxitok-web           | #5 /var/www/html/vendor/bramus/router/src/Bramus/Router/Router.php(476): forward_static_call_array()
proxitok-web           | #6 /var/www/html/vendor/bramus/router/src/Bramus/Router/Router.php(440): Bramus\Router\Router->invoke()
proxitok-web           | #7 /var/www/html/vendor/bram...
proxitok-web           | 2024/08/24 21:46:03 [error] 10#10: *535 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined property: stdClass::$author in /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php on line 38; PHP message: PHP Fatal error:  Uncaught TypeError: TikScraper\Models\Info::setDetail(): Argument #1 ($detail) must be of type object, null given, called in /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php on line 38 and defined in /var/www/html/vendor/pablouser1/tikscraper/src/Models/Info.php:36
proxitok-web           | Stack trace:
proxitok-web           | #0 /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php(38): TikScraper\Models\Info->setDetail()
proxitok-web           | #1 /var/www/html/vendor/pablouser1/tikscraper/src/Items/Video.php(15): TikScraper\Items\Video->info()
proxitok-web           | #2 /var/www/html/vendor/pablouser1/tikscraper/src/Api.php(57): TikScraper\Items\Video->__construct()
proxitok-web           | #3 /var/www/html/app/Controllers/UserController.php(29): TikScraper\Api->video()
proxitok-web           | #4 [internal function]: App\Controllers\UserController::video()
proxitok-web           | #5 /var/www/html/vendor/bramus/router/src/Bramus/Router/Router.php(476): forward_static_call_array()
proxitok-web           | #6 /var/www/html/vendor/bramus/router/src/Bramus/Router/Router.php(440): Bramus\Router\Router->invoke()
proxitok-web           | #7 /var/www/html/vendor/bram" while reading response header from upstream, client: 172.23.0.1, server: _, request: "GET /@myrraabela/video/7405874502959107360 HTTP/1.0", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "127.0.0.1:8080"

Environment (please complete the following information):

  • Deployment method (if possible): docker
  • Frontend version: 2.5.0
  • Scrapper version: 2.6.1.2
  • PHP Version: 8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions