Coder Social home page Coder Social logo

Comments (15)

issue-label-bot avatar issue-label-bot commented on May 18, 2024

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.70. Please mark this comment with πŸ‘ or πŸ‘Ž to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

Are you able to add a new line above line 11 to do print(data).

What’s the response once you do that?

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

Actually, sorry I made that mistake. I thought this was an issue on my TikTokBot repo.

What value do you have results set to? Also is your directory to browsermob proxy correct?

from tiktok-api.

Steenos avatar Steenos commented on May 18, 2024

I changed the results value to 2 and now it seems to work. Is there a way to return the more results? And how would I go about returning a video url to download?

from tiktok-api.

Steenos avatar Steenos commented on May 18, 2024

Just figured out how to return the url by looking at the json file! But it would be nice to be able to return more values. results=2 is the most it seems to allow.

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

Yeah that's weird. In the unit tests for the api allows for over 100 to be fetched at a single time.

Can you try to run

from TikTokApi import TikTokapi
import requests

api = TikTokapi("path/to/browsermob-proxy")

trending = api.trending(10)

verbose = 0
count = 10
import requests

while True:
    url = "https://m.tiktok.com/share/item/list?id=&type=5&count=" + \
        str(count) + "&minCursor=0&maxCursor=0&_signature=" + \
        api.signature
    r = requests.get(url, headers={"authority": "m.tiktok.com", "method": "GET", "path": url.split("https://m.tiktok.com")[0], "scheme": "https", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
                                    "accept-encoding": "gzip, deflate, br", "accept-language": "en-US,en;q=0.9", "cache-control": "max-age=0", "upgrade-insecure-requests": "1",
                                    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"})

    data = r.json()
    response = []

    if data["statusCode"] != 0:
        if verbose == 1:
            print("Invalid Signature Retrying")
    else:
        for tiktok in data["body"]["itemListData"]:
            response.append(tiktok)
        while True:
            print(data)
            if count > len(response) and str(data['body']['hasMore']) == "True":
                url = "https://m.tiktok.com/share/item/list?id=&type=5&count=" + \
                    str(count - len(response)) + "&minCursor=0&maxCursor=" + \
                    data['body']['maxCursor'] + \
                    "&_signature=" + api.signature

                r = requests.get(url, headers={"authority": "m.tiktok.com", "method": "GET", "path": url.split("https://m.tiktok.com")[0], "scheme": "https", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
                                                "accept-encoding": "gzip, deflate, br", "accept-language": "en-US,en;q=0.9", "cache-control": "max-age=0", "upgrade-insecure-requests": "1",
                                                "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"})
                data = r.json()
                if data["statusCode"] == 0:
                    for tiktok in data["body"]["itemListData"]:
                        response.append(tiktok)
            else:
                print(response)
                break

from tiktok-api.

Steenos avatar Steenos commented on May 18, 2024

hmm, running that gives the same error.

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

Does it print out anything beforehand?

from tiktok-api.

Steenos avatar Steenos commented on May 18, 2024

in server.log it looks like its failing to start jetty server

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

Does it open the browser before giving you the error?

from tiktok-api.

Steenos avatar Steenos commented on May 18, 2024

Yes, this is the error: (main) Failed to start Jetty server. Aborting. java.net.BindException: Address already in use: bind

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

Can you try to close any running java programs or other programs that may be binding to a port?

from tiktok-api.

husligc avatar husligc commented on May 18, 2024

any plans to make a follow and unfollow function?

from tiktok-api.

davidteather avatar davidteather commented on May 18, 2024

any plans to make a follow and unfollow function?

Not currently because to login captcha bypass is required. If I were to create account login features the user would have to solve the captcha manually until a better option is found.

from tiktok-api.

husligc avatar husligc commented on May 18, 2024

Would you be interested in helping me make just a simple follow/unfollow script for myself? Thanks

from tiktok-api.

Related Issues (20)

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.