Commit Graph

87 Commits

Author SHA1 Message Date
syeopite
21049518d6 Improve cache size check to be more performant
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.
2025-12-19 12:35:00 +01:00
syeopite
7f9cfe1aa2 Refactor logic for updating temp files in tests 2025-12-19 12:35:00 +01:00
syeopite
89a0761a19 Fix Ameba Lint/UselessAssign 2025-12-19 12:35:00 +01:00
syeopite
7749ea1956 Isolate static assets handler spec from others
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.
2025-12-19 12:35:00 +01:00
syeopite
9e482b4807 Add specs for the new StaticAssetsHandler 2025-12-19 12:35:00 +01:00
shiny-comic
5cfe294063 Fix 0 view count on related videos section (#5446)
* 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>
2025-10-16 21:59:34 -03:00
Emilien Devos
90544e07b6 update the mocks with the latest updated data 2024-10-13 21:18:21 +02:00
ChunkyProgrammer
b384133dc9 Fix tests 2024-09-30 22:02:57 -04:00
Samantaz Fox
5e38ef59da Ameba: Fix Lint/UselessAssign (#4795)
Related to issue 2231
2024-08-11 13:38:29 +02:00
syeopite
fad0a4f52d Ameba: Fix Lint/UselessAssign 2024-07-17 12:39:40 -07:00
meatball
3bac467a8c Call as? instead of as to not force string conversion 2024-06-19 12:52:53 +02:00
meatball
248df785d7 Update spec and rollback to last commits changes 2024-06-18 20:55:14 +02:00
Samantaz Fox
962ce23cc2 WebVTT::Builder: Add logic to escape special chars (#4414)
Note: WebVTT does allow some tags in the cue payload in some circumstances
while this PR just blindly escapes everything:
https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API#cue_payload_text_tags
2024-02-19 00:16:17 +01:00
Samantaz Fox
60f6a345d9 Locales: Fix broken i18Next v3/v4 plurals
Languages impacted: es, fa, pt
2024-02-15 22:12:04 +01:00
syeopite
0ad2eff2a4 WebVTT::Builder: Add logic to escape special chars 2024-01-30 15:25:45 -08:00
ThetaDev
c005ada487 fix: prevent censoring of self-harm related search queries (#4403)
* fix: prevent censoring of self-harm related search queries

* fix: yt_filters_spec with new flag
2024-01-29 14:59:25 +01:00
Samantaz Fox
3a5d408602 Remove leftover functions/specs used by the anti-captcha job 2023-11-20 17:40:31 +01:00
Samantaz Fox
1caaf63c8a Refactor WebVTT building logic into WebVTT::Builder (#4070) 2023-10-07 19:53:29 +02:00
Samantaz Fox
f26c995344 i18next: Revert some changes, as es/pt/pt-PT aren't mixed up (yet) 2023-10-07 19:12:17 +02:00
Samantaz Fox
32310b7c9f i18Next: Add exceptions for mixed v3/v4 plural forms 2023-10-06 08:19:27 +02:00
syeopite
d371eb50f2 WebVTT::Builder: rename #line to #cue 2023-09-23 09:41:41 -04:00
syeopite
54fa59cbb0 Add method to construct WebVTT files
Similar to JSON.Build
2023-09-23 09:20:20 -04:00
Samantaz Fox
4414c9df70 specc: Add tests for 'decode_date' 2023-05-29 13:16:50 +02:00
Samantaz Fox
193c510c65 Spec: Update require to point to new files 2023-05-25 22:53:53 +02:00
Samantaz Fox
4379a3d873 Comments: Move ctoken functions to youtube.cr 2023-05-25 22:53:53 +02:00
Samantaz Fox
9a765418d1 Update specs 2023-04-10 16:59:13 +02:00
Samantaz Fox
1f3317e257 Update video spec 2023-03-19 21:52:24 +01:00
Samantaz Fox
f9eb839c7a channel: remove dead playlists code 2022-12-22 17:26:32 +01:00
Samantaz Fox
ce7db8d2cb extractors: Add continuation token parser 2022-12-22 16:13:26 +01:00
Samantaz Fox
516efd2df3 Cleanup videos (#3238) 2022-11-17 01:03:23 +01:00
Samantaz Fox
9da1827e95 Dirty fix to get back the channel videos 2022-11-02 01:03:39 +01:00
Samantaz Fox
ae03ed7bf7 videos: move player/next parsing code to a dedicated file 2022-10-31 20:09:04 +01:00
Samantaz Fox
33150f5de3 spec: Add test cases for regular videos extraction 2022-10-31 20:09:04 +01:00
Samantaz Fox
907ddfa06a spec: Add tests for recent changes 2022-10-31 20:09:04 +01:00
Samantaz Fox
6aaea7fafa Videos: parse data during first fetching
There will be less data to be stores in the DB cache
2022-10-31 20:09:04 +01:00
Samantaz Fox
cd03fa06ae videos: move 'Caption' and associated global/functions to a separate file 2022-10-31 20:09:04 +01:00
Samantaz Fox
0ed4f1a9a4 Add unit tests for scheduled livestreams 2022-07-21 00:33:39 +02:00
Samantaz Fox
0e3820b634 Add #to_http_params method to Query (Fixes #3148) 2022-07-04 22:21:27 +02:00
Samantaz Fox
fd99f20404 Fix CI: use be_close() with 1s delta for Time comparisons 2022-06-08 23:56:40 +02:00
Samantaz Fox
96ac7f9f35 Add hashtag extractor spec 2022-06-08 23:56:40 +02:00
Samantaz Fox
25b60a1b90 Add spec for the Search::Query class 2022-04-16 20:24:50 +02:00
Samantaz Fox
af02917766 Code cleanup 2022-04-03 22:28:11 +02:00
Samantaz Fox
6991d0851f Add a function to generate HTTP::Params from Filters 2022-03-29 20:31:23 +02:00
Samantaz Fox
fb2a331f79 Add a function to parse search filters from invidious URL params 2022-03-29 20:31:23 +02:00
Samantaz Fox
c888524523 Add a function to parse invidious legacy search filters 2022-03-29 20:31:23 +02:00
Samantaz Fox
75c9dbaf6b Add a function to parse youtube search parameters 2022-03-29 20:31:23 +02:00
Samantaz Fox
c01a29fe76 Add a function to build youtube search filters
(it aims at replacing produce_search_params)
2022-03-29 20:31:23 +02:00
Samantaz Fox
2bbd424fce Move import logic to its own module 2022-02-07 17:38:50 +01:00
Samantaz Fox
6fab5d0554 Merge pull request #2545 from bbielsa/csv-subscriptions-import
Add CSV Subscriptions Import
2022-01-16 15:11:37 +01:00
Samantaz Fox
461fae4f77 Use contain_exactly() in spec 2022-01-15 12:52:19 +01:00