Commit Graph

116 Commits

Author SHA1 Message Date
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
syeopite
8a90add310 Ameba: Fix Naming/VariableNames
Fix Naming/VariableNames in comment renderer

Fix Naming/VariableNames in helpers/utils

Fix Naming/VariableNames in api/v1/misc.cr
2024-07-11 20:56:28 -07:00
syeopite
cff25a7b25 Refactor instance fetching logic into separate job 2024-05-22 13:22:00 -07:00
nixos script
0917efd9cb fix issue where scope would be missing the * if the user was not logged in before calling the authorize endpoint
fix #4200
2023-12-21 13:52:19 +08:00
lamemakes
7a569d81ca Updated comment link returns 2023-06-12 09:40:26 -04:00
Samantaz Fox
898066407d Utils: Update 'decode_date' to take into account short "x ago" forms 2023-05-29 12:41:53 +02:00
chunky programmer
1b10446e5e move url parsing to utils method 2023-04-30 18:58:39 -04:00
Samantaz Fox
6c687a3cac Login redirect to referer on logged-in user (#3556) 2023-02-02 21:28:24 +01:00
Brahim Hadriche
01acb9bfbf Login redirect to referer on logged-in user 2023-01-13 19:04:37 -05:00
DUOLabs333
0d3610f63d Change regex used in short_text_to_number 2023-01-04 18:12:15 -05:00
DUOLabs333
85dd3533bb Fix for the ArithmeticOverflow Problem 2023-01-03 20:18:10 -05:00
Samantaz Fox
afc0ec3c30 search: Fix short text parsing 2022-11-20 23:28:21 +01:00
Samantaz Fox
4130136718 Merge pull request #2936 from MathiusD/expand-link
Increase size of links displayed in video description
2022-04-16 20:31:28 +02:00
Féry Mathieu (Mathius)
6c122248f5 Update regex reduce_uri utils
Follow this comment :
https://github.com/iv-org/invidious/pull/2936#discussion_r850712676
2022-04-14 22:42:21 +02:00
Féry Mathieu (Mathius)
0f1bb3fb3b Update reduce_uri signature
Following request_change at :
- https://github.com/iv-org/invidious/pull/2936#discussion_r814436660
2022-02-25 11:47:07 +01:00
Féry Mathieu (Mathius)
78c447829a Increase size of links displayed in video description 2022-02-25 02:11:30 +01:00
Féry Mathieu (Mathius)
555bb711c9 Removal of changes to methods now unrelated to the issue
Unrelated to the issue since the change in management of channel_refresh_interval
Cf this remark : https://github.com/iv-org/invidious/pull/2915#discussion_r811373503
2022-02-22 08:17:50 +01:00
Féry Mathieu (Mathius)
fd0ac3a671 Update management of channel_refresh_interval
Follow indications:
https://github.com/iv-org/invidious/pull/2915#discussion_r811373503
2022-02-22 01:35:35 +01:00
Féry Mathieu (Mathius)
f109d812a1 Move TimeSpanConverter with another Converters
Follow indications :
https://github.com/iv-org/invidious/pull/2915#discussion_r811373953
2022-02-22 01:34:19 +01:00
Féry Mathieu (Mathius)
f75a81c9ee Make configurable time between each RefreshChannelsJob 2022-02-21 10:53:20 +01:00
Dimitris Apostolou
7e4690e43c Fix typos 2022-02-07 14:57:14 +02:00
Samantaz Fox
12b818a83c Fix more 'Lint/ShadowingOuterLocalVar' warnings reported by ameba 2022-01-28 02:19:53 +01:00
Samantaz Fox
692f4e5be2 i18n: Use plurals for year/month/day/etc... 2022-01-10 22:49:07 +01:00
Samantaz Fox
302fecbdcb Clean useless database arguments (5/5) 2022-01-04 17:15:43 +01:00
Samantaz Fox
f54e247eb4 Extractors: Add support for shorts
Fixes #2708
2021-12-17 16:47:41 +01:00
syeopite
c8a985cc77 Merge pull request #2477 from SamantazFox/move-prefs-and-config
Move user preferences and server config
2021-10-18 17:06:07 +00:00
Samantaz Fox
2571e420f3 Move 'add_yt_headers()' to 'connection_pool.cr' 2021-10-18 16:12:18 +02:00
Samantaz Fox
d300797e22 Move the YoutubeConnectionPool code to its own file 2021-10-18 16:12:17 +02:00
Samantaz Fox
080d9a8dc7 move theme converter function to a separate file 2021-10-11 18:33:36 +02:00
syeopite
77131cff91 Use make_client when querying instance api 2021-10-02 15:16:07 +00:00
syeopite
cb525af0a2 Connect to api.invidious.io with https 2021-06-19 04:17:49 -07:00
syeopite
45e57f1ad3 Refactor fetch_random_instance 2021-06-19 04:17:49 -07:00
syeopite
eb911de928 Handle if inst. api is down for rand inst fetch 2021-06-19 04:17:49 -07:00
syeopite
b393e31b76 Fix inst. fetching for inst w/ disabled stats/err 2021-06-19 04:17:49 -07:00
syeopite
173cd7c15e Fix switch invidious instance btn on videos 2021-06-19 04:16:18 -07:00
syeopite
950c8f7104 Enhance fetch_random_instance func
Handle cross-inst. redirect w/ broken health stats

Add check for instance version in cross-redirect
2021-06-19 04:16:18 -07:00
syeopite
311e7684b2 Add instance redirect on empty/broken search 2021-06-19 04:16:18 -07:00
syeopite
5b47438b71 Add helper function to fetch random instance 2021-06-19 04:16:17 -07:00
TheFrenchGhosty
c33ee83d87 Merge pull request #2124 from raycheung/master
Fix storyboard when proxied with an external port
2021-06-19 07:45:33 +00:00
syeopite
065c104f27 Upgrade to crystal 1.0.0 2021-06-08 13:10:58 -07:00
Ray Cheung
ca5d5668d9 Fix storyboard when proxied with an external port
Say if it's `http://host:port` internally and proxied to
`https://domain:external_port`, the storyboard URL was rendered as
`https://domain:port`.
2021-05-29 11:43:39 +08:00
Andrew Zhao
9a8f1a0b0a add option to disable quic 2021-04-14 12:03:31 -04:00
syeopite
20b961c1c8 Preserve original cookies 2021-04-02 17:08:55 -07:00
TheFrenchGhosty
b794c5cfcf Set the request cookie to "YES+" 2021-04-01 15:59:24 +00:00
syeopite
e08bea5f51 Fix lint 2021-03-31 15:34:29 -07:00
syeopite
739f610507 Add new YT consent cookie to every request 2021-03-31 14:57:00 -07:00
saltycrys
5f03a583d1 Update code for Crystal 0.36.0
Rename `HTTPClient@socket` to `HTTPClient@io`, see
https://github.com/crystal-lang/crystal/pull/9543.

Rename `URI#full_path` to `URI#request_target`, see
https://github.com/crystal-lang/crystal/pull/10099.
2021-02-02 20:01:02 +01:00
saltycrys
b45f371911 Make config a constant
Instead of passing around `config` there is now the global `CONFIG`.
2021-01-23 19:39:04 +01:00
Andrew Zhao
e0d25ff887 Close http clients after using
The crystal http client maintains a keepalive connection to the other
server which stays alive for some time. This should be closed if the
client instance is not used again to avoid hogging resources
2020-12-27 19:40:58 -05:00
saltycrys
2de206cb81 Fix comments
The YouTube headers are now always added for requests to YouTube.
Previously they were only added for requests going through QUIC.

The session token is now JSON decoded to unescape escaped Unicode characters.

The comment continuation protobuf has been updated and the request now goes
through the YouTube `pbj` JSON API.
2020-12-06 04:11:41 +01:00