Commit Graph

95 Commits

Author SHA1 Message Date
Samantaz Fox
139786b9ef i18n: pass only the ISO code string to 'translate()'
Don't use the whole Hash everywhere.
Also fall back nicely to english string if no translation exists.
2021-11-21 01:50:11 +01:00
Samantaz Fox
00904ae3f2 Merge pull request #2444 from syeopite/only-use-redirect-endpoint-when-needed
Only use the /redirect endpoint when automatically redirecting to another instance
2021-11-13 20:40:09 +01:00
syeopite
6ec4dcfafd Fix handling for maxres thumbnail 2021-11-12 03:47:58 -08:00
syeopite
48191aca6e Fix copy-paste error 2021-11-12 03:47:57 -08:00
syeopite
83556bace2 Allow thumbnail queries with QUIC disabled 2021-11-12 03:47:57 -08:00
syeopite
814c9e6c3a Use https for storyboard image requests 2021-11-12 03:47:57 -08:00
syeopite
547abe17d9 Use https for ggpht requests 2021-11-12 03:47:57 -08:00
syeopite
6b8450558d Allow storyboard queries with QUIC disabled 2021-11-12 03:47:57 -08:00
syeopite
c3747c2d49 Allow ggpht queries with QUIC disabled 2021-11-12 03:47:57 -08:00
syeopite
245122104a Respect use_quic param and fix typos 2021-11-12 03:47:57 -08:00
syeopite
d379a36c0e Add compile-time flag to remove code for QUIC 2021-11-12 03:47:50 -08:00
Samantaz Fox
6cf0ff6b49 Remove useless auto_generated param from PlaylistVideo#to_xml
given the variables available in this function's context, 'author' and 'ucid'
provide the same data 'self.author' and 'self.ucid', respectively.

