Giter Site home page Giter Site logo

tiktok-api's Issues

Cant use any feature

i am only being able to login, data of my account is fetching but whenever i try to use any other feature as listing post or something like that i always i get undefined, even tho i define it as you said.

Add missing fields to Post interface

Is your feature request related to a problem? Please describe.
The Post interface is missing several parameters that have been added in recent updates, e.g. sticker_detail, which describes the filter that was used with a video.

Describe the solution you'd like
Add any new interesting/relevant fields. There are fields like cmt_swt and label_top which are missing but don't seem relevant at this point in time so can be left out.

Is there a way to get all posts regardless of users?

First of all, you've done an amazing job. Well done.
I am looking at this api now: .listPosts(params)
It seems to me it is limited to get posts based on users according to your param example.
api.listPosts({
user_id: '<user_id>',
max_cursor: 0,
})
.then(res => console.log(res.data.aweme_list))
.catch(console.log);

So my question is, can we get all posts regardless of users?
Your answer would be appreciated.
Regards!

device_id

hello device_id how do I create it?

Add functionality to save and load cookies

At the moment you have to login every time you start a new instance of the API. Sessions last longer than that, so we should have the ability to load and use an existing session.

Hi

Please reply to me if you have time

How to register a new device?

If you try to generate fresh device details you're unable to login successfully until device is registered with api it seems. You can use the same device for multiple accounts however you hit request limits extremely quickly. I see that the app makes an api call to register a new device however the data it posts seems to be encrypted. any idea on what is being sent over to the api during this post call?

A 20-character anti-spam parameter. How to create

export interface AntiSpamParams {
/** A 20-character anti-spam parameter */
as: string;

/** A 20-character anti-spam parameter */
cp: string;

/** An encoded version of the 'as' anti-spam parameter */
mas: string;
}

how to create as and mas param?

Upgrade to TikTok v9.1.0

The latest official version this API supports is 8.2.0, which was released back in August 2018 (though the API still works with 9.1.0). The official API calls now include an x-tt-token (sourced from the login response headers), as well as several more metadata parameters (e.g. pass-region, pass-route). The app_name has also changed from normal to musical_ly.

All of these should be added to the API.

follow returns successful but does not follow user

using api, i get a successful response however follow isn't actually created. I can confirm that while using MeMu emulator upon clicking follow button it says following however viewing that users profile i still see follow button. On my profile follower count increases yet user is not within follower list. tiktok must be recognizing something from both api code and emulator and stopping follow action behind the scenes.

List "For You" page?

Hi,

Is it possible to get a list of "For You" videos similar to what we get in the .listPosts ?

I am assuming that .listPosts only lists videos of the current user_id. Would be good to list all videos for all users, as they appear in the "For You" page screen.

For example:
.listForYouPosts(params)
Lists posts for the user's For You page.

api.listForYouPosts({
user_id: '<user_id>',
max_cursor: 0,
})
.then(res => console.log(res.data.aweme_list))
.catch(console.log);

// Outputs:
// [{ author: {...}, aweme_id: '999', desc: 'description', music: {...}, statistics: {...}, video: {...} },

Tiktok Live

Do you have any plans to add endpoints for live streams on Tiktok?

Access QR codes

Thank you for all of the work you have put into the current api. I would like to know if it would be possible to implement access to viewing a users qr code via username or userid?

Spam-Params

Hello Jack , I want use to Tiktok api but i did not understand Spam Parameters and have a question , does api working now ?

Dynamically creating the antispam parameters...

Any ideas on this? They seem to be renewed with every request and they also seem to be required for every API call I've tried...

I've found a function appendAntiSpamParams and I've recreated the byteArrayToHexStr function but a) I don't see anywhere where the ts argument is used (and it must be because if it was just based off of the deviceId, the spam params would be the same every time) and b) there's some sort of encoding that happens before the hex function and I lost the will to persevere, trying to navigate their code.

Get Followed users return empty response in .NET

Hello,

First of all, thanks for such an amazing work you have put in into this API.

I am currently trying to implement this API on an ASP.NET server, with some success. But aweme/v1/user/follower/list/ is giving me a headache. I receive empty response when calling it using HttpClient on my ASP.NET server. I use the parameters from my own device, and can get my followers on Postman with no issues. Doesn't work in C#.

This is the code I use:

bool hasMore = true;
int maxTime = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds;

string request = $"https://api2.musical.ly/aweme/v1/user/follower/list/?{params}";

using (HttpClient client = new HttpClient(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Deflate }))
            {
                var req = new HttpRequestMessage(HttpMethod.Get, request);
                var response = await HttpClient.SendAsync(req);
                using (Stream stream = await response.Content.ReadAsStreamAsync())
                using (StreamReader reader = new StreamReader(stream))
                {
                    var json = JObject.Parse(await reader.ReadToEndAsync());
                    JArray followers = json.Value<JArray>("followers");
                    foreach (JObject follower in followers)
                    {
                        string id = follower.Value<string>("uid");
                        if (id.Equals(tikTokUserId)) return true;
                    }
                    hasMore = json.Value<bool>("has_more");
                    maxTime = json.Value<int>("min_time");
                }
            }

