Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tiktok] Get original/source HD quality formats #4138

Open
6 tasks done
kraddock opened this issue Jun 22, 2022 · 21 comments
Open
6 tasks done

[tiktok] Get original/source HD quality formats #4138

kraddock opened this issue Jun 22, 2022 · 21 comments
Labels
site-enhancement Feature request for some website

Comments

@kraddock
Copy link

Checklist

  • I'm requesting a site-specific feature
  • I've verified that I'm running yt-dlp version 2022.06.22.1 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue
  • I've read about sharing account credentials and I'm willing to share it if required

Region

Europe

Example URLs

https://www.tiktok.com/@laurenolphert2/video/7082427877588798725

Description

On sites such as musicaldown.com (among many similar ones), you have the option to download HD version of any TikTok video, that usually has 6x times the bitrate than the best version downloaded by yt-dlp. You can check the example URL - the best yt-dlp can do is ~2mb without watermark and the HD version from musicaldown is nearly 10 times that at 20mb. also, ~500kb overall bitrate vs ~5700kb for the HD version.

Is there a way to include this "HD" version in the format selection of yt-dlp when downloading single TikTok videos?

Here is the current format list with the example video:

[TikTok] 7082427877588798725: Downloading video details
[info] Available formats for 7082427877588798725:
ID                    EXT RESOLUTION │   FILESIZE  TBR PROTO │ VCODEC  VBR ACODEC ABR MORE INFO
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
download_addr-0       mp4 576x1024   │    3.01MiB      https │ h264        aac        Download video, watermarked (API)
download_addr-1       mp4 576x1024   │    3.01MiB      https │ h264        aac        Download video, watermarked
download_addr-2       mp4 576x1024   │    3.01MiB      https │ h264        aac        Download video, watermarked
h264_540p_846092-0    mp4 576x1024   │    2.97MiB 846k https │ h264   846k aac     0k Direct video (API)
h264_540p_846092-1    mp4 576x1024   │    2.97MiB 846k https │ h264   846k aac     0k Direct video
h264_540p_846092-2    mp4 576x1024   │    2.97MiB 846k https │ h264   846k aac     0k Direct video
bytevc1_540p_156273-0 mp4 576x1024   │  562.08KiB 156k https │ h265   156k aac     0k Playback video (API)
bytevc1_540p_156273-1 mp4 576x1024   │  562.08KiB 156k https │ h265   156k aac     0k Playback video
bytevc1_540p_156273-2 mp4 576x1024   │  562.08KiB 156k https │ h265   156k aac     0k Playback video
bytevc1_540p_199483-0 mp4 576x1024   │  717.50KiB 199k https │ h265   199k aac     0k Playback video (API)
bytevc1_540p_199483-1 mp4 576x1024   │  717.50KiB 199k https │ h265   199k aac     0k Playback video
bytevc1_540p_199483-2 mp4 576x1024   │  717.50KiB 199k https │ h265   199k aac     0k Playback video
bytevc1_540p_410975-0 mp4 576x1024   │    1.44MiB 410k https │ h265   410k aac     0k Direct video (API)
bytevc1_540p_410975-1 mp4 576x1024   │    1.44MiB 410k https │ h265   410k aac     0k Direct video
bytevc1_540p_410975-2 mp4 576x1024   │    1.44MiB 410k https │ h265   410k aac     0k Direct video
bytevc1_720p_506490-0 mp4 unknown    │    1.78MiB 506k https │ h265   506k aac     0k Playback video (API)
bytevc1_720p_506490-1 mp4 unknown    │    1.78MiB 506k https │ h265   506k aac     0k Playback video
bytevc1_720p_506490-2 mp4 unknown    │    1.78MiB 506k https │ h265   506k aac     0k Playback video

Verbose log

