GithubHelp home page GithubHelp logo

bashonly / yt-dlp-ttuser Goto Github PK

View Code? Open in Web Editor NEW
69.0 6.0 6.0 52 KB

A yt-dlp extractor plugin for downloading all videos posted by a TikTok user

License: The Unlicense

Python 100.00%
yt-dlp yt-dlp-plugins

yt-dlp-ttuser's Introduction

A yt-dlp extractor plugin for downloading all videos posted by a TikTok user


NOTICE

This plugin has been made obsolete by yt-dlp version 2024.05.27, commit c53c2e4

The TikTok user extractor has now been fixed in yt-dlp. As such, this plugin will no longer be updated, and it has been disabled for yt-dlp versions where it is obsolete and/or incompatible

Update your yt-dlp to the latest version (yt-dlp -U) if you have not already.


  • Pass --extractor-args "tiktok:sec_uid=USERNAME1:SECUID1,USERNAME2:SECUID2" to specify a secondary user ID (SECUID) for a given username (USERNAME).
    • NOTE: This extractor-arg does not apply to the fixed/actual yt-dlp extractor; it instead accepts tiktokuser:-prefixed URLs, e.g. tiktokuser:SEC_UID

Installation

Requires yt-dlp version 2023.09.24 to 2024.05.26.232421.

You can download the wheel of the latest release and place the .whl file in one of yt-dlp's plugin paths.

Or you can install this package with pip:

python3 -m pip install -U https://github.com/bashonly/yt-dlp-TTUser/archive/master.zip

See the plugins section of the yt-dlp README for more information.

yt-dlp-ttuser's People

Contributors

bashonly 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  avatar  avatar  avatar

yt-dlp-ttuser's Issues

random 404 error on userchannel.

Request for a comment. Sometimes randomly I get this on a users channel and it last for like several days. I tested it on other pc and I don't get the error so it is mostlikely a ip block. Whats the best way around this error. I have 5-10 delay for each video and 130s between each username. Will increasing these number prevent the random channel blocks? or is there no way around this? Just posting here becuase Idk were else to ask. What are your guys way around this? adding vpn timer? running 2pc's/virtual machines?

Error downloading channel

Can't download any users channel anymore getting
ERROR unable to extract sigi state;
You can download single video links but I tried downloading a user channel feed and it wont work atm, tested it on 2 differnet pc.

web_fallback issue

I tried using --extractor-args "tiktok:web_fallback" but got this error after 14 found videos:

WARNING: [tiktok:user+TTUser] Unable to find video in feed. Failed to extract from feed; falling back to web API response
ERROR: TikTokBaseIE._parse_aweme_video_web() missing 1 required positional argument: 'video_id'

How do I uninstall this?

I installed using python3 -m pip install -U https://github.com/bashonly/yt-dlp-TTUser/archive/master.zip

It's not working for me. How do I uninstall this?

Thank you.

Post count 35

I think the post count per page is 35, maybe update that if possible
postcount35

How to improve performance?

This is just a request for comment. Do you have any suggestions to improve the speed when using this plugin?

Fetching user video list takes a long time (the "Downloading video feed" part for each video details after getting the paged video list) compared to upstream TikTokUserIE logic (when it was working, up to circa end of October 2023).

Before, it took less than 2mins to finish and now it takes more than 2hours (~50 users, with total of ~5000 videos).

I am using an archive list so yt-dlp is not downloading most of the videos, only new ones, so almost 99% of the time taken is in scraping the video list.

Profile has 300+ videos but only retrieves 20+ videos

There is 300++ videos in this account but when i run yt-dlp with the TT user plug in, it only retrieves 20++ videos. Any idea why? So far I have only encountered this issue with this account.

https://www.tiktok.com/@22andconfusedd

Thank you.

Update Support for Tiktok downloading user channel please

Same Problem as yt-dlp its failing to download videos. I think Error trying to parse the JSON data from the TikTok user video list page. It was working 2 days ago just fine on yt-dlp but it seems tiktok have updated there website recently and this plugin doesnt help solve it.

