Commit Graph

5658 Commits

Author SHA1 Message Date
Fijxu
a44f37563b
chore: add check backends interval configuration option 2025-03-16 23:10:19 -03:00
Fijxu
facd01b52e
feat: add support for encrypted query parameters
Related:

- 6bd0f28d77
- 7eae31613e
2025-03-16 19:54:40 -03:00
Fijxu
db53ee21ee
Merge remote-tracking branch 'upstream/master'
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
2025-03-14 12:26:53 -03:00
Émilien (perso)
70ff463cc6
Add invidious companion support (#4985)
* add support for invidious companion

* redirect latest_version and dash manifest to invidious companion

* fix Shadowing outer local variable `response`

* fixing condition for Content-Security-Policy

* throw error if inv_sig_helper and invidious_companion used same time

* Use sample instead of Random.rand

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

* Remove debug puts functions

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

* modify the description for config.example.yaml about invidious companion

* move config checks for invidious companion

* separate invidious_companion logic + better config.yaml config

* fixing "end" misplacement

* fix linting + use .empty?

* crystal handle decompression already by itself

* fix download function when invidious companion used

* fix linting

* invidious companion always used so always add CSP and redirect latest_version

* apply all the suggestions + rework invidious_companion parameter

* format watch.cr

* fix ameba Redundant use of `Object#to_s` in interpolation

* add ability for invidious companion to check request from invidious

* Better document private_url and public_url

* Better doc for invidious_companion_key

* !empty? to present?

* skip proxy for invidious companion

* fixing format

* missing ,

* add companion pooling http

* fix: don't use http proxy when sending requests to companion

* fix: logic where we want to have the invidious logic if companion is not used

* chore: remove baseurl usage from invidious companion

* chore: change from inv-sig-helper to companion for required playback

* fix: use puts + add warning for inv-sig-helper deprecated

---------

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2025-03-13 16:44:00 +01:00
syeopite
e23d0d13be
Add changelog for v2.20250314.0 (#5197)
* Release v2.20250314.0

* Update CHANGELOG.md
2025-03-12 03:31:15 -07:00
syeopite
5c8b4eb379
Warn when po_token, visitor_data and/or inv-sig-helper is not configured (#5202)
* Warn when required configs for playback is missing

* Add link to documentation in warnings

* Direct users to /installation instead
2025-03-12 10:11:17 +01:00
Fijxu
a4cb5f094c
fix: add missing check for c.youtube.com host
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
2025-03-10 15:40:59 -03:00
Fijxu
01ccd55829
feat: add option to change username
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
fix: rename subscriptions materialized view of the user too

remove materialized views from username change

fix: downcase username and limit username lenght (from routes/login.cr)

Users that changed their username to something like `User`, were unable
to login because the username is downcased on routes/login.cr
2025-03-08 02:47:42 -03:00
Fijxu
8fe965419a
fix: use short_description as description if microformat is not available 2025-03-08 02:47:24 -03:00
Fijxu
fda823593e
fix: handle microformat as nil if is not present on innertube response.
Videos that return CONTENT_CHECK_REQUIRED do not include the
microformat JSON object literal on them. I think it's better to handle
microformat as nil instead of raising if microformat is not present.
2025-03-07 00:23:48 -03:00
Fijxu
24e66231df
chore: remove extra function call in check_backends
Some checks are pending
Build and release container directly from master / release (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Waiting to run
Invidious CI / build-docker (push) Waiting to run
Invidious CI / build-docker-arm64 (push) Waiting to run
Invidious CI / lint (push) Waiting to run
2025-03-06 20:24:07 -03:00
Fijxu
1001a72297
feat: show status of the instance with a colored dot
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
2025-03-02 16:35:44 -03:00
Fijxu
e5c0f15398
Merge branch 'add-prometheus-metrics-endpoint'
From https://github.com/iv-org/invidious/pull/3576
2025-03-01 03:39:21 -03:00
Fijxu
ecacbab2a5
update readme 2025-03-01 03:11:11 -03:00
Fijxu
bceb7a61ef
feat: Detect videoplayback proxy from invidious-companion and add it to the CSP header 2025-02-28 20:06:09 -03:00
syeopite
f3d982a885
Update Kemal to 1.6.0 and remove Kilt
Kilt is unmaintained and the ECR templating logic has been
natively integrated into Kemal with the issues previously seen
having been resolved.

This commit is mostly a precursor to support the next Kemal
release which will add the ability to create error handlers for
raised exceptions.

See https://github.com/kemalcr/kemal/pull/688
2025-02-28 20:04:42 -03:00
Fijxu
27fecf3879
require base_job before the other jobs
The crystal compiler seems to evaluate `require` in an alphabetical way,
so if anyone in the future, wants to add another job and that job is
above `base_job.cr` in alphabetical order, the compiler is going to fail
with `Error: undefined constant: Invidious::Jobs::BaseJob`.

This doesn't fix anything, but it will prevent a future headache.
2025-02-28 20:04:28 -03:00
Fijxu
50fa7de901
Merge remote-tracking branch 'upstream/master' 2025-02-27 02:02:47 -03:00
syeopite
adcdb8cb92
Fix lint and formatting 2025-02-26 14:18:50 -08:00
syeopite
fe4fa0480a
Fix HLS being used for non-livestream videos (#5189)
Invidious does not currently support non-livestream hls playback

Originally, the HLS manifest check was essentially a boolean:
if the HLS manifest field was present, it was assumed to be a
livestream. Some videos include the HLS Manifest but aren't
livestreams.

In the case where they are livestreams, the video contains a videoType
field with the value "Livestream". In the case that they're normal
videos, the videoType is "Video". This is exposed via the
`video.live_now` property.

This commit just checks that `video.live_now` is true before treating
it as a livestream
2025-02-26 14:14:29 -08:00
syeopite
dbbcacc955
Images: fix typo in thumbnail logic 2025-02-26 14:13:58 -08:00
syeopite
58ad848d56
Channels: Support YouTube's change to from /community to /posts (#5183) 2025-02-26 14:13:22 -08:00
syeopite
f9b9e85ee4
Docker: Use Crystal compiler cache in docker builds (#5163)
Adding the compiler cache reduces the build times on repeated
builds significantly
2025-02-26 14:11:12 -08:00
syeopite
6ac74f4362
Videos: Fix empty response when rv published field is nonexistent (#5162)
Fixes #5161 by checking recommended videos published field for presence
before attempting to parse it in api
2025-02-26 14:09:28 -08:00
syeopite
9fbe3944b0
Channels: Add Courses to channel page and channel API (#5158)
Closes #5144
2025-02-26 14:08:44 -08:00
syeopite
c5e9447f41
Pick a different instance upon redirect (#5154)
The automatic instance redirection has the potential to pick
the same instance the user is currently on. This is especially
prevalent when the instance list is limited in number like how it is
today.

This PR checks the domain of the instance and ensures that it is not
the same as the current instane before redirecting the user to it.
Otherwise, it just sends the user to rediret.invidious.io
2025-02-26 14:05:21 -08:00
syeopite
3e329410d1
Add the ability to listen on UNIX sockets (#5112) 2025-02-26 14:04:29 -08:00
syeopite
74dfda150e
i18n: Enable Tamil 2025-02-26 14:02:57 -08:00
syeopite
e60f53154e
Translations update from Hosted Weblate (#4989) 2025-02-26 13:57:04 -08:00
syeopite
3d77635a5c
Add API endpoint for fetching transcripts from YouTube (#4788) 2025-02-26 13:56:39 -08:00
syeopite
d0433c8386
JS: Update timeupdate event defensive to prevent errors (#4782) 2025-02-26 13:56:13 -08:00
syeopite
4ea4878d1a
User: Batch notifications together 2025-02-26 13:55:25 -08:00
syeopite
1f0a89fb5f
RSS: Channel + Playlist improvements (#4298) 2025-02-26 13:55:01 -08:00
syeopite
f95f87e448
Frontend: Add a first page and previous page buttons for channel navigation (#4123) 2025-02-26 13:54:25 -08:00
Fijxu
e76867aaba
feat(Database::Videos): built-in video cache and support for multiple caching backends
I did this to get rid of Redis compatible DBs and for speed purposes.
This is considered experimental, but everything works fine from
what I have tested.

Here are some benchmarks using the built-in benchmark library of
crystal:

\# built-in release
cache get  19.79M ( 50.54ns) (± 4.12%)  32.0B/op  fastest
cache insert   7.88k (126.86µs) (± 2.20%)  65.5kB/op  fastest
cache get   4.31k (232.11µs) (± 5.50%)  104kB/op  fastest

\# redis release
cache get  22.27k ( 44.90µs) (± 6.40%)  264B/op  fastest
cache insert   4.74k (211.01µs) (± 4.72%)  65.7kB/op  fastest
cache get   2.51k (399.11µs) (±13.15%)  129kB/op  fastest

---

OP/s are way higher, and memory usage per call is lower, so it's a win
win.
2025-02-26 17:51:54 -03:00
Fijxu
62cc10d2ca
chore: remove unused config properties 2025-02-24 13:32:19 -03:00
Fijxu
9f475c1f2a
feat(dev): add option to disable video cache on the database (for development purposes only) 2025-02-24 13:26:52 -03:00
Fijxu
b3e24c703d
feat(invidious-companion): use connection pool
From
https://github.com/iv-org/invidious/pull/4985#discussion_r1889356705

Thanks syeopite!
2025-02-21 14:12:03 -03:00
Fijxu
d8ecfd9c04
feat(dev): add option to disable CSP (for development purposes only) 2025-02-21 14:09:16 -03:00
Alex Maras
49afbf2a14 Fix an issue with the HLS manifest check for livestream videos
Originally, the HLS manifest check was essentially a boolean: if the HLS
manifest field was present, it was assumed to be a livestream. Some
videos include the HLS Manifest but aren't livestreams.

In the case where they are livestreams, the video contains a videoType
field with the value "Livestream". In the case that they're normal
videos, the videoType is "Video". This is exposed via the video.live_now
method.

This commit just checks that video.live_now is true before treating it
as a livestream
2025-02-21 16:30:39 +08:00
Fijxu
7fcee35cb1
Revert "fix(player.js): set client side XHR timeout"
This reverts commit aff5fbb1aa.
2025-02-19 01:10:47 -03:00
Fijxu
99224b9f60
fix(storyboards): Add HOST_URL to CSP so clients are able to get the storyboards from alternative domains) 2025-02-19 01:10:47 -03:00
Fijxu
e0d4272070
Channels: Fix community tab 2025-02-19 01:10:47 -03:00
Fijxu
33a1473522
docs(readme): update readme with information of this fork 2025-02-19 01:10:47 -03:00
syeopite
d853b9f6dc
Typo
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
2025-02-18 14:46:18 -08:00
Fijxu
d70681538a
Channels: Fix community tab 2025-02-18 19:20:55 -03:00
Fijxu
bbc5913b8d
feat(database): support for either Redis or PostgreSQL for video cache 2025-02-18 18:11:05 -03:00
Fijxu
1df1945849
fix(images.cr): use i.ytimg.com instead of i9.ytimg.com for thumbnails 2025-02-18 16:04:48 -03:00
Fijxu
b08f7ab7ac
chore(template.ecr): Add margin because it looks like shit without a banner 2025-02-18 02:54:49 -03:00
Fijxu
7c91d5f194
ci: update crystal compiler to 1.15.1 2025-02-18 02:43:34 -03:00