OpenAI Sora Video Downloader

Adds a context menu item that opens the raw Sora video in a new tab to download or share.

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

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.

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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!)

// ==UserScript==
// @name     OpenAI Sora Video Downloader
// @description  Adds a context menu item that opens the raw Sora video in a new tab to download or share.
// @version  1.0.3
// @author       yodaluca23
// @license      GNU GPLv3
// @match        *://sora.com/*
// @match        *://sora.chatgpt.com/*
// @grant    GM_registerMenuCommand
// @grant    GM_openInTab
// @run-at   document-idle
// @namespace https://greasyfork.org/users/1315976
// ==/UserScript==

function extractAndOpenVideoURL() {
    const targetElement = document.querySelector('.absolute.cursor-default');
    if (targetElement) {
      const videoElement = targetElement.querySelector('video');
      if (videoElement && videoElement.src) {
          // Open the video URL in a new tab
          GM_openInTab(videoElement.src, {
              active: true,
              insert: true,
              pinned: false
          });
      }
    }
}

GM_registerMenuCommand("Download This Sora Video", extractAndOpenVideoURL, "e");