Greasy Fork镜像 支持简体中文。

抖音网页版添加下载按钮

给抖音网页版添加一个下载按钮,下载短视频

目前為 2022-08-27 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 抖音网页版添加下载按钮
  3. // @namespace Slothful
  4. // @version 0.1
  5. // @description 给抖音网页版添加一个下载按钮,下载短视频
  6. // @author @公众号Slothful
  7. // @license GPL-3.0 License
  8. // @require https://unpkg.com/jquery@3.6.0/dist/jquery.min.js
  9. // @match https://www.douyin.com/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=douyin.com
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. const douyinDownBtn = () => {
  18. const shareBtns = document.querySelectorAll('div[data-e2e=video-player-share');
  19. shareBtns.forEach(current => {
  20. if(!current.dataset.jump){
  21. const parent = current.parentElement.parentElement;
  22. const area = parent.parentElement;
  23. const player = $(area).parents('.xgplayer')[0];
  24. if(player) {
  25. current.dataset.jump = 1;
  26. const source = player.querySelector('video source');
  27. const el = parent.cloneNode(true);
  28. el.dataset.jump = 1;
  29. el.style.transform = 'rotate(90deg)';
  30. el.onclick = () => { open(source.src); };
  31. area.appendChild(el);
  32. }
  33. }
  34. })
  35. }
  36. setInterval(() => {douyinDownBtn()}, 2000)
  37. })();

QingJ © 2025

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