New mechanism for tiktok without watermark
See original GitHub issueI found a new mechanism for downloading tiktok videos without watermark. I wrote a proof of concept in nodejs but I’m not too experienced with python so if anyone can help implement it that’d be great.
const request = require('request-promise');
async function downloadVideo(uri){
// User-Agent is required to fetch the right page.
const options = {
url: uri,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0'
}
}
const videoPage = await request(options);
// Extract JSON data from script tag.
const regex = /<script id="__NEXT_DATA__" type="application\/json" crossorigin="anonymous">([^]*)<\/script><script crossorigin="anonymous" nomodule=/.exec(videoPage);
if(regex == null) return console.error('Unable to extract data from page.');
// Extract watermarked video URL after checking that the page is actually a video.
const videoProps = JSON.parse(regex[1]);
const videoData = videoProps.props.pageProps.videoData;
if(videoData == undefined) return console.error('Unable to extract video data from page data.');
const videoUrl = videoData.itemInfos.video.urls[0];
// This is the magic trick. The video ID is hidding inside the watermarked video file. We can extract it by searching for "vid:" inside the video.
const videoResult = await request(videoUrl);
const position = Buffer.from(videoResult).indexOf('vid:');
if(position == -1) return console.error('Could not find video ID in watermarked video.');
const videoId = Buffer.from(videoResult).slice(position + 4, position + 36).toString();
// You can retrieve the unwatermarked video with this URL and video ID.
console.log(`https://api2.musical.ly/aweme/v1/playwm/?video_id=${videoId}`);
}
downloadVideo('https://www.tiktok.com/@user/video/id');
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:18
Top Results From Across the Web
How to download a video without TikTok watermark?
In this new guide on the global social network called TikTok, we will learn how to download a video without TikTok watermark.
Read more >How to Download TikTok Videos (Without a Watermark)
The best bet is to download the video without any watermark in the first place, for free. For this to work, you need...
Read more >4 Ways to Download Your TikTok Videos Without The ...
MusicallyDown is another great free tool to download TikTok videos without the watermark. With this tool, you can download unlimited TikTok ...
Read more >How to Download TikTok Videos Without Watermark on iPhone
RepostTik is one of the best ways to remove TikTok video watermarks by downloading the original file. During the procedure, no watermark will...
Read more >We teach you 5 ways to remove the TikTok watermark - Gearrice
The first way to download TikTok videos without watermark with SnapTok is the traditional way, that is, go to the TikTo video and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There has been a recent change. The API URL changed and you need a user-agent to fetch the watermarkless video. I wrote a userscript to download TikTok vids without watermark.
The gist is that you fetch the watermarked video, search the file for ‘vid:’ and copy Here’s a breakdown of how it works:
this method don’t work on some videoes (secret ID can’t be found) please fix