Skip to content

Commit 003591f

Browse files
committed
Check if YouTube channel ID starts with UC.
1 parent 46734f8 commit 003591f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@
257257

258258
get "/youtube/:channel_id/:username.ics" do |channel_id, username|
259259
return [404, "Credentials not configured"] if !ENV["GOOGLE_API_KEY"]
260+
return [404, "Invalid channel ID"] if !channel_id.start_with?('UC')
260261

261262
@channel_id = channel_id
262263
@username = username
@@ -322,6 +323,7 @@
322323

323324
get "/youtube/:channel_id/:username" do |channel_id, username|
324325
return [404, "Credentials not configured"] if !ENV["GOOGLE_API_KEY"]
326+
return [404, "Invalid channel ID"] if !channel_id.start_with?('UC')
325327

326328
@channel_id = channel_id
327329
playlist_id = "UU" + channel_id[2..]

0 commit comments

Comments
 (0)