Universal Script 📌
1.2k Views
14 Executions

EXAMPLE YOUTUBE FROM API

Universal Script 📌
linhmcfake
linhmcfake100K executions
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

free.

View Raw
--[[dont use play list link]]--
--[[THIS IS EXAMPLE API]]--
--[[man dont obfuscate your fucking script,idiot lol]]--
--[[it will take about 30 seconds to load]]
local YT_URL = "https://youtu.be/MrD05HVGVIQ?si=p7FdeuRiM0Hswrxn"

local HttpService = game:GetService("HttpService")

local request = syn and syn.request or http_request or request or (http and http.request)
if not request then
    error("No supported request function found! This script requires syn.request, http_request, or similar.")
end

local function sanitizeFilename(name)
    return name:gsub('[\\/:*?"<>|]', "_")
end

local function debugPrint(label, value)
    print("DEBUG [" .. label .. "]:", typeof(value) == "string" and value:sub(1, 200) or value)
end

local function isDirectVideoUrl(str)
    return typeof(str)=="string" and str:find("^https?://") and (str:find("%.mp4") or str:find("googlevideo%.com"))
end

local function getVideoTitle(youtubeURL)
    local cmd = youtubeURL .. " --get-title"
    local api = "https://ytdlp.online/stream?command=" .. HttpService:UrlEncode(cmd)
    local res = request({Url = api, Method = "GET"})
    debugPrint("TITLE_RESPONSE", res and res.Body or "nil")
    if res and res.Body then
        local title = res.Body:match("data:%s*(.-)\n")
        if title and #title > 0 then
            return sanitizeFilename(title) .. ".mp4"
        end
    end
    return "YouTubeVideo.mp4"
end

local function getDirectLink(youtubeURL)


Comments

2
Log in to join the conversation. Login
linhmcfake's profile picture
linhmcfakeUploader1 year ago

should i add a video player?

2
BadScriptsMaker's profile picture
BadScriptsMaker1 year ago

@linhmcfake ok

1

Tags

More universal scripts

See all
Universal Script 📌
13.8k
1.7k
Bumped 39 minutes ago
Universal Script 📌
15.8k
11.6k
Bumped 1 hour ago
Script hub
2.0k
786
Bumped 2 hours ago
Key System
Universal Script 📌
30.5k
788.8k
Bumped 2 hours ago
Script hub
135
2
Approved 3 hours ago
Key System
Universal Script 📌
124
2
Approved 3 hours ago