diff --git a/spradio.liq b/spradio.liq index 0475514..69ffadb 100644 --- a/spradio.liq +++ b/spradio.liq @@ -63,7 +63,11 @@ def next_song() = log = log(label="next_song") log("Requesting the next song from #{url_next}") - let (status, _, data) = http.get(headers=api_headers_next, url_next) + if string.contains(prefix='https') then + let (status, _, data) = https.get(headers=api_headers_next, url_next) + else + let (status, _, data) = http.get(headers=api_headers_next, url_next) + end let (_, status_code, _) = status log(data) @@ -99,7 +103,11 @@ def just_played(m) = if m["req_id"] != "" then log('Letting server know we played request ID #{m["req_id"]} here: #{url_played}') played_song = json_of(compact=true, [("song_request", int_of_string(m["req_id"]))]) - let (status, _, data) = http.post(headers=api_headers_played, data=played_song, url_played) + if string.contains(prefix='https') then + let (status, _, data) = https.post(headers=api_headers_played, data=played_song, url_played) + else + let (status, _, data) = http.post(headers=api_headers_played, data=played_song, url_played) + end let (_, status_code, _) = status if status_code == 204 then