[debug] Command-line config: ['-vU', 'https://www.tiktok.com/@laurenolphert2/video/7082427877588798725']
[debug] Encodings: locale cp1251, fs utf-8, pref cp1251, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.22.1 [a86e01e] (win32_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.4-essentials_build-www.gyan.dev (setts), ffprobe 4.4-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.06.22.1, Current version: 2022.06.22.1
yt-dlp is up to date (2022.06.22.1)
[TikTok] Setting up session
WARNING: [TikTok] Unable to download webpage: The read operation timed out
[debug] [TikTok] Extracting URL: https://www.tiktok.com/@laurenolphert2/video/7082427877588798725
[TikTok] 7082427877588798725: Downloading video details
[debug] Sort order given by extractor: quality, codec, size, br
[debug] Formats sorted by: hasvid, ie_pref, quality, vcodec, acodec, filesize, fs_approx, tbr, vbr, abr, lang, res, fps, hdr:12(7), asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7082427877588798725: Downloading 1 format(s): bytevc1_720p_506490-2
[debug] Invoking http downloader on "https://v19.tiktokcdn.com/43718105d7f8d508cd3d63d52ded9d88/62b3a1b1/video/tos/useast2a/tos-useast2a-ve-0068c003/8f19c3e47d9a4ebf989de5a78acaae26/?a=1180&ch=0&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C3&cv=1&br=988&bt=494&btag=80000&cs=2&ds=3&ft=AHKuOBivqagmo0P3-IPfkVQDAOtS2KJ&mime_type=video_mp4&qs=14&rc=NDY8NDw3ZWlmNDU0N2Q3aEBpanZtcDg6Zml2PDMzNzczM0BeYi0wMmM0XzMxMjQzYWNgYSNfLmRpcjRvZjFgLS1kMTZzcw%3D%3D&l=20220622171116010245245002073D774B&cc=4"
[download] #fyp #ikea #ikeamirrorhack #ikeamirror #diy [7082427877588798725].mp4 has already been downloaded
[download] 100% of 1.78MiB
@kraddock kraddock added site-enhancement Feature request for some website triage Untriaged issue labels Jun 22, 2022
@MinePlayersPE
Copy link
Contributor

important query param for /play api is ratio=default

@johnnsss
Copy link

@MinePlayersPE Can you provide an example please? I've been trying using this parameter ratio=default with no success. Thank you

@github-userx
Copy link

Any update on this? I’m also currently using musicaldown website to get the highest quality HD version.

@MinePlayersPE
Copy link
Contributor

MinePlayersPE commented Aug 17, 2022

Note: the method was patched and all the sites I've found are either broken or now serving the best h264 format from the mobile API (which yt-dlp can extract already)
EDIT: in case anyone needs a tl;dr rundown, aweme/v1/play now requires the file_id param, which directly corresponds to the (transcoded) video file and not just the video format

MXEBot pushed a commit to mirror/jdownloader that referenced this issue Aug 17, 2022
- batoto: fixed js stuff fixes #90195
- [Unknown_FilehostScript] bayfilescom: added plugin settings same like anonfilescom to allow users to fallback to stream download in case of problems with normal download RE forum 91441
- tiktokcom: added comment about non working HD download RE forum 91160 see also github.com/yt-dlp/yt-dlp/issues/4138#issuecomment-1217380819

*Plugins: RIP*
- [FlexShare] filepup.net RE forum 88808
- intel.iobb.net RE forum 91351 refs #89976

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@46552 ebf7c1c2-ba36-0410-9fe8-c592906822b4
@github-userx
Copy link

github-userx commented Aug 19, 2022 via email

@vfsfitvnm
Copy link

vfsfitvnm commented Aug 19, 2022

I personally noticed the difference - i.e. I could tell which video had the higher resolution and bitrate - but I'm sure it isn't that noticeable in some videos

@kraddock
Copy link
Author

Yes, for sure - for some videos the difference is not really obvious, but I remember one pretty special case - a music video by a singer named Tate McRae that was released on TikTok as an official video (US geoblock). Now, the standard, non-watermarked version is ~20mb, but the HD version (original file) was a whopping 900MB!

File size                   : 901 MiB
Duration                    : 2 min 30 s
Overall bit rate mode       : Variable
Overall bit rate            : 50.3 Mb/s

So yeah, in cases like these the "HD" download was really useful...

@kraddock kraddock reopened this Aug 21, 2022
@yiisangel
Copy link

yiisangel commented Aug 22, 2022

Yes, for sure - for some videos the difference is not really obvious, but I remember one pretty special case - a music video by a singer named Tate McRae that was released on TikTok as an official video (US geoblock). Now, the standard, non-watermarked version is ~20mb, but the HD version (original file) was a whopping 900MB!

File size                   : 901 MiB
Duration                    : 2 min 30 s
Overall bit rate mode       : Variable
Overall bit rate            : 50.3 Mb/s

So yeah, in cases like these the "HD" download was really useful...

I found a new way to download the video in original quality, but it is impossible to publish it because publishing it may soon be fixed by TT.

I have put it in my API, you can try it

Redirect to play url from id: https://www.tikwm.com/video/media/hdplay/7107337212743830830.mp4

@mikebilly

This comment was marked as off-topic.

@yiisangel

This comment was marked as off-topic.

@mikebilly

This comment was marked as off-topic.

@yiisangel

This comment was marked as off-topic.

@yiisangel

This comment was marked as off-topic.

@mikebilly

This comment was marked as off-topic.

@mikebilly

This comment was marked as off-topic.

@yiisangel

This comment was marked as off-topic.

@github-userx

This comment was marked as off-topic.

@pukkandan
Copy link
Member

Take discussion of third party solutions elsewhere

@mikebilly
Copy link

@yi005 do you have discord or anything that i can contact you via?

@bashonly
Copy link
Member

bashonly commented Jun 4, 2023

This was partially addressed by c2a1bdb, which extracts transcoded 1080p formats for some videos, but not the "original"/"source" HD formats that are available for most videos. Keeping this issue open, since better quality is possible, we just don't know how to get it yet.

@bashonly bashonly changed the title [tiktok] Add "HD" video format option [tiktok] Get original/source HD quality formats Jun 4, 2023
@wranai
Copy link

wranai commented Dec 2, 2023

these may help until it's fixed: -f 'best[format_note!*=watermarked]' --format-sort filesize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-enhancement Feature request for some website
Projects
Status: tiktok
Development

No branches or pull requests

10 participants