DL Videos

Ajoute des boutons pour télécharger des vidéos via Y2Mate, SaveTheVideo et SSSTwitter

目前為 2025-01-31 提交的版本,檢視 最新版本

// ==UserScript==
// @name         DL Videos
// @namespace    https://gf.qytechs.cn/
// @version      1.0
// @description  Ajoute des boutons pour télécharger des vidéos via Y2Mate, SaveTheVideo et SSSTwitter
// @author       Lakfu Sama
// @match        *://*/*
// @grant        none
// ==/UserScript==

function openDownloadService(video, serviceUrl) {
  let videoUrl = video.querySelector('source')?.src || video.src;
  
  if (!videoUrl) {
    alert('Impossible de détecter la vidéo');
    return;
  }

  // Gérer SSSTwitter
  if (serviceUrl.includes('ssstwitter')) {
    const tweetUrl = window.location.href;  // Récupérer l'URL du tweet
    window.open(`${serviceUrl}?url=${encodeURIComponent(tweetUrl)}`, '_blank');
    return;
  }

  // Gérer Y2Mate pour YouTube
  if (window.location.hostname.includes('youtube.com')) {
    const videoId = new URLSearchParams(window.location.search).get('v');
    if (videoId && serviceUrl.includes('y2mate')) {
      window.open(`${serviceUrl}${videoId}`, '_blank');
      return;
    }
  }

  // Pour d'autres cas
  window.open(`${serviceUrl}${encodeURIComponent(videoUrl)}`, '_blank');
}

QingJ © 2025

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