Initial commit: monorepo Match Live TV.

Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-26 17:45:37 +02:00
commit bba6df52c0
381 changed files with 20599 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
module Youtube
class OauthExchange
TOKEN_URL = "https://oauth2.googleapis.com/token".freeze
def self.call(code)
response = Faraday.post(TOKEN_URL, {
code: code,
client_id: ENV["YOUTUBE_CLIENT_ID"],
client_secret: ENV["YOUTUBE_CLIENT_SECRET"],
redirect_uri: ENV["YOUTUBE_REDIRECT_URI"],
grant_type: "authorization_code"
})
data = JSON.parse(response.body)
raise BroadcastService::Error, data["error_description"] if data["error"]
{
access_token: data["access_token"],
refresh_token: data["refresh_token"],
expires_in: data["expires_in"].to_i,
channel_id: nil,
channel_title: nil
}
end
end
end