From fba2018224d64904e45d54e94bf09601ad287cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shadowsun=E2=84=A2?= <12494967+CattoGamer@users.noreply.github.com> Date: Thu, 4 Jul 2024 03:41:32 +0200 Subject: [PATCH] Remove SoundCloud support No promise can be given that it will work in the future --- public/search/images/logos/soundcloud.png | Bin 1182 -> 0 bytes public/search/index.html | 3 - public/search/styles/request.css | 3 - public/soundcloud.html | 87 ------------------ .../theater/services/sh_soundcloud.lua | 78 ---------------- 5 files changed, 171 deletions(-) delete mode 100644 public/search/images/logos/soundcloud.png delete mode 100644 public/soundcloud.html delete mode 100644 workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_soundcloud.lua diff --git a/public/search/images/logos/soundcloud.png b/public/search/images/logos/soundcloud.png deleted file mode 100644 index fd82f4a3aab3ad56349382310d18e778769fda0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1182 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`ol6-Q7(WI0gt)pF_&lpqLZDhCHb`9Y z8Cc{gLX9F&@soN4iO`EsgK7xGgj$dmoCsnskc6N*rKcbf6x)&9fMO0pyjC7+evJZ7 zi=ZZ>n1G_V2F;y7H=v1N=!G~Qo9~{&ya2WWY!1jYMUa~z9t7(GdA1%RqJ;1cNDWve z(9K}=U=nT!)ENl%Kttdzfw;LAZW>4zMCD%HFCT!3U};H^UoZpznuaU@ru(Hg*+2h%3iJP6$Lq|hR_oVNDE#B$BEGro`m&ykn!1^KD|FrqGIHNL zvXr&kmnp`GN#dE(*U$%Er!u&wm5bI$JwExijAduI?O|r-z(Xa!W_0w5;Na9E;nP9xHu!rL<#mRYhjtwRs#GQGg&6@StlECSA*kdm(EirPPfo) z8n<;$904ZRZJsWUArXh)UQ6{q>>zRAW4mF*MZ;reF~&tB}d zaa3EET#%l#q*1`@%=tsjH7!0IH`D&4{p@;UmT{H&!4E}0aVN`nHB$qh-a7g9_t}3& zGOqijUN~xK&Yo|q^o7NHV(ZKZhKc*abS60K%B%6Hbo^>^VKQ)8rXvs(Qe?gSldG`b ziKUIwRhITo+5$9}fBvIp@`!Qk)IUBxyv?t4{$y|7xp38{cYf=y6`850T$>-a?4EKS zhh6^S5?o!7AqB= z7k1Z}gq>F2Iv2c!LweG(?EdK@@?L${_o?XriGH1Aqr6l8-QjPgX%3(N?YMpa$>Exb zVrC!XPDo9?wShare media from one of the selected services   - SoundCloud -   diff --git a/public/search/styles/request.css b/public/search/styles/request.css index ce13b99..51e17a4 100644 --- a/public/search/styles/request.css +++ b/public/search/styles/request.css @@ -72,9 +72,6 @@ h1 { .logo-twitch { background-image: url(../images/logos/twitch.png); } -.logo-soundcloud { - background-image: url(../images/logos/soundcloud.png); -} .logo-vimeo { background-image: url(../images/logos/vimeo.svg); background-size: 80px; diff --git a/public/soundcloud.html b/public/soundcloud.html deleted file mode 100644 index c55ef1d..0000000 --- a/public/soundcloud.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - SoundCloud Player - - - - - - - - - - - \ No newline at end of file diff --git a/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_soundcloud.lua b/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_soundcloud.lua deleted file mode 100644 index 594da1a..0000000 --- a/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_soundcloud.lua +++ /dev/null @@ -1,78 +0,0 @@ -local SERVICE = {} - -SERVICE.Name = "Soundcloud" -SERVICE.IsTimed = true - -SERVICE.Dependency = DEPENDENCY_PARTIAL - -local API_URL = "https://api-widget.soundcloud.com/resolve?url=%s&format=json&client_id=%s" -local SRV_API_KEY = "LBCcHmRB8XSStWL6wKH2HPACspQlXg2P" - -local Ignored = { - ["sets"] = true, -} - -local accessLevel = { - ["all"] = true, -- It can be embedded anywhere. - ["me"] = false, -- It can be embedded only on a specific page. - ["none"] = false, -- It cannot be embedded anywhere. -} - -function SERVICE:Match( url ) - return url.host and url.host:match("soundcloud.com") -end - -if (CLIENT) then - - function SERVICE:LoadProvider( Video, panel ) - - local path = string.Explode(",", Video:Data()) - local url = GetGlobal2String( "cinema_url", "" ) .. "soundcloud.html?url=https://soundcloud.com/%s/%s" - - panel:OpenURL(url:format( path[1], path[2] )) - panel.OnDocumentReady = function(pnl) - self:LoadExFunctions( pnl ) - end - end -end - -function SERVICE:GetURLInfo( url ) - - if url.path then - local user, title = url.path:match("^/([%w%-_]+)/([%w%-_]+)") - if (user and title and not Ignored[title]) then return { Data = user .. "," .. title } end - end - - return false - -end - -function SERVICE:GetVideoInfo( data, onSuccess, onFailure ) - - local path = string.Explode(",", data) - local escapedUrl = url.escape( ("https://soundcloud.com/%s/%s"):format(path[1], path[2]) ) - - local onReceive = function( body, length, headers, code ) - - local response = util.JSONToTable( body ) - if not response then return onFailure("The API servers did not return the requested data.") end - - if (response.embeddable_by and not accessLevel[response.embeddable_by]) then - return onFailure("The requested song is not playable, as there is a restriction set by SoundCloud") - end - - local info = {} - info.title = response.title - info.thumbnail = ( response.artwork_url and response.artwork_url:Replace("-large.jpg", "-original.jpg") ) or "" - info.duration = math.ceil(response.duration / 1000) - - if onSuccess then - pcall(onSuccess, info) - end - - end - self:Fetch( API_URL:format(escapedUrl, SRV_API_KEY), onReceive, onFailure ) - -end - -theater.RegisterService( "soundcloud", SERVICE ) \ No newline at end of file