Coder Social home page Coder Social logo

tiktok-api-dl's Introduction

  

Hi there

I'm Tobz (21 y.o) ! 😎


Connect with me



Github Instagram Telegram WhatsApp Twitter




  About me

  • I'd like to do project that has relation to anime. 👻
  • A newbie to programming, but trying to get the hang of it.




  Technology I use


  • Language

    Javascript Python GO C Java Pascal

  • Website

    HTML5 CSS3 Bootstrap

  • Database

    Prisma MongoDB

  • Software & Tools

    Git GitHub NPM

  • IDE

    Visual Studio Code JetBrains Sublime




Github Stats

tiktok-api-dl's People

Contributors

3imad69 avatar nugraizy avatar tobyg74 avatar vasolix avatar zennn08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiktok-api-dl's Issues

Options for TikTokStalk

First of all, thanks for the repo!

Can you give options for the TikTokStalk function so that you can choose how many posts you want to scrape from a user?

And is there a way to get more than 35 Posts?

ERROR Request failed with status code 403

Hi Team,
I got error when using this lib in Nextjs production.

Tiktok.download .... response 403 error:
{ "status": "error", "message": "Request failed with status code 403" }

This error not happen in localhost. only run in server happen.
Please check and help

Posts empty in Stalk User

I try get user profile and posts feed with Tiktok.StalkUser();

But why posts return empty array?

And after trying to hit or refresh several times, the posts data will appear.

Is there something wrong? And can you fix it?

And is it possible to add a function to get posts feed by username?

Thank you for this tool!

Not Working on Vercel wIth Next.JS 403 Forbitten

I am trying to build my own downloader. I got error when I sent request on production it doesn't happens on localhost.

You can see my app here: https://tiked.vercel.app

bol(errored)]: null,
    [Symbol(kHighWaterMark)]: 16384,
    [Symbol(kRejectNonStandardBodyWrites)]: false,
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 403,
    statusText: 'Forbidden',
    headers: Object [AxiosHeaders] {
      server: 'nginx',
      'content-length': '0',
      'x-tt-system-error': '3',
      'proxy-status': '0000201403061000',
      'x-tt-trace-host': '01e11b73288eb114e390b13e0c7561618a4a1dba3aca6ecb8cc2669793af26e8d40bdb891b3e290b2ebc614e9db09a694a251d8f0225f1b2425979878fb12ff181f96bf1d85c9333078276aa27df7569a4',
      'x-tt-logid': '202309121400226B84A888AE8572102683',
      expires: 'Tue, 12 Sep 2023 14:00:22 GMT',
      'cache-control': 'max-age=0, no-cache, no-store',
      pragma: 'no-cache',
      date: 'Tue, 12 Sep 2023 14:00:22 GMT',
      'x-cache': 'TCP_MISS from a23-202-158-7.deploy.akamaitechnologies.com (AkamaiGHost/11.2.4-50766152) (-)',
      connection: 'close',
      'x-tt-trace-tag': 'id=16;cdn-cache=miss;type=dyn',
      'server-timing': 'cdn-cache; desc=MISS, edge; dur=1, origin; dur=7',
      'x-origin-response-time': '7,23.202.158.7',
      'x-akamai-request-id': 'a33467cc'
    },
    config: {
      transitional: [Object],
      adapter: 'http',
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [Object [AxiosHeaders]],
      method: 'head',
      url: 'https://www.tiktok.com/@yunsdespise/video/7226365854097706282?q=image%20slideshow&t=1694233131390',
      data: undefined
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'HEAD /@yunsdespise/video/7226365854097706282?q=image%20slideshow&t=1694233131390 HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'User-Agent: axios/1.5.0\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'x-vercel-id: sin1::ztbqx-1694527220519-699460779dbb\r\n' +
        'Host: www.tiktok.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'HEAD',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/@yunsdespise/video/7226365854097706282?q=image%20slideshow&t=1694233131390',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'www.tiktok.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 16384,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null
    },
    data: ''
  }
}

"Cannot read property 'responseUrl' of undefined"

I am attempting to create a TikTok video downloader using your library. The route.params.video_url is set to https://www.tiktok.com/@devslopes/video/7276699914241985835?is_from_webapp=1&sender_device=pc.

The issue I'm encountering only occurs when I execute the function in a React Native app. It does not occur when I run a script like node index.js. Below are the code examples for both scenarios:

Node.js Script:

const TiktokDL = require("@tobyg74/tiktok-api-dl");

TiktokDL("https://www.tiktok.com/@devslopes/video/7276699914241985835?is_from_webapp=1&sender_device=pc").then((result) => {
    console.log(result);
});

React Native Code:

import { Dimensions, View, Image } from 'react-native';
import { ActivityIndicator, Text } from 'react-native-paper';
import { useEffect, useState } from 'react';
import { DLResult } from '@tobyg74/tiktok-api-dl/lib/types';
import { TiktokDL } from '@tobyg74/tiktok-api-dl';

export default function ({ route, navigation }: any) {
    const [isLoading, setIsLoading] = useState<boolean>(true);
    const [data, setData] = useState<DLResult | null | void>(null);

    useEffect(() => {
        TiktokDL(route.params.video_url).then((result) => {
            setIsLoading(false);
            setData(result);
            console.log(result);
        });
    }, []);

    return (
        <View style={{
            height: Dimensions.get("window").height,
            backgroundColor: "#15131A"
        }}>
            <View style={{
                marginTop: 30,
                padding: 20
            }}>
                {isLoading ? <ActivityIndicator size={"large"} /> : null}
                {!isLoading && data && data.result != null ? (
                    <>
                        <View>
                            <View style={{
                                display: "flex",
                                flexDirection: "row",
                                justifyContent: "space-between",
                                alignItems: "center"
                            }}>
                                <View>
                                    <Image
                                        source={{
                                            uri: data.result.cover?.toString()
                                        }}
                                    />
                                </View>
                                <Text style={{ color: "#fff" }}>{data.result.description}</Text>
                            </View>
                        </View>
                    </>
                ) : null}
                {data?.status == "error" && (
                    <Text style={{ color: "red", fontSize: 16 }}>{data?.message}</Text>
                )}
            </View>
        </View>
    );
}

The issue I'm facing is titled "Cannot read property 'responseUrl' of undefined."

Result undefined for TiktokStalk

Hey

I'm getting undefined for result in:

TiktokStalk(username).then((result) => {
  console.log(result)
})

cookie or user-agent still valid?

Add TikTok "photo" to valid URL

The Tiktok slide URL is marked as an invalid link e.g: https://www.tiktok.com/@binance/photo/7364097008107326763

It might be better to add the "photo" slug to the regex pattern.

Failed to get the request form error on V3 version

Hello author, i was using this API this morning and it was working fine but now when i try to make an request to download music with the V3 version of the API, it gives me an error saying "failed to get the request form error" so is there any suggestions on what the problem could be? I would really appreciate if you resolve this issue, thanks.

My Code:
tt-error

Console Error:
image

Error with TiktokStalk

i try this:

const { TiktokStalk } = require("@tobyg74/tiktok-api-dl")

const username = "tobz2k19"

TiktokStalk(username).then((result) => {
  console.log(result)
})

and got this error:

{
  status: 'error',
  message: 'Client network socket disconnected before secure TLS connection was established'
}

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.