I tried different ways of sending the request, but the result is always the same. I understand if you can't help, and feel free to close the issue if you consider it irrelevant to the project.

Thanks!

Cannot build TS projects that use this library

When trying to build with tsc, you get several errors like so:

error TS2307: Cannot find module '../node_modules/axios/index'

The generated index.d.ts file for example contains the following axios imports:

loginWithEmail: (email: string, password: string) => Promise<import("../node_modules/axios/index").AxiosResponse<API.LoginResponse>>;
loginWithUsername: (username: string, password: string) => Promise<import("../node_modules/axios/index").AxiosResponse<API.LoginResponse>>;

This is one level off where node_modules actually is:

- /project_root
  |- /node_modules
    |- /tiktok-api
      |- /lib
         - index.d.ts

Therefore in index.d.ts the path ../node_modules/axios/index resolves to tiktok-api/node_modules/axios/index, which is invalid.

This can be fixed by setting baseUrl to ./lib in tsconfig.json

Where to start?

What would be needed to download all videos from someones (my) profile? I have over 1,000 and don't feel like downloading each one.. I've been learning python, but the documentation here is fuzzy. Any help is appreciated!

Add examples

Is your feature request related to a problem? Please describe.
It's difficult for new users to get started quickly because there isn't an example that works out-of-the-box to see and play around with.

Describe the solution you'd like
Add an examples/ folder with some simple examples.

Add methods to get posts by music and by stickers

Is your feature request related to a problem? Please describe.
There are a couple more endpoints for which there is no method available yet.

Describe the solution you'd like
'/aweme/v1/music/aweme/' with param music_id
'/aweme/v1/sticker/aweme/' with param sticker_id
They both use cursor instead of max_cursor in requests and responses.

Additional context
Stickers are the video filters/effects.
I haven't looked at these extensively yet, so there might be other differences between listPosts and these.

anti-spam parameter

I use <redacted> but following does not show up on my profile.

object(stdClass)#250 (5) {
  ["status_code"]=>
  int(0)
  ["status_msg"]=>
  string(25) "Başarıyla takip edildi!"
  ["log_pb"]=>
  object(stdClass)#251 (1) {
    ["impr_id"]=>
    string(32) ""
  }
  ["follow_status"]=>
  int(1)
  ["extra"]=>
  object(stdClass)#252 (3) {
    ["logid"]=>
    string(32) ""
    ["now"]=>
    float(1536489137635)
    ["fatal_item_ids"]=>
    array(0) {
    }
  }
}

Error while importing getRequestParams

I am running the app like this:-
node --experimental-modules index.mjs

and this is line is giving error
import TikTokAPI, { getRequestParams } from 'tiktok-api';

error:-

(node:5872) ExperimentalWarning: The ESM module loader is experimental.
TypeError: getRequestParams is not a function
    at file:///D:/Node.js/FirstTry/index.mjs:14:16
    at ModuleJob.run (internal/loader/ModuleJob.js:97:14)
    at <anonymous>

P.S I am new to node.js.

A 20-character anti-spam parameter what does means

export interface AntiSpamParams {
/** A 20-character anti-spam parameter */
as: string;

/** A 20-character anti-spam parameter */
cp: string;

/** An encoded version of the 'as' anti-spam parameter */
mas: string;
}

how do create as and mas?????

Example of work in production use

I was able to port this code over to PHP and I made a simple platform using it. TikTok has long and ugly profile URLs. Outside of this wrapper and the actual app there really is no solid way to be able to view a TikTok profile just by knowing the username. With that in mind I put together TikTok2.me which provides users with easy to remember tiktok2.me/username profile links. Users can visit the homepage, enter their username and be provided with a URL or they can just link to tiktok2.me/username and it will function the same.

https://tiktok2.me

Consulting

Hey! @szdc

Can you reach out to me on skype at hacky20091?

I'd like to pay you to help me develop a small web application using this api... I can delete this issue after you contact me.

Thanks,
J

Add a method to get a post by its id

Is your feature request related to a problem? Please describe.
Currently the only way to get a post's data is to get all posts from a user until the desired post is reached.
The API has a way to get a single post if you know its id which can be useful sometimes.

Describe the solution you'd like
The API call is 'aweme/v1/aweme/detail/' with param aweme_id
The result contains the Post in aweme_detail

Additional context
There are some minor differences in the data returned by this call compared to the one used in listPosts(), but nothing important is missing. Can provide examples if needed.

Post new videos

Is your feature request related to a problem? Please describe.
There currently isn't the ability to post new videos/content.

Describe the solution you'd like
An API call we can use to post new videos/content.

Name the types loaded in the main API file

Having all the explicit imports has led to imports taking up the first 45+ lines of this file, reducing readability.

Use import * as Network from './types'; or similar to resolve this.

List, approve and deny follow requests

When your account is private, you get notified when someone requests to follow you. Add the endpoint to these requests and the endpoints to approve and deny them.

Contact?

Hey Jack, amazing job building this. I am not a developer and was interested in having someone build custom scripts that would help me get good usage of this API, is that something you could help with? I could pay you for your time :) if so let me know where I could contact ya!

anti-spam parameters

Can you expand more on this topic? Can you give some kind of example or explain what you want to say with "a method that signs the URL with anti-spam parameters".
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.