Skip to content

Commit

Permalink
Fix for music videos list
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGrubb committed Nov 18, 2020
1 parent f077bbb commit cff3cf8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/musicVideos.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$scraper = new Scraper($config);

try {
$data = $scraper->music->videos(6821468236035541766, 1);
$data = $scraper->music->videos(6821468236035541766, 30);

// Check for an error here.
if ($scraper->error) print_r($scraper->error);
Expand Down
18 changes: 8 additions & 10 deletions src/TikTok/Core/Resources/Endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Endpoints {
],

'user-videos' => [
'url' => 'https://m.tiktok.com/api/item_list/?',
'url' => 'https://www.tiktok.com/api/item_list/?',
'vars' => [
'aid' => 1988,
'app_name' => 'tiktok_web',
Expand Down Expand Up @@ -228,7 +228,7 @@ class Endpoints {
],

'music-videos' => [
'url' => 'https://m.tiktok.com/api/item_list/?',
'url' => 'https://m.tiktok.com/api/music/item_list/?',
'vars' => [
'aid' => 1988,
'app_name' => 'tiktok_web',
Expand All @@ -237,17 +237,15 @@ class Endpoints {
'cookie_enabled' => true,
'did' => '',
'secUid' => '',
'id' => '',
'type' => 1,
'musicID' => '',
'count' => 25,
'minCursor' => 0,
'maxCursor' => 0,
'language' => 'en',
'sourceType' => '11',
'cursor' => 0,
'verifyFp' => '',
'region' => 'US',
'appId' => '1233'
]
'appId' => '1233',
'appType' => 'm'
],
'disableSignature' => true
],
]
];
Expand Down
2 changes: 1 addition & 1 deletion src/TikTok/Requests/MusicRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function download ($id, $path = './', $customName = false) {
* Gets trending videos
*/
public function videos ($id, $count = 25) {
$endpoint = $this->instance->endpoints->get('m.music-videos', [ 'id' => $id, 'count' => $count ]);
$endpoint = $this->instance->endpoints->get('m.music-videos', [ 'musicID' => $id, 'count' => $count ]);
$musicVideos = $this->instance->request->call($endpoint)->response();

// If there is an error, set the error in the parent, return false.
Expand Down

0 comments on commit cff3cf8

Please sign in to comment.