snuzi/tiktok-scraper-php

Invalid response

dunkukoder opened this issue · 21 comments

Request body returns empty. Maybe something changed?

Error code:
Fatal error: Uncaught sabri\tiktok\exceptions\InvalidResponseException: Invalid response in tiktok-scraper-php-master\src\TiktokApi.php:83

snuzi commented

Please provide me some more details about your code.

example/demo.php
<?php

require __DIR__ . '/../vendor/autoload.php';
(Dotenv\Dotenv::create(__DIR__ . '/../'))->load();

use sabri\tiktok\TiktokApi;

$client = new TiktokApi([
'device_id' => getenv('DEVICE_ID'),
'iid' => getenv('IID'),
'openudid' => getenv('OPENUDID')
]);

$uid = 'realmadrid';
$user = $client->searchUser($uid);

var_dump($user);

And .env file
#tiktok device variables
DEVICE_ID=6749689776159213061
IID=6749690177411008261
OPENUDID=c04a0021ec1f4988
thanks for attention

snuzi commented

Thank you for details, it looks like there are changes from Tiktok. This needs some investigations. I will let you know as soon as I have some news.

Ok. I am waiting. I tried to create same request with mitm proxy. But it doesnt work.

Hi,
i am using this library in my codeigniter project. But i am not getting any thing.
And i am also confused about the device_id, iid, and openudid. What are these variables.??
Here is the code

<?php

	require __DIR__ . '/../vendor/autoload.php';
	(Dotenv\Dotenv::create(__DIR__ . '/../'))->load();

	use sabri\tiktok\TiktokApi;

	$client = new TiktokApi([
		'device_id' => getenv('295BA56C25276BDB'),
		'iid' => getenv('IID'),
		'openudid' => getenv('OPENUDID')
	]);

	$uid = '@joshgancas';
	$user = $client->getUser($uid);

	var_dump($user);
snuzi commented

@Tayyab985 recently there have been some changes done by Tiktok in their Rest API which I need do find out.
device_id, iid, openudid are some extra parameters in your mobile device which Tiktok app uses when communicating with Rest API. You can find these parameters by inspecting Tiktok app http requests using some proxy applications.

@snuzi any updates?

any updates?

any update ?

any update?

@snuzi any update?

Any Update @snuzi

@snuzi Any update?

@Tayyab985 recently there have been some changes done by Tiktok in their Rest API which I need do find out.
device_id, iid, openudid are some extra parameters in your mobile device which Tiktok app uses when communicating with Rest API. You can find these parameters by inspecting Tiktok app http requests using some proxy applications.

Could you please some proxy application where I could find it.?

Have you fixed the issue of no response ?

@rohailparacha @creativehassan @design365 Guys that repo works really good https://github.com/drawrowfly/tiktok-scraper

Do you have example in PHP ?

@snuzi Any update?

@dunkukoder

And .env file
#tiktok device variables
DEVICE_ID=6749689776159213061
IID=6749690177411008261
OPENUDID=c04a0021ec1f4988
thanks for attention

Where i need to get the DEVICE_ID={device_id} IID={iid}} OPENUDID={openudid}}?

@snuzi any update about invalid response?

not working for me. after hours of relentless googling I had to use https://rapidapi.com/neotank/api/tiktok-bulletproof for now (luckily I just needed profile information requests)