diff --git a/public/search/images/logos/soundcloud.png b/public/search/images/logos/soundcloud.png deleted file mode 100644 index fd82f4a..0000000 Binary files a/public/search/images/logos/soundcloud.png and /dev/null differ diff --git a/public/search/index.html b/public/search/index.html index 83b6c4f..cfe13dc 100644 --- a/public/search/index.html +++ b/public/search/index.html @@ -21,9 +21,6 @@

Share 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