Fix dropbox

This commit is contained in:
Xerasin 2021-10-24 17:13:25 -07:00
parent 13b09b7335
commit 842ffd5e8d
2 changed files with 6 additions and 2 deletions

View File

@ -153,7 +153,11 @@ if CLIENT then
end
local patterns = {
["drive.google.com/file/d/([%d%w]+)/view"] = "https://drive.google.com/u/0/uc?id=%s&export=download",
["^https?://drive%.google%.com/file/d/([%d%w]+)/view"] = "https://drive.google.com/u/0/uc?id=%s&export=download",
["^https?://www%.dropbox%.com/s/(.+)%?dl%=[01]$"] = "https://dl.dropboxusercontent.com/s/%s",
["^https?://www%.dropbox%.com/s/(.+)$"] = "https://dl.dropboxusercontent.com/s/%s",
["^https?://dl%.dropbox%.com/s/(.+)%?dl%=[01]$"] = "https://dl.dropboxusercontent.com/s/%s",
["^https?://dl%.dropbox%.com/s/(.+)$"] = "https://dl.dropboxusercontent.com/s/%s"
}
function wowozela.ProcessURL(url)
for pattern, replace in pairs(patterns) do

View File

@ -1038,7 +1038,7 @@ if CLIENT then
LocalPlayer():ChatPrint(("Unable to load sound: %s"):format(reason))
end
Menu:AddOption("custom...", function()
Derma_StringRequest("Sound (Mp3/Ogg)", "Insert a web-hosted ogg or mp3.\n(GitHub, Vocaroo, Puush, Google Drive or similar sites)", "", function(text)
Derma_StringRequest("Sound (Mp3/Ogg)", "Insert a web-hosted ogg or mp3.\n(GitHub, Vocaroo, Dropbox, Puush, Google Drive or similar sites)", "", function(text)
if text:sub(1, 4) ~= "http" then return end
if text:sub(1, 19) == "https://github.com/" and text:sub(-9) ~= "?raw=true" then