Commit c66c6b1
committed
feat: capture emoji in youtube scraper
fixes #6
Emoji were not captured by the youtube scraper because they are not in the text node. They are in an image element instead. As a result, the scraper has to walk through a mix of text and image elements.
Fortunately, the actual emoji text is in the alternative text of the image.
This commit creates a private function to iterate over the elements of the comment. Whenever a text or an image element is found, it adds them to an array. It is joined at the end to build the message.1 parent b378871 commit c66c6b1
File tree
1 file changed
+18
-2
lines changed- browser-extension/src/entrypoints/youtube.content
1 file changed
+18
-2
lines changedLines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | 334 | | |
336 | 335 | | |
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
340 | 339 | | |
341 | | - | |
| 340 | + | |
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
| |||
361 | 360 | | |
362 | 361 | | |
363 | 362 | | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
381 | 397 | | |
0 commit comments