# Issue with Onebox and Youtube

**URL:** <https://meta.discourse.org/t/issue-with-onebox-and-youtube/125969>\
**Category:** Bug\
**Tags:** onebox\
**Created:** [August 16, 2019, 10:41am UTC](https://meta.discourse.org/t/issue-with-onebox-and-youtube/125969 "2019-08-16T10:41:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [August 16, 2019, 4:25pm UTC](https://meta.discourse.org/t/issue-with-onebox-and-youtube/125969/3 "2019-08-16T16:25:12Z")

</div>

```diff
diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rb
index ac16eb82c16..46050a69e40 100644
--- a/lib/cooked_post_processor.rb
+++ b/lib/cooked_post_processor.rb
@@ -28,7 +28,7 @@ def initialize(post, opts = {})
     @cooking_options = @cooking_options.symbolize_keys
 
     @doc = Nokogiri::HTML::fragment(post.cook(post.raw, @cooking_options))
- @has_oneboxes = post.post_analyzer.found_oneboxes?
+ @has_oneboxes = @doc.css("aside.onebox").count > 0
     @size_cache = {}

```

@nbianca why did we don’t use the `post.post_analyzer.found_oneboxes?` method anymore in here?

All oneboxes which use either oembed or iframe will fail the new CSS selector mode, and that also makes our Onebox detector be different across the codebase.

---

_[View the full topic](https://meta.discourse.org/t/issue-with-onebox-and-youtube/125969)._
