[Manual Mirror] Update the Play Internet Sound Verb (#18832)

This commit is contained in:
SomeRandomOwl
2023-01-20 14:08:49 -05:00
committed by GitHub
parent d96ebce149
commit 42a31402ae
2 changed files with 62 additions and 24 deletions
+24 -4
View File
@@ -94,7 +94,7 @@
to_chat(src, span_warning("For youtube-dl shortcuts like ytsearch: please use the appropriate full url from the website."), confidential = TRUE)
return
var/shell_scrubbed_input = shell_url_scrub(web_sound_input)
var/list/output = world.shelleo("[ytdl] --geo-bypass --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --dump-single-json --no-playlist -- \"[shell_scrubbed_input]\"")
var/list/output = world.shelleo("[ytdl] --geo-bypass --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height <= 360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --dump-single-json --no-playlist -- \"[shell_scrubbed_input]\"")
var/errorlevel = output[SHELLEO_ERRORLEVEL]
var/stdout = output[SHELLEO_STDOUT]
var/stderr = output[SHELLEO_STDERR]
@@ -113,15 +113,35 @@
var/webpage_url = title
if (data["webpage_url"])
webpage_url = "<a href=\"[data["webpage_url"]]\">[title]</a>"
music_extra_data["start"] = data["start_time"]
music_extra_data["end"] = data["end_time"]
music_extra_data["duration"] = DisplayTimeText(data["duration"] * 1 SECONDS)
music_extra_data["link"] = data["webpage_url"]
music_extra_data["artist"] = data["artist"]
music_extra_data["upload_date"] = data["upload_date"]
music_extra_data["album"] = data["album"]
var/res = tgui_alert(usr, "Show the title of and link to this song to the players?\n[title]",, list("No", "Yes", "Cancel"))
switch(res)
if("Yes")
to_chat(world, "<span class='boldannounce'>[src] played: [webpage_url]</span>", confidential = TRUE) //SKYRAT EDIT CHANGE - ORIGINAL: to_chat(world, "<span class='boldannounce'>An admin played: [webpage_url]</span>", confidential = TRUE)
music_extra_data["title"] = data["title"]
if("No")
music_extra_data["link"] = "Song Link Hidden"
music_extra_data["title"] = "Song Title Hidden"
music_extra_data["artist"] = "Song Artist Hidden"
music_extra_data["upload_date"] = "Song Upload Date Hidden"
music_extra_data["album"] = "Song Album Hidden"
if("Cancel")
return
var/anon = tgui_alert(usr, "Display who played the song?", "Credit Yourself?", list("No", "Yes", "Cancel"))
switch(anon)
if("Yes")
if(res == "Yes")
to_chat(world, span_boldannounce("[src] played: [webpage_url]"), confidential = TRUE)
else
to_chat(world, span_boldannounce("[src] played some music"), confidential = TRUE)
if("No")
if(res == "Yes")
to_chat(world, span_boldannounce("An admin played: [webpage_url]"), confidential = TRUE)
if("Cancel")
return