Giter Club home page Giter Club logo

tiktok-bulk-downloader's Introduction

tiktok-bulk-downloader

TikTok videos bulk downloader with or without watermark by username.

prerequisites

General requirements

pip -q install pycryptodome pycryptodomex

no watermark requirements

pip -q install selenium webdriver_manager

usage

Script arguments

  • -u --username
  • -g --generate
  • -d --download
  • -nw --no-watermark
  • At first, you should run the script with "generate" option. This will generate and save json file that conatins all user posts data.
    Note: Do not incloud "@" to the target username

    python tiktok_dl.py --username [target username] --generate
    

    You can after that download the videos from the latest saved json file you generate.

    python tiktok_dl.py --username [target username] --download
    

    Use "no-watermark" argument in case you want to download the videos without watermark.

    python tiktok_dl.py --username [target username] --download --no-watermark
    

    You can take a shortcut and do it all in one command.

    python tiktok_dl.py --username [target username] --download --no-watermark
    








    Feel free to write any suggestions you think about.

    tiktok-bulk-downloader's People

    Contributors

    0aub 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

    Watchers

     avatar

    tiktok-bulk-downloader's Issues

    The download is stoping

    Appreciation

    First , i want to say great work you have done here , i understand little bit of python and i can tell how much effort you put in it , so thank you i really appreciate what you did , because i spent a lot of time searching about new scripts that works nicely , and i was so happy when is found this , and "2 days ago" sign made my day .

    Problem

    note : I'm using no watermark option .
    so the script works fine but it stopped at certain amount of videos like 33 videos or less and i get this error message ;

    File "/home/user/Documents/tiktok-bulk-downloader/tiktok_dl.py", line 387, in <module>
        main(args)
      File "/home/user/Documents/tiktok-bulk-downloader/tiktok_dl.py", line 381, in main
        download_posts(json_data["posts"], args.no_watermark)
      File "/home/user/Documents/tiktok-bulk-downloader/tiktok_dl.py", line 355, in download_posts
        nw_url(driver, base_url, post["id"]) if no_watermark else post["video"],
      File "/home/user/Documents/tiktok-bulk-downloader/tiktok_dl.py", line 316, in nw_url
        downloads = WebDriverWait(driver, 10).until(
      File "/home/user/.local/lib/python3.9/site-packages/selenium/webdriver/support/wait.py", line 80, in until
        raise TimeoutException(message, screen, stacktrace)
    selenium.common.exceptions.TimeoutException: Message: 
    Screenshot: available via screen
    

    So i did little research and i found that maybe its the loading time of page which seems logic since it happens using regular browser , so i increased the waiting time 30 sec then 60 , then 100 WebDriverWait(driver, 100) and same error appears again but after downloading like 74 video out of 290 or 408 .

    • is my connection slow ? so that i get this problem ( the download is fine like : 1.2 / 1.5 MB/sec ) .
    • is it worked for you like 100% download out of like 290 videos ? if it so how much connection speed you test it out ?
    • is there a js anti bot script that blocking the process on the tiktok ?

    Proposal

    since it stopped at 74 videos can you make the script more dynamic like i can run it again and start from video number 76 , like which line of code the loop is for edit the i is ( which you don't use i think ) . i see that maybe a temporary solution , but it can be the same error since the phantomjs is gonna scroll the hole page again .
    So i hope the solution is simple , thank you .

    It doesn't seem to work anymore, at least not on my system

    I had used this once before and it worked flawlessly but then tried later on a few days later and it didn't work, instead giving me this. Ignore the user I tried it on, just did that for shits and giggles.

    [INFO]:  Generating json data...
    Traceback (most recent call last):
      File "C:\Users\Tori\Downloads\tiktok-bulk-downloader-main\tiktok_dl.py", line 176, in update_user
        PARAMS['secUid'] = response['userInfo']['user']['secUid']
    KeyError: 'userInfo'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Users\Tori\Downloads\tiktok-bulk-downloader-main\tiktok_dl.py", line 440, in <module>
        main(args)
      File "C:\Users\Tori\Downloads\tiktok-bulk-downloader-main\tiktok_dl.py", line 424, in main
        generate_data()
      File "C:\Users\Tori\Downloads\tiktok-bulk-downloader-main\tiktok_dl.py", line 223, in generate_data
        messy_posts = get_posts()
      File "C:\Users\Tori\Downloads\tiktok-bulk-downloader-main\tiktok_dl.py", line 191, in get_posts
        update_user()
      File "C:\Users\Tori\Downloads\tiktok-bulk-downloader-main\tiktok_dl.py", line 181, in update_user
        raise Exception(f'''
    Exception:
            We could not find data about 10downingstreet.
            Take a look to these tips and try again.
              - Do not add @ in the beginning of the username
              - This script does not accept private accounts yet
    

    ImportError:

    Traceback (most recent call last):
    File "tiktok_dl.py", line 39, in
    from subprocess import CREATE_NO_WINDOW
    ImportError: cannot import name 'CREATE_NO_WINDOW' from 'subprocess' (/Users/caoliang/opt/anaconda3/lib/python3.8/subprocess.py)

    secUid error returned. Can you add more documentation please on project setup!

    user@host: tiktok-bulk-downloader$ python tiktok_dl.py --username @darwin --generate
    [INFO]:  Generating json data...
    Traceback (most recent call last):
      File "tiktok_dl.py", line 376, in <module>
        main(args)
      File "tiktok_dl.py", line 358, in main
        generate_data()
      File "tiktok_dl.py", line 238, in generate_data
        posts = get_posts()
      File "tiktok_dl.py", line 204, in get_posts
        update_user()
      File "tiktok_dl.py", line 195, in update_user
        PARAMS["secUid"] = response["userInfo"]["user"]["secUid"]
    KeyError: 'secUid'

    its giving error

    hi, are you going to update it ? its giving error looks like API problems

    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.