Integrazione YouTube Live: OAuth squadra, canale piattaforma Light e UI.
Collegamento da Dettagli squadra e admin per il refresh token Match Live TV; API e app mobile allineate ai piani Light/Full. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
18
backend/app/services/youtube/channel_info.rb
Normal file
18
backend/app/services/youtube/channel_info.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
module Youtube
|
||||
class ChannelInfo
|
||||
def self.fetch(access_token:)
|
||||
service = Google::Apis::YoutubeV3::YouTubeService.new
|
||||
service.authorization = access_token
|
||||
resp = service.list_channels("snippet", mine: true, max_results: 1)
|
||||
item = resp.items&.first
|
||||
return { channel_id: nil, channel_title: nil } unless item
|
||||
|
||||
{
|
||||
channel_id: item.id,
|
||||
channel_title: item.snippet&.title
|
||||
}
|
||||
rescue Google::Apis::Error
|
||||
{ channel_id: nil, channel_title: nil }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user