Given that fact, the variable `auto_generated` has no impact on the logic of
this function, and hence can be safely removed. this greatly simplifies the
code and makes it perfectly compatible with crystal's calling convention for
'#to_xml' methods.
2021-10-29 16:26:42 +02:00
Samantaz Fox
86f75758a7 Fix 'to_json' in struct PlaylistVideo 2021-10-29 16:26:42 +02:00
Samantaz Fox
33780f1995 Also fix 'to_json' in struct Video 2021-10-29 16:26:35 +02:00
syeopite
bb396a310e Remove unneeded redirect.invidious.io code in /redirect 2021-10-26 16:12:25 -07:00
syeopite
66e7285108 Only use /redirect when automatically redirecting 2021-10-26 16:12:16 -07:00
Samantaz Fox
2b81a82620 Merge pull request #2529 from DmitrySandalov/master
Feature Request: Localization for trending iv-org#331
2021-10-26 23:49:56 +02:00
syeopite
17e481c107 Reduce block verbosity further 2021-10-25 01:14:14 -07:00
syeopite
88ad7c8d8d Update src/invidious/routes/playlists.cr
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
2021-10-25 01:14:09 -07:00
syeopite
1adcac175e Update src/invidious/routes/channels.cr
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
2021-10-25 01:14:09 -07:00
syeopite
dd8c412abc Fix Style/IsAFilter issues 2021-10-25 01:14:08 -07:00
syeopite
e969c1490a Fix Performance/ChainedCallWithNoBang issues 2021-10-25 01:12:26 -07:00
syeopite
e91421253e Fix Style/VerboseBlock issues 2021-10-25 01:12:26 -07:00
syeopite
35d15c7c2b Fix Style/VariableNames issues 2021-10-25 01:12:26 -07:00
syeopite
20cb751ff6 Fix Lint/UnusedArgument issues 2021-10-25 01:12:26 -07:00
syeopite
0614b52f03 Fix Lint/RedundantStringCoercion issues 2021-10-25 01:12:19 -07:00
Dmitry Sandalov
d9c58c4837 Feature Request: Localization for trending iv-org#331 2021-10-21 14:54:15 +03:00
syeopite
888c7e2c29 Merge pull request #2491 from syeopite/extract-image-routes
Extract image routes
2021-10-15 22:13:10 +00:00
Samantaz Fox
678b10dbcf Lookback 50 videos 2021-10-11 23:52:57 +02:00
diogo
a1d6411f1f propagate video_id field on getting playlists 2021-10-11 23:51:07 +02:00
diogo
0a9e19646a pass the api/v1/playlists with videos before the offset 2021-10-11 23:43:41 +02:00
syeopite
4246c7a523 Extract image routes 2021-10-11 13:22:11 -07:00
Samantaz Fox
adc12addfa Add config option to display source code URL in footer (#2450) 2021-10-07 13:53:12 +02:00
syeopite
81b12b8001 Add support to make invidious API-only via flag (#2363) 2021-10-02 20:04:02 +00:00
syeopite
6d68fbc31d Fix livestream regex regression caused by #2271
Closes #2352

Special thanks to @WaywardHeart for finding this issue!
2021-09-25 02:47:52 +00:00
syeopite
4fcd0964cd Extract API routes (#2271)
* Extract API routes from invidious.cr
* Remove deprecated APIs
  - insights
  - top feed
2021-08-30 18:27:47 +02:00
syeopite
5005212bec Extract feed routes (#2269)
* Extract feed routes from invidious.cr
* Removes the deprecated route for /feed/top
* Deprecate /view_all_playlist & use /feed/playlists
* Move feed views into their own directory

* Add haltf method to halt current route context
* Change status_code + return blocks to use haltf

* Set appropriate response headers for RSS routes
2021-08-30 16:58:24 +02:00
syeopite
fceb8093f1 Use athena-negotiation to detect language through Accept-Language header (#2324)
Detect language through Accept-Language header
2021-08-24 19:59:27 +00:00
syeopite
d984a898d4 Remove usage of haltf in /api/v1/channels/:ucid/comments 2021-08-23 17:07:45 -07:00
syeopite
66b45a8fe2 Bountiful changes
- Use haltf in more locations
 - Fix wrong URL params
 - Rename API modules
 - Remove API routing file and move everything to general iv routing
   file
2021-08-23 16:28:30 -07:00
syeopite
39b34eece8 Extract API routes from invidious.cr (3/3)
- Auth (excluding notifications*) APIs
- Mixes

*Notifications currently require the "connection_channel" channel
for talking with the notifications job. Unfortunately, we cannot
access that within the route modules yet.
2021-08-14 00:18:25 -07:00
syeopite
b3426fdc94 Restructure API routes to use more namespaces 2021-08-14 00:18:25 -07:00
syeopite
6aa65593ef Extract API routes from invidious.cr (2/?)
- Video playback endpoints
- Search feed api
- Video info api
2021-08-14 00:18:24 -07:00
syeopite
66becbf46f Restructure API route organisation 2021-08-14 00:18:24 -07:00
syeopite
cbf3d75087 Extract API routes from invidious.cr (1/?) 2021-08-14 00:18:24 -07:00
Émilien Devos
12b46bbd41 switch to innertube API for about channels (#2255) 2021-08-12 16:00:26 -07:00
Émilien Devos
88c5e3b6fa Use the new youtube api for comments (#2217)
* use the new youtube api for comments
* remove PG_DB & action parameter + allow force region
* support new comments data with onResponseReceivedEndpoints
2021-08-12 19:14:30 +02:00
syeopite
7afa027b95 Switch routing logic to use modules (#2298)
* Switch routing logic to use modules
* Add more macros for adding routes of different HTTP methods
2021-08-11 12:36:25 +02:00
syeopite
1321c90920 Extract channel routes (#2227)
* Extract primary channel routes from invidious.cr

Also removes timedtext_video stub since all it does is redirect to the
homepage. However, Invidious's 404 handler already does this.

--
As the template for the channel about page doesn't exist yet, the
behavior for the /channel/:ucid/about endpoint has been changed to be
the same as what's currently present on Invidious

(cherry picked from commit 8fad19d8057d7d22e3de27ebbc88a9978c1df27b)

* Manually extract brand_redirect from 1b569bbc99207cae7c20aa285f42477ae361dd30

This commit manually extracts the brand_redirect function from the
commit mentioned.

However, the redirect to the  `.../about` endpoint is removed due to the
fact that it doesn't exist yet.

This commit is also mainly just a bridge for the next few cherry picks from
\#2215

* Update brand_redirect to use youtubei resolve_url

(cherry picked from commit 53335fe7cfdfac392365b7cac447bc7cc6478134)

* Add additional channel endpoints to brand_redirect

(cherry picked from commit 8fc6f3add637dabb09b2034f4d82fc3d039ba15c)

* Add separate handler for /profile endpoint

* Add /channel/:ucid/home route

* Document all channel brand_urls
2021-08-03 23:46:15 +02:00
syeopite
578bbcd181 Fix raw parameter for videos in listen mode (#2270) 2021-07-28 16:28:09 -07:00