100 Commits
Author SHA1 Message Date
Samantaz Fox 9892604758 Prepare for next release 2024-11-10 21:40:32 +01:00
Samantaz Fox 5d2dd40bc3 Release v2.20241110.0 2024-11-10 21:35:03 +01:00
Samantaz Fox 699d53ad41 Update shard.yml metadata (#5066)
Changes are mostly based off of the Crystal compiler's own shard.yml

Remember to bump the version attribute when creating a release!!!
2024-11-10 21:03:13 +01:00
Samantaz Fox 3ac8978e96 VideoProxy: Handle 302 redirects in chunked section 2024-11-10 18:15:24 +01:00
Samantaz Fox e7a93fcc18 API: Replace any URL in HLS manifests 2024-11-10 18:13:30 +01:00
Samantaz Fox aa33d9b7ec Videos: Fix missing host parameter on playback URLs when local=true 2024-11-10 18:13:30 +01:00
Samantaz Fox 2150264d84 Update CHANGELOG.md 2024-11-10 18:00:26 +01:00
Samantaz Fox d42561d74a API: Add "sort_by" parameter to channels/shorts endpoint (#5071)
Small follow up to PR 5059

No related issue
2024-11-10 17:50:00 +01:00
Samantaz Fox 7092bb8855 Docker: Install tzdata in Dockerfile (#5070)
Should close 5067
2024-11-10 17:48:18 +01:00
Samantaz Fox d7c35e6e3d Videos: Stop using TVHTML5_SIMPLY_EMBEDDED_PLAYER (#5063)
The age restriction bypass does not work anymore with this client.
See: https://github.com/iv-org/invidious/issues/2189#issuecomment-2437740627

Related to 2189
2024-11-10 17:45:58 +01:00
Samantaz Fox bc86fb8a82 Routing: Deprecate old channel API routes (#5045)
Deprecate the following routes:

* /api/v1/channels/videos/:ucid
* /api/v1/channels/latest/:ucid
* /api/v1/channels/playlists/:ucid
* /api/v1/channels/community/:ucid
* /api/v1/channels/search/:ucid

in favor of:

* /api/v1/channels/:ucid/videos
* /api/v1/channels/:ucid/latest
* /api/v1/channels/:ucid/playlists
* /api/v1/channels/:ucid/community
* /api/v1/channels/:ucid/search

No related issue
2024-11-10 17:44:45 +01:00
Samantaz Fox ec82c2f539 Videos: use WEB client instead of WEB CREATOR (#4984)
Use the WEB client when a potoken is configured, otherwise try with Android
test suite if there is no potoken configured.

This PR reverts some of the changes made in 4928

Related to 4734
2024-11-10 17:41:54 +01:00
Samantaz Fox 4b363e32fa Parsers: Fix parsing live_now and premiere_timestamp (#4934)
This pull request fixes the parsing for the 'live_now' and 'premiere_timestamp'
variables so that they work without the 'microformat' data being present.

Related to 4929
2024-11-10 17:36:49 +01:00
Samantaz Fox 1a49e798c8 Docker: Install tzdata in Dockerfile 2024-11-09 21:52:06 +01:00
Samantaz Fox b173d4acf2 Update CHANGELOG.md 2024-11-08 23:45:15 +01:00
Samantaz Fox 43d5efd9da Stale bot updates (#5060)
* Prevents PRs from being considered staled
* Double the stale timer for issues
* Prevent discussion issues from being staled

No related issue
2024-11-08 23:42:45 +01:00
Samantaz Fox 1480e0089f Channels: Fix "Youtube API returned error 400" (#5059)
This PR also adds sort option to the channel "shorts" tab.
Thanks to iBicha for the original fix of the "livestreams" tab.

Closes 4029, 5021 and 5029
2024-11-08 23:40:34 +01:00
Samantaz Fox a5fb78bba5 Locales: Add Bulgarian, Welsh and Lombard to the list (#5046)
No related issue
2024-11-08 23:33:36 +01:00
Samantaz Fox 09f5485889 Shards: Update database dependencies (#5034)
No related issue
2024-11-08 23:32:25 +01:00
Samantaz Fox a760b69cb6 Logger: Add color support for different log levels (#4931)
No related issue
2024-11-08 23:28:51 +01:00
Samantaz Fox 4f7a18a630 Fix named arg syntax when passing force_resolve (#4754)
No related issue
2024-11-08 23:27:22 +01:00
Samantaz Fox 42da2547e3 Use make_client instead of calling HTTP::Client (#4709)
No related issue
2024-11-08 23:26:32 +01:00
Samantaz Fox 2a19dbb1fe Channels: Use the same structure as in the other ctoken functions
Change explanation, courtesy of iBicha:
The \n is basically a decimal 10, which is 1010 binary. That is a field number
1, and a wire type 2 (length-delimited). Then the $ is a decimal 36, which is
exactly the length of 00000000-0000-0000-0000-000000000000.
So both objects end up being encoded into the same data.
2024-11-08 18:28:58 +01:00
Samantaz Fox 6dd662a5b8 Channels: lockupViewModel is also used in the "playlists" tab 2024-11-08 17:44:36 +01:00
Samantaz Fox 301aeffa78 Channels: Multiple small fixes
Fix the "newest" link not being bold when 'sort_by' uses the default value
Show 60 videos per page, rather than 30
2024-11-08 14:00:35 +01:00
Samantaz Fox d27a5e7fae Channels: Rename ctoken generator functions as requested 2024-11-08 14:00:35 +01:00
Samantaz Fox afc5b27d83 Extractors: Add support for shortsLockupViewModel
The 'shortsLockupViewModel' structure is used in the channel "shorts" tab
2024-11-08 14:00:30 +01:00
Samantaz Fox 1a5047aad9 Extractors: Add support for lockupViewModel
The 'lockupViewModel' structure is used in the channel "podcasts" tab
2024-11-08 14:00:16 +01:00
Samantaz Fox 82248fad02 Channels: Add sort options to shorts 2024-11-07 23:08:36 +01:00
Samantaz Fox cbc546f032 Channels: Add function to generate the new ctoken objects 2024-11-07 23:08:31 +01:00
Samantaz Foxandsyeopite 792d0d5f6d CI: Check Crystal lint only on latest version (#5042)
* CI: Check Crystal lint only on latest version

* Apply suggestion from code review

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>

---------

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2024-11-07 13:14:36 +00:00
Samantaz Fox 75c5881c55 Locales: Add Bulgarian, Welsh and Lombard to the list 2024-10-31 13:34:51 +01:00
Samantaz Fox 6da18ddc41 Routing: Also remove outdated comment about notification routes 2024-10-31 11:52:09 +01:00
Samantaz Fox cdf93b29e6 Routing: Remove deprecated /api/v1/channels/.../:ucid routes 2024-10-31 11:51:33 +01:00
Samantaz Fox 2e3a7ad044 Update CHANGELOG.md 2024-10-30 17:13:00 +01:00
Samantaz Fox c427c184e2 Captions: Add "Filipino (auto-generated)" to the list of languages (#4995)
I encountered a wild
[warn] i18n: Missing translation key "Filipino (auto-generated)"
while browsing videos on the test instance.

No related issue.
2024-10-30 17:07:09 +01:00
Samantaz Fox 59acf23c0c Makefile: Add MT option to enable the 'preview_mt' flag (#4993)
This PR add an MT option to the Makefile. When make is invoked with 'MT=1',
the 'preview_mt' flag is passed to the Crystal compiler.

It doesn't mean that invidious fully supports multi-threading, but at least
it provides an easy way for trying that out.

No related issue.
2024-10-30 17:05:21 +01:00
Samantaz Fox 2eeb6a731d SigHelper: Reconnect to signature helper (#4991)
Fijxu have been using it for more than 3 weeks on their instance and
they report that it works really well.

This only works if 'inv_sig_helper' itself crashes and restarts (via systemd
or docker restart policy) but it will not work if 'inv_sig_helper' hangs and
stops responding to invidious (but this is an issue with 'inv_sig_helper',
not Invidious).

Closes issue 4926
2024-10-30 17:02:51 +01:00
Samantaz Fox 0fb67cc090 Player: Fix a bug where menus were hard to open (#4750)
The fix basically enlarges the hoverable area in order to avoid getting the
menu closed if the mouse isn't moved fast enough.

Video of the fix:
https://www.loom.com/share/36494a3653984650aea3eaa2af276a35

Closes issue 4749
2024-10-30 16:59:34 +01:00
Samantaz Fox 9957da28dc Proxy: Use connection pools for images (#4326)
Theoretically this should improve memory usage and performance by quite a bit
as we aren't creating a new HTTP::Client and in a turn a new connection for
every image we request from YouTube.

Closes issue 4009
2024-10-30 13:55:28 +01:00
Samantaz Fox f326bcf8db Add support for using Invidious through a HTTP Proxy (#4270)
Partially addresses issue 301
2024-10-30 13:46:49 +01:00
Samantaz Fox b0c7dd9771 HTML: Replace hidden 'action' input with query parameter
The server side can only handle parameters passed as URL query
parameters and not inside the request body
2024-10-29 22:14:27 +01:00
Samantaz Fox dbdf2ad23a Routes: Simplify actions in watch_ajax 2024-10-29 18:27:53 +01:00
Samantaz Fox dbd96c77e4 Routes: Simplify actions in token_ajax 2024-10-29 18:21:58 +01:00
Samantaz Fox e453a2a682 Routes: Simplify actions in subscription_ajax 2024-10-29 18:16:52 +01:00
Samantaz Fox 7e4b3b182a Routes: Simplify actions in playlist_ajax 2024-10-29 18:09:50 +01:00
Samantaz Fox 711d52d47f Shards: Update database dependencies 2024-10-29 17:26:24 +01:00
Samantaz Fox 952b3625a0 Add "Filipino (auto-generated)" to the list of caption languages 2024-10-10 20:31:22 +02:00
Samantaz Fox f51a3b8d2b Makefile: Add MT option to enable the 'preview_mt' flag 2024-10-09 18:37:08 +02:00
Samantaz Fox a88a723de3 Update CHANGELOG.md 2024-10-08 18:36:41 +02:00
Samantaz Fox d5f5490aee Search: Fix 'youtu.be' URLs in sanitizer (#4894)
Use the proper URL argument when transforming youtu.be URLs to their
youtube.com equivalents.

Thanks to Tuhgy on the fediverse for reporting this!

No related issue
2024-10-08 18:03:56 +02:00
Samantaz Fox 82d797b74e Ameba: Disable Style/RedundantNext rule (#4888)
No related issue
2024-10-08 18:02:47 +02:00
Samantaz Fox 97895a491a Playlists: Fix 'invalid byte sequence' error when subscribing (#4887)
In Crystal, handling multi-byte sequences in UTF-8 requires understanding that
slicing by bytes can lead to invalid sequences if the slicing isn't aligned
with character boundaries. In this case, attempting to slice a string by bytes
can cut through multi-byte UTF-8 sequences, leading to invalid sequences.

To avoid this, strings should be sliced based on characters rather than bytes.

Fixes issue 4886
2024-10-08 18:01:22 +02:00
Samantaz Fox 0ac9367322 Parse more metadata badges for SearchVideos (#4863)
This PR makes it possible to display badges in the search results for third
party Invidious applications (ex: FreeTube)

See also: https://github.com/FreeTubeApp/FreeTube/pull/5590

No related issue
2024-10-08 17:59:35 +02:00
Samantaz Fox d3830f7870 Translations update from Hosted Weblate (#4862) 2024-10-08 17:56:39 +02:00
Samantaz Fox 3cfcc16403 Videos: Convert URL before putting result into cache (#4850)
Closes issue 4837
2024-10-08 17:52:34 +02:00
Samantaz Fox 171c0a0814 HTML: Add error message to "search issues on GitHub" link (#4652)
This PR adds the error message to the "search on Github" link located on
the crash page, so that the search bar is already filled and the issues
filtered when the user opens said link.

As seen with #4584 and other critical problems, duplicate issues end up
unnecessarily flooding the issue reports. While this change won't entirely
stop this behavior, this will help the user to easily identify if the error
they have received has been reported yet and discourage them from creating
a duplicate (hopefully...).

No associated issue was open
2024-10-08 17:51:36 +02:00
Samantaz Fox 82ac9a8609 Preferences: Add option to control preloading of video data (#4122)
This PR adds a configuration option to control the preloading of video data on
page load with the HTML5 'preload'[1] attribute on the `<video>` element.

The option is enabled by default, meaning that the `preload` attribute's value
will be 'auto'. If users want to prevent preloading of video data, they
can disable the option, which will set the attribute value to 'none'.

[1](https://www.w3schools.com/tags/att_video_preload.asp)

Closes issue 4110
2024-10-08 17:38:06 +02:00
Samantaz Fox 7c79ee7cc2 Performance: Improve speed of automatic instance redirection (#4193)
The automatic instance redirection implemented in #1940 fetches a new list of
instances each time someone queries the /redirect endpoint. This is extremely
inefficient...

This PR optimizes all that into a background job that only fetches a single
list every 30 minutes. This should performance quite a bit.

No related issue was opened.
2024-10-08 17:31:20 +02:00
Samantaz Fox 5e899d73a9 Search: Fix for youtu.be URL in sanitizer 2024-09-02 18:14:57 +02:00
Samantaz Fox 4782a67038 Release v2.20240825.2 2024-08-26 22:52:50 +02:00
Samantaz Fox 5baaedfa39 CI: Fix docker container tags (#4883)
Closes issue 4880
2024-08-26 22:48:14 +02:00
Samantaz Fox 9d91ac3b88 Use snake case for all variables 2024-08-26 20:17:45 +00:00
Samantaz Fox 4f066e880c CI: Fix docker container tags 2024-08-26 21:55:43 +02:00
Samantaz Fox 3e17d04875 Release v2.20240825.1 2024-08-25 22:30:46 +02:00
Samantaz Fox 80958aa0d8 Release v2.20240825 2024-08-25 21:25:48 +02:00
Samantaz Fox c5fdd9ea65 HTML: Sort playlists alphabetically in watch page drop down (#4853)
Closes issue 4708
2024-08-24 20:50:46 +02:00
Samantaz Fox 2876ee0f9f HTML: Fix XSS vulnerability in description/comments (#4852)
Before this PR, the comment/description content was not HTML escaped when 'parse_description()'
was called with a JSON object lacking the "commandRuns" entry.

Closes issue 4727
2024-08-24 20:50:05 +02:00
Samantaz Fox 0699e5fc27 YtAPI: Bump client versions (#4849)
This might help reducing the amount of playback errors.

No related issue
2024-08-24 20:47:01 +02:00
Samantaz Fox 15669acccf SigHelper: Fix inverted time comparison in 'check_update' (#4845)
Closes issue 4840
2024-08-24 20:44:52 +02:00
Samantaz Fox cd2daf4adb Storyboards: Various fixes and code cleaning (#4153)
Closes issue 3441
2024-08-24 20:43:05 +02:00
Samantaz Fox 3c6a662aaf Search: Add support for Youtube URLs (#4146)
Closes issue 3300
2024-08-24 19:44:59 +02:00
Samantaz Fox 9e55799269 Channel: Render age restricted channels (#4295)
This PR:
 * gets thumbnail and channel name from the initial request
 * gets videos, shorts and streams via autogenerated channel playlists

Test Url: /channel/UCbfnHqxXs_K3kvaH-WlNlig

Closes issue 3513
2024-08-24 19:43:59 +02:00
Samantaz Fox da70c9b7b0 Ameba: Miscellaneous fixes (#4807)
End of a series of PRs meant to improve code quality.

Related to issue 2231
2024-08-24 19:42:10 +02:00
Samantaz Fox 828da3c6ce API: Proxy formatStreams URLs too (#4859)
The /api/v1/videos endpoint does not proxy the formatStreams URLs when
'local=true' is passed, whereas the adaptiveFormats URLs are correctly proxied.

The Web UI does proxy when clicking "Download" with 'fmt=18' for example, so
this is probably an oversight. This PR aims to fix that.

No related issue
2024-08-24 19:39:36 +02:00
Samantaz Fox febf18cbf7 UI: Add search button to search bar (#4706)
Closes issue 529
2024-08-24 19:38:48 +02:00
Samantaz Fox b2133c6b2c Videos: Convert URL before putting result into cache 2024-08-24 18:01:56 +02:00
Samantaz Fox 21ab5dc668 Storyboard: Revert cue timing "fix" 2024-08-22 00:29:15 +02:00
Samantaz Fox b200ebfb6b CSS: Remove extra space in default.css 2024-08-21 20:23:45 +00:00
Samantaz Fox 85deea5aca Search: Change smart search inhibitor to a backslash 2024-08-17 19:22:40 +02:00
Samantaz Fox 78c5ba93c7 Misc: Clean some code in UrlSanitizer 2024-08-17 19:22:40 +02:00
Samantaz Fox 31a80420ec Search: Add URL search inhibition logic 2024-08-17 19:22:40 +02:00
Samantaz Fox 4c0b5c314d Search: Add support for youtu.be and youtube.com URLs 2024-08-17 19:22:40 +02:00
Samantaz Fox eb0f651812 Add a youtube URL sanitizer 2024-08-17 19:22:40 +02:00
Samantaz Fox 764965c441 Storyboards: Fix lint error 2024-08-17 12:20:53 +02:00
Samantaz Fox b795bdf2a4 HTML: Sort playlists alphabetically in watch page drop down 2024-08-16 12:10:22 +02:00
Samantaz Fox 5b05f3bd14 Storyboards: Workarounds for videojs-vtt-thumbnails
The workarounds are as follow:
  * Unescape HTML entities
  * Always use 0:00:00.000 for cue start/end
2024-08-16 11:36:01 +02:00
Samantaz Fox a335bc0814 Storyboards: Fix some small logic mistakes 2024-08-16 10:05:49 +02:00
Samantaz Fox 7b50388eaf Storyboards: Fix broken first storyboard 2024-08-16 10:05:48 +02:00
Samantaz Fox da3d58f03c Storyboards: Cleanup and document code 2024-08-16 10:05:47 +02:00
Samantaz Fox 8327862697 Storyboards: Use replace the NamedTuple by a struct 2024-08-16 10:04:40 +02:00
Samantaz Fox 6878822c4d Storyboards: Move parser to its own file 2024-08-16 10:02:52 +02:00
Samantaz Fox 0b28054f8a videos: Fix XSS vulnerability in description/comments
Patch provided by e-mail, thanks to an anonymous user whose cats are named
Yoshi and Yasuo.

Comment is mine
2024-08-15 18:26:17 +02:00
Samantaz Fox cc33d3f074 YtAPI: Also update User-Agent string 2024-08-15 18:14:29 +02:00
Samantaz Fox acbb625866 YtAPI: Update clients to latest version 2024-08-15 12:57:36 +02:00
Samantaz Fox 466bfbb306 SigHelper: Fix inverted time comparison in 'check_update' 2024-08-14 21:43:37 +02:00
Samantaz Fox e319c35f09 Videos: use intermediary variable when using CONFIG.po_token 2024-08-13 20:56:09 +02:00
Samantaz Fox 2d18ff1f80 Add ability to set po_token and visitordata ID (#4789)
This PR adds two new config option, to pass a PO token (config 'po_token') and
a visitor ID (config 'visitor_data') to Youtube. These two strings are required
to play videos using the WEB client.

Warning: These strings gives much more identifiable information to Google!

If the po_token setting is filled in, then the WEB client is used. If not, the
Android client is used. TvHtml5ScreenEmbed will still be used as a fallback.

Script for generating po_token and visitor_data:
https://github.com/iv-org/youtube-trusted-session-generator

Helps with issue 4734
2024-08-13 20:35:43 +02:00
Samantaz Fox 2d7869b48b Add support for an external signature server (#4772)
This PR adds support for inv_sig_helper, which offloads the player fetching,
function extraction and signature parsing, which in turn allows to use the
web client to watch videos.

When the new config option "signature_server" is not set, the logic for the
external signature server is not enabled and invidious behaves like before.

This PR also updates the crystal overrides because the stdlib changed quite
a while ago (See issue 11049 at crystal-lang/crystal) and those were required
to properly use TCP/unix sockets.

Closes issue 4649
2024-08-13 20:26:59 +02:00
Samantaz Fox 88b9f17388 Ameba: Fix Naming/VariableNames (#4790)
Related to issue 2231
2024-08-13 20:26:15 +02:00