Greasy Fork is available in English.

jut_su_download_button

adding button on jut.su for downloading

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Autor
Иван Задорожный
Installationen heute
0
Installationen gesamt
7
Bewertungen
0 0 0
Version
2024-03-17
Erstellt am
17.05.2024
Letzte Aktualisierung
17.05.2024
Größe
4,72 KB
Lizenz
MIT
Wird angewandt auf

Script Description

Purpose

This script dynamically adds a download button for a 1080p video source on a webpage. The button allows users to download the video file directly when clicked. The script waits for the specified video source element to be available in the DOM before adding the button.

How It Works

  1. Wait for Video Source: The script uses waitForKeyElements to monitor the DOM for the presence of a video source element with the label "1080p".
  2. Extract Video Name: Once the element is found, the script extracts the video name from the base URI.
  3. Create Download Link: The script creates a download link and a container div to hold the link. The download link is styled and has an event listener to handle the download action via JavaScript.
  4. Append to DOM: The script appends the download link container to a target element on the page, specified by the class name videoContent.

Detailed Explanation

  1. waitForKeyElements:

    • Monitors the DOM for the specified selector.
    • Calls the addButton function when the element is found.
  2. addButton:

    • Extracts the video source URL and name.
    • Selects the container where the download button will be added.
    • Creates and appends the download link using createDownloadLink.
  3. extractVideoName:

    • Splits the base URI to derive the video name.
  4. createDownloadLink:

    • Creates a div and a element styled for the download link.
    • Adds a click event listener to handle the download action.
  5. handleDownloadClick:

    • Prevents the default action.
    • Creates a temporary a element to trigger the download.
    • Initiates the download and removes the temporary element.

Usage

  • This script is intended to be used on web pages with video content on jut.su.
  • It adds functionality for users to easily download a 1080p video file with a single click.