Complete Verbose Output
PS D:\yt-dlp-TTUser> .\yt-dlp --extractor-args "tiktok:sec_uid=7275274545622336513" -vU https://www.tiktok.com/@cblackyyy
[debug] Command-line config: ['--extractor-args', 'tiktok:sec_uid=7275274545622336513', '-vU', 'https://www.tiktok.com/@cblackyyy']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] [b634ba742] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22000-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: ffmpeg 6.0-full_build-www.gyan.dev (setts), ffprobe 6.0-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, sqlite3-3.35.5, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1890 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: [email protected], Current version: [email protected]
Current Build Hash: 13d6a04ef6678dc61cb6e2d42eb53e69486bd2f52b8e5d778db029ccd4c600b4
yt-dlp is up to date ([email protected])
WARNING: The program functionality for this site has been marked as broken, and will probably not work.
[tiktok:user] Extracting URL: https://www.tiktok.com/@cblackyyy
[tiktok:user] cblackyyy: Downloading webpage
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying (1/3)...
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying (2/3)...
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying (3/3)...
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[tiktok:user] cblackyyy: Downloading user video list page 1
ERROR: [tiktok:user] cblackyyy: cblackyyy: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
File "yt_dlp\extractor\common.py", line 715, in extract
File "yt_dlp\extractor\tiktok.py", line 806, in _real_extract
File "yt_dlp\utils\traversal.py", line 239, in traverse_obj
File "yt_dlp\utils\traversal.py", line 227, in _traverse_obj
File "yt_dlp\utils\traversal.py", line 215, in apply_path
File "yt_dlp\utils\traversal.py", line 173, in apply_key
File "yt_dlp\utils_utils.py", line 2195, in getitem
File "yt_dlp\extractor\tiktok.py", line 774, in _video_entries_api
File "yt_dlp\utils_utils.py", line 5114, in iter
File "yt_dlp\extractor\common.py", line 3760, in _error_or_warning
File "yt_dlp\utils_utils.py", line 5122, in report_retry
File "yt_dlp\extractor\tiktok.py", line 776, in _video_entries_api
File "yt_dlp\extractor\tiktok.py", line 132, in _call_api
File "yt_dlp\extractor\tiktok.py", line 125, in _call_api
File "yt_dlp\extractor\tiktok.py", line 62, in _call_api_impl
File "yt_dlp\extractor\common.py", line 1069, in download_content
File "yt_dlp\extractor\common.py", line 1039, in download_handle
File "yt_dlp\extractor\common.py", line 1029, in parse
File "yt_dlp\extractor\common.py", line 1016, in _parse_json
File "yt_dlp\extractor\common.py", line 999, in __print_error

File "yt_dlp\utils_utils.py", line 555, in decode
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "yt_dlp\extractor\common.py", line 1013, in parse_json
File "json_init
.py", line 370, in loads
File "yt_dlp\utils_utils.py", line 563, in decode
json.decoder.JSONDecodeError: Expecting value in '': line 1 column 1 (char 0)

tt_user is working?

yt-dlp --use-extractors "/home/elias/yt_dlp/extractor/tt_user.py" --cookies-from-browser firefox https://www.tiktok.com/@valentinaof.4
in linux, it says no suitable extractor found.

when i use
yt-dlp --use-extractors tiktok:user --cookies-from-browser firefox https://www.tiktok.com/@valentinaof.4
the empty json error appears.

trying to install wheel again:
yt-dlp-ttuser is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.

so how i can use it to download the vids of a tiktok profile?

yt-dlp --list-extractors | grep tik
DetikEmbed
tiktok:effect (CURRENTLY BROKEN)
tiktok:live
tiktok:sound (CURRENTLY BROKEN)
tiktok:tag (CURRENTLY BROKEN)
tiktok:user (CURRENTLY BROKEN)
vm.tiktok

Alternate web API to get user posts

There's a new endpoint I started seeing today through the web app. It's accessible in a tab labeled as 'Creator videos' next to the comments tab when viewing a video accessed through the user page.

It currently doesn't require any signatures or valid tokens (like the verifyFp) to return data

Minimum Params

Latest: https://www.tiktok.com/api/creator/item_list/?aid=1988&type=1&count=15&cursor=1689909282235&secUid=MS4wLjABAAAAys5jIEEWJXF-bCt_11wTP363Xvnma4SAex4cTxY-EDrUe2CPXUr1rh-tZtqa5Src&verifyFp=verify_

Next Page: https://www.tiktok.com/api/creator/item_list/?aid=1988&type=1&count=15&cursor=1677186594000&secUid=MS4wLjABAAAAys5jIEEWJXF-bCt_11wTP363Xvnma4SAex4cTxY-EDrUe2CPXUr1rh-tZtqa5Src&verifyFp=verify_

  • secUid
  • aid
    • 1988
  • type
    • 1 returns sorted item lists on all requests
    • 0 returns item lists with dupes unless its the most recent 15 posts
  • count
    • Max 15
  • cursor
    • Setting to current time in milis will return the most recent posts
    • The 'next' cursor used on frontend is the timestamp of the last post in the item list
    • Setting to 0 will return the oldest posts
  • verifyFp
    • Any string is valid as long as it starts with verify_

Res

  • No next/previous cursor values
  • hasMoreLatest & hasMorePrevious = true/false

Normal params

https://www.tiktok.com/api/creator/item_list/?aid=1988&app_language=en&app_name=tiktok_web&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=<>&channel=tiktok_web&cookie_enabled=true&count=15&cursor=<>&device_id=<>&device_platform=web_pc&focus_state=true&from_page=video&history_len=4&is_fullscreen=false&is_page_visible=true&language=en&os=windows&priority_region=US&referer=&region=US&screen_height=1080&screen_width=1920&secUid=<>&type=0&tz_name=<>&verifyFp=<>&webcast_language=en

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.