szdc / tiktok-api

Unofficial API wrapper for TikTok
MIT License
1.28k stars 279 forks source link

Impossible to initiate the project #209

Closed Nesslax closed 3 years ago

Nesslax commented 3 years ago

Describe the bug i tried ti initiate a class with this livrary but no way to do it

To Reproduce

the library is called via : const tiktok = require('tiktok-api');

Here is the constructor

constructor(broadcastwu){
    const signURL = async (url, ts, deviceId) => {
      const as = 'anti-spam parameter 1';
      const cp = 'anti-spam parameter 2'
      const mas = 'anti-spam parameter 3';
      return `${url}&as=${as}&cp=${cp}&mas=${mas}`;
    }

    // Required - device parameters
    // You need to source these using a man-in-the-middle proxy such as mitmproxy,
    // CharlesProxy or PacketCapture (Android)
    const params = tiktok.getRequestParams({
      device_id: '<device_id>',
      fp: '<device_fingerprint>',
      iid: '<install_id>',
      openudid: '<device_open_udid>',
    });

    this.tiktok = new tiktok(params, { signURL });

    this.username = "";
    this.password = "";
    this.title="";
    this.broadcastWU="";
    this.broadcasttiktok="";
    this.status="";
    this.verificationMethod="";
    this.two_factor_identifier="";
    this.title="";

  }

Expected behavior

[nodemon] app crashed - waiting for file changes before starting...
[nodemon] restarting due to changes...
[nodemon] starting `node start index.js`
Example app listening at http://localhost:8082
/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/tiktokClass.js:24
    this.tiktok = new tiktok(params, { signURL });
                  ^

TypeError: tiktok is not a constructor
    at new TiktokClient (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/tiktokClass.js:24:19)
    at /Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/index.js:25:38
    at Layer.handle [as handle_request] (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/layer.js:95:5)
    at /Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/index.js:281:22
    at param (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/index.js:354:14)
    at param (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/Users/youssef/Workspace/Web projects/InstagramLive/live-stream-interface/tiktokAPI/node_modules/express/lib/router/index.js:410:3)

Additional context Add any other context about the problem here.

aimadnet commented 3 years ago

TikTok updated their API, the anti spam parameters as, cp and mas aren't working anymore.

Nesslax commented 3 years ago

Can you give me an exemple how to setup the projet so i can work on it please ?

aimadnet commented 3 years ago

This repo isn't working anymore, it's outdated.

Message me on telegram: aimadnet

szdc commented 3 years ago

Closing as this project is no longer maintained.