Skip to content

Commit 661d4e4

Browse files
committed
💡 (getEpisodeList.ps1): comment out YouTube API key and video ID retrieval function
The YouTube API key and the function to retrieve YouTube video IDs are commented out to temporarily disable YouTube-related functionality. This change is likely due to issues with the YouTube API or a decision to pause the integration for now. It prevents unnecessary API calls and potential errors while maintaining the code for future use.
1 parent df25911 commit 661d4e4

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

‎.powershell/getEpisodeList.ps1‎

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $spotifyClientId = "1120c6949df54792975a405bbdcaa3bf"
33
$spotifyClientSecret = $Env:SPOTIFY_CLIENT_SECRET
44

55
# Define your YouTube Data API Key
6-
$youtubeApiKey = $Env:YOUTUBE_API_KEY
6+
#$youtubeApiKey = $Env:YOUTUBE_API_KEY
77

88
# Define the YouTube channel ID to restrict searches
99
$youtubeChannelId = "UCQxOqOLPrgtWJAKJzOgR5uw" # Replace with your desired channel's ID
@@ -53,20 +53,20 @@ function Get-EpisodeOEmbed {
5353
}
5454

5555
# Function to search YouTube for a video matching the episode title within a specific channel and return the video ID
56-
function Get-YouTubeVideoId {
57-
param (
58-
[string]$searchQuery
59-
)
60-
$youtubeSearchApi = "https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&q=$($searchQuery -replace ' ', '+')&channelId=$youtubeChannelId&key=$youtubeApiKey&maxResults=1"
61-
$youtubeResponse = Invoke-RestMethod -Method Get -Uri $youtubeSearchApi
62-
63-
if ($youtubeResponse.items.Count -gt 0) {
64-
return $youtubeResponse.items[0].id.videoId
65-
}
66-
else {
67-
return $null
68-
}
69-
}
56+
# function Get-YouTubeVideoId {
57+
# param (
58+
# [string]$searchQuery
59+
# )
60+
# $youtubeSearchApi = "https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&q=$($searchQuery -replace ' ', '+')&channelId=$youtubeChannelId&key=$youtubeApiKey&maxResults=1"
61+
# $youtubeResponse = Invoke-RestMethod -Method Get -Uri $youtubeSearchApi
62+
63+
# if ($youtubeResponse.items.Count -gt 0) {
64+
# return $youtubeResponse.items[0].id.videoId
65+
# }
66+
# else {
67+
# return $null
68+
# }
69+
# }
7070

7171
# Augment episodes with oEmbed data and YouTube video ID
7272
foreach ($episode in $episodes) {
@@ -79,11 +79,10 @@ foreach ($episode in $episodes) {
7979
$episode | Add-Member -MemberType NoteProperty -Name "oembed_html" -Value $oEmbedData.html
8080
$episode | Add-Member -MemberType NoteProperty -Name "oembed_url" -Value $oEmbedData.iframe_url
8181

82-
# Search YouTube using the episode's name and get the video ID
83-
$youtubeVideoId = Get-YouTubeVideoId -searchQuery $episode.name
84-
85-
# Add the YouTube video ID dynamically
86-
$episode | Add-Member -MemberType NoteProperty -Name "youtube_video_id" -Value $youtubeVideoId
82+
## Search YouTube using the episode's name and get the video ID
83+
#$youtubeVideoId = Get-YouTubeVideoId -searchQuery $episode.name
84+
## Add the YouTube video ID dynamically
85+
#$episode | Add-Member -MemberType NoteProperty -Name "youtube_video_id" -Value $youtubeVideoId
8786
}
8887

8988
# Define the target directory and file path

0 commit comments

Comments
 (0)