Tiktok Downloader

抖音 tiktok 无水印下载脚本

  1. // ==UserScript==
  2. // @name Tiktok Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.1
  5. // @description 抖音 tiktok 无水印下载脚本
  6. // @author You
  7. // @match *://*.douyin.com/video/*
  8. // @match *://*.tiktok.com/*/video/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=douyin.com
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Your code here...
  18. function download(url) {
  19. // 发送API请求
  20. fetch(url)
  21. .then((response) => response.json())
  22. .then((data) => {
  23. let downloadUrl = data.aweme_list[0].video.play_addr.url_list[0];
  24. //打开新标签页下载
  25. window.open(downloadUrl);
  26. })
  27. .catch((error) => {
  28. alert(error);
  29. });
  30. }
  31.  
  32. function addDownloadButton(element, event) {
  33. // 获取 data-e2e 为 "browse-copy" 的元素
  34. var browseCopyElement = element;
  35. // 创建一个新的兄弟节点
  36. var newNode = browseCopyElement.cloneNode(true);
  37. newNode.textContent = "无水印下载";
  38. newNode.style.marginLeft = "10px";
  39. newNode.addEventListener("click", event);
  40.  
  41. // 将新节点插入到原节点后面
  42. browseCopyElement.parentNode.insertBefore(
  43. newNode,
  44. browseCopyElement.nextSibling
  45. );
  46. }
  47.  
  48. let videoUrl = window.location.href;
  49.  
  50. if (videoUrl.includes("tiktok")) {
  51. let downloadUrl = `https://api.douyin.wtf/tiktok_video_data/?tiktok_video_url=${videoUrl}`;
  52.  
  53. addDownloadButton(document.querySelector(".esk3vjb10"), () => {
  54. download(downloadUrl);
  55. });
  56. } else if (videoUrl.includes("douyin")) {
  57. let downloadUrl = `https://api.douyin.wtf/douyin_video_data/?douyin_video_url=${videoUrl}`;
  58. addDownloadButton(document.querySelector(".Z1DFGRDj"), () => {
  59. download(downloadUrl);
  60. });
  61. }
  62.  
  63. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址