diff --git a/app.rb b/app.rb index b356267..3df0dd3 100644 --- a/app.rb +++ b/app.rb @@ -313,7 +313,7 @@ next "Error: Could not find the user. Please try with a video url instead." if response.code == 404 raise(App::GoogleError, response) if !response.success? doc = Nokogiri::HTML(response.body) - doc.at("meta[itemprop='channelId']")["content"] || "Error: Could not find the user. Please try with a video url instead." + doc.at("meta[itemprop='channelId']")&.[]("content") || "Error: Could not find the user. Please try with a video url instead." end elsif video_id channel_id, _ = App::Cache.cache("youtube.video", video_id, 60*60, 60) do diff --git a/config/initializers/05-nil.rb b/config/initializers/05-nil.rb index a962ee7..3068a1f 100644 --- a/config/initializers/05-nil.rb +++ b/config/initializers/05-nil.rb @@ -32,8 +32,4 @@ def linkify_and_embed(request=nil, embed_only="") def embed_html(request=nil) nil end - - def [](key) - false - end end