Commit Graph

32 Commits

Author SHA1 Message Date
CasualYouTuber31
be9b4cf24f [tiktok] prefer "legacy" endpoint over the "newer" endpoint for user extraction (#8812 #8847) 2026-01-23 19:23:22 +01:00
CasualYouTuber31
a3d7af66a1 [tiktok] fix following extractor (#8849) 2026-01-23 19:19:27 +01:00
CasualYouTuber31
88a3153df8 [tiktok] download best quality videos (#8846)
* [tiktok] download best quality videos
* [tiktok] code formatting fix
* simplify sorting in '_extract_video_urls'
2026-01-23 19:09:53 +01:00
Mike Fährmann
c23beee57c [util] use functions for predicates
more lightweight and faster than classes
2026-01-18 20:32:36 +01:00
Mike Fährmann
71e7403dfc [tiktok] provide 'post_type' metadata (#8815) 2026-01-14 17:50:43 +01:00
Mike Fährmann
44c2408904 [tiktok] update user ID extraction 2026-01-01 22:28:21 +01:00
Mike Fährmann
2a342e4b1a [tiktok] combine '…_id' fields into a single 'file_id' one (#8804)
add a proper 'file_id' value for 'video' files
2026-01-01 21:49:09 +01:00
CasualYouTuber31
a6c845bdc8 [tiktok] remove yt-dlp dependency & add support for more post types (#8715)
#7246 #8035 #8466 #8730

* [tiktok] support extracting videos directly without yt-dlp
* [tiktok] support extracting users directly without yt-dlp
* [tiktok] fixing logic, tests, linting errors
* [tiktok] implement tiktok-range support for non-yt-dlp user extractor
* [tiktok] Skip range filter if no ranges are given
* [tiktok] Remove debug code
* [tiktok] only check for faulty device IDs during the first couple of passes
    I think the original yt-dlp solution assumes that if a device ID works once, it will always work.
    Plus, my approach would cause needless retries in certain cases if hasMorePrevious does end up being wrong like the original algorithm accounts for. So let's copy the original algorithm here, too.
* [tiktok] support stories
* [tiktok] you can now extract audio without extracting photos
* [tiktok] add TiktokFollowingExtractor
* [tiktok] update supportedsites to include stories
* [tiktok] Keep tiktok-range option for no content user account test
    It acts as a nice guard against that account suddenly having lots of posts to extract
* [tiktok] TiktokUserExtractor and TiktokFollowingExtractor rewrite
* [tiktok] Fix avatar naming convention to match that of posts
* [tiktok] remove type hints for compatibility with older Python versions
* [tiktok] Improve performance of TiktokFollowingExtractor
    This was largely achieved using the story/batch/item_list endpoint
* [tiktok] Forgot to run flake8
* [tiktok] remove old constant
* [tiktok] Support order-posts config item
* [tiktok] flake8
* [tiktok] Older Python versions don't support match
* [tiktok] always ask for posts in chronological order when in "desc" mode
    We should aim to avoid having pinned posts returned before non-pinned ones
* [tiktok] Add liked posts extraction
* [tiktok] Add reposts extraction
* [tiktok] Add saved posts extraction

* cleanup imports
* remove '# MARK:' comments
* remove & simplify 'except' statements
    KeyboardInterrupt & SystemExit inherit from BaseException (not Exception)
    and therefore don't need special handling
* split 'user' extractor
* move PATTERNs into their respective functions
* use dict comprehensions
* add only-matching test URLs for split user extractors
* update config docs
    rename 'tiktok-user-extractor' to 'ytdl'
* document '"popular"' 'order-posts' value
* inline and remove 'util.chunk()'
2025-12-30 17:17:57 +01:00
Mike Fährmann
e006d26c8e Revert "use f-strings when building 'pattern'"
revert d7c97d5a97.
2025-12-20 22:07:37 +01:00
Mike Fährmann
9a8746f12d [tiktok] add 'covers' option (#8515) 2025-12-07 20:30:47 +01:00
Mike Fährmann
968597a302 yield 3-tuples for Message.Directory
adapt tuples to the same length and semantics as other messages
2025-12-05 21:39:52 +01:00
Mike Fährmann
f06772e56e [tiktok] ignore empty 'music' entries (#8571) 2025-11-21 20:06:55 +01:00
Mike Fährmann
d7c97d5a97 use f-strings when building 'pattern' 2025-10-20 21:23:11 +02:00
Mike Fährmann
c8fc790028 merge branch 'dt': move datetime utils into separate module
- use 'datetime.fromisoformat()' when possible (#7671)
- return a datetime-compatible object for invalid datetimes
  (instead of a 'str' value)
2025-10-20 09:30:05 +02:00
Mike Fährmann
085616e0a8 [dt] replace 'text.parse_datetime()' & 'text.parse_timestamp()' 2025-10-17 17:43:06 +02:00
Mike Fährmann
8c62be343e [output] add 'Logger.traceback()' helper 2025-10-14 18:44:29 +02:00
Mike Fährmann
eaf0591eea [tiktok] fix "KeyError: 'author'" (#8189) 2025-09-10 09:20:03 +02:00
Mike Fährmann
9dbe33b6de replace old %-formatted and .format(…) strings with f-strings (#7671)
mostly using flynt
https://github.com/ikamensh/flynt
2025-06-29 17:50:19 +02:00
Mike Fährmann
9c9eb7a3bb [tiktok] detect login page redirects (#7716) 2025-06-22 13:14:59 +02:00
Mike Fährmann
d0b1da0fa7 [tiktok] handle exceptions when extracting avatars (#7682) 2025-06-17 12:21:20 +02:00
Mike Fährmann
88f1541a83 [common] add 'request_location()' convenience function 2025-04-19 16:45:05 +02:00
CasualYT31
685660bcb1 [tiktok] Don't skip last retry 2025-03-19 19:21:33 +00:00
CasualYT31
7b791405b6 [tiktok] Address review comments on _extract_rehydration_data() 2025-03-19 19:14:02 +00:00
CasualYT31
d6d2b1fba0 [tiktok] Queue links from user profiles instead of returning a list of links
[tiktok] Move avatar download to the user extractor, which results in more accurate metadata output (it would previously write the metadata of the video which the avatar was scraped from)
[tiktok] Fix tests and remove redundant user profile test
2025-03-19 18:50:06 +00:00
CasualYT31
c7685bdfc7 [tiktok] Incorporate --retries and --http-timeout into rehydration data extraction 2025-03-17 11:00:52 +00:00
CasualYT31
2001cf12e8 [tiktok] Add retry mechanism to rehydration data extraction
#7098
2025-03-16 15:00:08 +00:00
Mike Fährmann
3e64ec4f15 [tiktok] implement audio extraction without ytdl 2025-03-12 22:05:24 +01:00
Mike Fährmann
262e8628fa [tiktok] improve 'tiktok-range' parsing (#7098)
replace values evaluating as False (except 0) with ""
2025-03-02 14:50:49 +01:00
Mike Fährmann
1d3b9a9e40 [tiktok] fix variable name
fixes regression introduced in 5e87aee32d
2025-02-26 21:53:32 +01:00
Mike Fährmann
afde4ad343 [tiktok] add 'avatar' option 2025-02-26 21:09:57 +01:00
Mike Fährmann
5e87aee32d [tiktok] add 'audio' option (#7060) 2025-02-26 21:02:33 +01:00
CasualYouTuber31
daac2c6e04 [tiktok] add support (#3061 #4177 #5646 #6878 #6708)
* Add TikTok photo support

#3061
#4177

* Address linting errors

* Fix more test failures

* Forgot to update category names in tests

* Looking into re issue

* Follow default yt-dlp output template

* Fix format string error on 3.5

* Support downloading videos and audio

Respond to comments
Improve archiving and file naming

* Forgot to update supportedsites.md

* Support user profiles

* Fix indentation

* Prevent matching with more than one TikTok extractor

* Fix TikTok regex

* Support TikTok profile avatars

* Fix supportedsites.md

* TikTok: Ignore no formats error

In my limited experience, this doesn't mean that gallery-dl can't download the photo post (but this could mean that you can't download the audio)

* Fix error reporting message

* TikTok: Support more URL formats

vt.tiktok.com
www.tiktok.com/t/

* TikTok: Only download avatar when extracting user profile

* TikTok: Document profile avatar limitation

* TikTok: Add support for www.tiktokv.com/share links

* Address Share -> Sharepost issue

* TikTok: Export post's creation date in JSON (ISO 8601)

* [tiktok] update

* [tiktok] update 'vmpost' handling

just perform a HEAD request and handle its response

* [tiktok] build URLs from post IDs

instead of reusing unchanged input URLs

* [tiktok] combine 'post' and 'sharepost' extractors

* [tiktok] update default filenames

put 'id' and 'num' first to ensure better file order

* [tiktok] improve ytdl usage

- speed up extraction by passing '"extract_flat": True'
- pass more user options and cookies
- pre-define 'TikTokUser' extractor usage

* [tiktok] Add _COOKIES entry to AUTH_MAP

* [tiktok] Always download user avatars

* [tiktok] Add more documentation to supportedsites.md

* [tiktok] Address review comments

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
2025-02-25 20:10:48 +01:00