Commit Graph

568 Commits

Author SHA1 Message Date
syeopite
a9180aa6c1 fix: do not strip '+' character from referer (#5276) 2025-05-17 16:18:15 -07:00
syeopite
d5cb653fd1 Handle parse errors gracefully on timeline items (#5196) 2025-05-17 16:16:20 -07:00
syeopite
df41cb9588 Update Kemal to 1.6.0 and remove Kilt (#5120) 2025-05-17 16:14:40 -07:00
Fijxu
35896d086b fix: do not strip '+' character from referer
Fix that a user of my instance (https://inv.nadeko.net) sent me by email.
2025-05-08 01:00:46 -04:00
syeopite
6c063436d4 Fix issues raised by code review
Remove explicit `self.` from #process of parsers

Remove explicit return tuple in get_issue_template

Fix formatting

Move inline issue template style to stylesheet

Use @id in ProblematicTimelineItem xml repr

Fix naming
2025-04-05 12:40:38 -07:00
syeopite
7b27585454 Support ProblematicTimelineItem in trending feed 2025-03-19 23:50:41 -07:00
syeopite
f7810ba007 Use ProblematicTimelineItem as needed in playlists 2025-03-19 23:32:46 -07:00
syeopite
0e0a95430a Improve JSON repr of ProblematicTimelineItem 2025-03-19 22:52:03 -07:00
syeopite
9de69c0052 Improve design of placeholder item
Also makes it show the error backtrace
2025-03-19 22:52:03 -07:00
syeopite
94cb80ea81 Handle parse errors gracefully on timeline items
Prior to this commit, if even a single item fails to parse Invidious
will throw out an error. This means that even if everything else
on a page can be parsed and rendered without issues, the single
problematic item will cause the entire page to be unusable.

This commit gracefully handles parse errors by catching and then
replacing the problematic item with a new "timeline error" object
that represents the parse error. This will allow the rest of the page
to be rendered and an error card that will replace the location of the
problematic item.
2025-03-19 22:52:03 -07: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
74dfda150e i18n: Enable Tamil 2025-02-26 14:02:57 -08:00
syeopite
05c5448bc1 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-01-29 11:49:45 -08:00
syeopite
086c6209ab Remove stdlib override for proxy initialization (#5065) 2025-01-22 11:33:20 -08:00
syeopite
0d398c9d1a API: Add support for author thumbnails in search api for videos (#5072) 2025-01-22 11:32:21 -08:00
syeopite
dc38bcdf17 Kemal: Skip route if response was closed by handlers (#5073) 2025-01-22 11:30:45 -08:00
syeopite
e1378702af Apply upcoming formatting rules from Crystal 1.15 2025-01-20 16:15:13 -08:00
syeopite
7a15318fbc Skip route if resp got closed by before handlers 2024-11-10 05:45:06 +00:00
ChunkyProgrammer
5fa87cc27c Add support for author thumbnails in search api for videos 2024-11-09 22:31:41 -05:00
syeopite
1333fed26c Remove stdlib override for proxy initialization
HTTP Proxy is now initialized in the make_client function
2024-11-08 15:28:12 -08: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
a760b69cb6 Logger: Add color support for different log levels (#4931)
No related issue
2024-11-08 23:28:51 +01:00
Samantaz Fox
75c5881c55 Locales: Add Bulgarian, Welsh and Lombard to the list 2024-10-31 13:34:51 +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
f326bcf8db Add support for using Invidious through a HTTP Proxy (#4270)
Partially addresses issue 301
2024-10-30 13:46:49 +01:00
Fijxu
84e4746265 SigHelper: Reconnect to signature helper
Signed-off-by: Fijxu <fijxu@nadeko.net>
2024-10-08 19:09:14 -03:00
Fijxu
d2edd4b63f fixup! Logger: Add color support for different log levels 2024-10-08 18:36:50 -03: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
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
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
ChunkyProgrammer
98f1e4170b Rename CCommons to ClosedCaptions 2024-09-30 22:02:57 -04:00
ChunkyProgrammer
1961fc3b11 switch to enum flag instead of adding lots of properties to SearchVideo 2024-09-30 22:02:57 -04:00
ChunkyProgrammer
2e649363d2 Parse more metadata badges for SearchVideos 2024-09-30 22:02:57 -04:00
Fijxu
d77afdcf00 Logger: Make colorize_logs true by default 2024-09-20 00:32:27 -03:00
Fijxu
f8ec312328 Logger: Add color support for different log levels 2024-09-19 21:35:52 -03:00
Samantaz Fox
15669acccf SigHelper: Fix inverted time comparison in 'check_update' (#4845)
Closes issue 4840
2024-08-24 20:44:52 +02:00
syeopite
f66068976e Ameba: Fix Naming/PredicateName 2024-08-21 02:43:08 -07:00
Samantaz Fox
466bfbb306 SigHelper: Fix inverted time comparison in 'check_update' 2024-08-14 21:43:37 +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
Samantaz Fox
5e38ef59da Ameba: Fix Lint/UselessAssign (#4795)
Related to issue 2231
2024-08-11 13:38:29 +02:00
Samantaz Fox
80ffc442f2 HTML: Add rel="noreferrer noopener" to external links (#4667)
Note: Does not add rel="noreferrer noopener" to:
 * links in channel description
 * links in video descriptions
 * links in video comments

Related to issue 4267
2024-08-11 13:35:57 +02:00
Samantaz Fox
9bf754ed4f Remove unused methods in Invidious::LogHandler (#4812)
Closes issue 4791
2024-08-11 11:45:56 +02:00
Samantaz Fox
cc36a82933 SigHelper: Fix some logic errors raised during code review 2024-08-07 23:26:10 +02:00
Samantaz Fox
7798faf234 SigHelper: Make signature server optional and configurable 2024-08-07 23:25:35 +02:00
Samantaz Fox
ec1bb5db87 SigHelper: Add support for PLAYER_UPDATE_TIMESTAMP opcode 2024-08-07 23:25:32 +02:00
Samantaz Fox
3b7e45b7bc SigHelper: Small fixes + suggestions from code review 2024-08-07 23:12:38 +02:00
syeopite
e098c27a45 Remove unused methods in Invidious::LogHandler 2024-07-28 16:44:30 -07:00
syeopite
6506b8dbfc Ameba: Fix Naming/PredicateName 2024-07-25 20:08:26 -07:00
Samantaz Fox
61d75050e4 SigHelper: Use 'URI.parse' instead of 'URI.new'
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-07-25 22:13:08 +02:00