YouTube's new commentEntityPayload format carries emojis as attachmentRuns
(startIndex/length into the plain text plus an image reference), which
parse_description() ignored so far - making every custom channel emoji
disappear from comments and video descriptions.
Merge attachmentRuns with the existing commandRuns handling (they share the
same UTF-16 coordinate space):
- Images hosted on /ggpht-proxiable domains (yt3.ggpht.com custom channel
emojis) are rendered as <img class="channel-emoji"> tags, reusing the
proxy and CSS class from the legacy comment renderer.
- Attachments pointing at www.youtube.com (standard unicode emojis rendered
as images by YouTube) are skipped, keeping their original characters -
they render fine natively without contacting YouTube's servers.
Fixes#5888
- View count and relative date detection now require the text to fully
look like one ('1.6M views', 'no views', '4 days ago', ...) instead of
a bare substring match, so channel names containing those words
(e.g. 'Daily Views') can no longer produce a false match. When several
parts match, the last one wins, as author rows precede metadata rows.
- Test fixtures were rebuilt keeping only the fields the parser reads:
all YouTube tracking parameters (including an accidentally captured
client IP inside thumbnail URLs) are gone.
Regression case added for tricky channel names.
Collaboration videos have an additional metadata row containing the
names of every channel involved, which means the views and published
data cannot be assumed to be located in metadataRows[0].
Iterate every metadata row instead of hardcoding the first one, using
the same approach already used by the playlist branch of this parser.
Fixes#5740
* Remove sort by rating and date in video search filters
Closes https://github.com/iv-org/invidious/issues/5626
* Remove check of protobug generation of rating and date sort filters in Invidious spec
Summing the sizes of each cached file every time is very inefficient.
Instead we can simply store the cache size in an constant and increase
it everytime a file is added into the cache.
Running `crystal spec` without a file argument essentially produces one
big program that combines every single spec file, their imports, and
the files that those imports themselves depend on. Most of the types
within this combined program will get ignored by the compiler due to a
lack of any calls to them from the spec files.
But for some types, partially the HTTP module ones, using them within
the spec files will suddenly make the compiler enable a bunch of
previously ignored code. And those code will suddenly require the
presence of additional types, constants, etc. This not only make it
annoying for getting the specs working but also makes it difficult to
isolate behaviors for testing.
The `static_assets_handler_spec.cr` causes this issue and so will be
marked as an isolated spec for now. In the future all of the tests
should be organized into independent groupings similar to how the
Crystal compiler splits their tests into std, compiler, primitives and
interpreter.
* Fix 0 view count on related videos
* Remove view_count variable since it's unused by Innertube
* Remove view_count from specs and API
---------
Co-authored-by: Fijxu <fijxu@nadeko.net>