Commit Graph

3397 Commits

Author SHA1 Message Date
TheFrenchGhosty
4b014bdc82 Enable the Uzbek since it's been translated at more than 20% (#5891) 2026-08-03 23:03:45 +02:00
Émilien (perso)
1a3cb60282 feat: add support for SOCKS5 proxy (#5865) 2026-08-03 22:43:18 +02:00
Fijxu
cb88a805e5 feat: allow setting videojs max buffer length via config.yml (#5876) 2026-08-03 15:52:50 -04:00
Fijxu
b4b6e992fc fix: fix rendered links and timestamps in video descriptions (#5878)
* Revert "Fix disappearing end of the comments with emoji (#5587)"

This reverts commit 86c425b43f.

* fix: fix rendered links and timestamps in video descriptions
2026-08-03 15:43:50 -04:00
Fijxu
9c70265a9a fix: add missing HTML.escape call for commit 4501c9d 2026-08-03 15:24:47 -04:00
syeopite
4501c9df9c Show message when comments are turned off (#4051)
* Add error message when comments are disabled

* Add btn to try reddit comments when yt is disabled

* Escape warning messages for disabled comments

* Add missing semicolons

* Update comment detection to not use msg renderer

* Use short syntax for comment entry-point detection

Co-authored-by: Samantaz Fox <coding@samantaz.fr>

* Condense try-reddit-comments-link HTML in player.js

Co-authored-by: Samantaz Fox <coding@samantaz.fr>

* Improve locale keys for comments disabled messages

Co-authored-by: Samantaz Fox <coding@samantaz.fr>

* Remove extra whitespace

* Use button instead of anchor for try reddit link

* Request Reddit comm when yt disabled during nojs=1

* Change order of commentsEnabled in parse results

* Lint

* Rebase error

* update the naming of the comments section in Innertube

Downstreamed from 36ac67610d

---------

Co-authored-by: Samantaz Fox <coding@samantaz.fr>
Co-authored-by: Fijxu <fijxu@nadeko.net>
2026-08-03 15:18:13 -04:00
TheFrenchGhosty
986471320d Enable the new locales translated at more than 20% (#5882)
* Enable the new locales translated at more than 20%

* Align all the comments on column 43
2026-08-03 19:34:57 +02:00
Fijxu
47b5d79ec7 fix: also fix comments community posts. (#5874)
Community posts comments still preserve the old author thumbnails
format that has an Array of thumbnails. I forgot to check that as I had
no idea `comments_youtube.cr` was also used for community posts comments

```json
"authorThumbnail": {
    "thumbnails": [
        {
            "url": "//yt3.googleusercontent.com/ytc/AIdro_m9CJFVl3bEWvGnNnN4G9ErBO2lTpKePWCjx_FQtLWaDww=s32-c-k-c0x00ffffff-no-rj-mo",
            "width": 32,
            "height": 32
        },
        {
            "url": "//yt3.googleusercontent.com/ytc/AIdro_m9CJFVl3bEWvGnNnN4G9ErBO2lTpKePWCjx_FQtLWaDww=s48-c-k-c0x00ffffff-no-rj-mo",
            "width": 48,
            "height": 48
        },
        {
            "url": "//yt3.googleusercontent.com/ytc/AIdro_m9CJFVl3bEWvGnNnN4G9ErBO2lTpKePWCjx_FQtLWaDww=s76-c-k-c0x00ffffff-no-rj-mo",
            "width": 76,
            "height": 76
        }
    ],
    "accessibility": {
        "accessibilityData": {
            "label": "SomeOrdinaryGamers"
        }
    }
},
```
2026-08-02 21:09:15 -04:00
Fijxu
21a3434850 fix: skip non comment commentFilterContextViewModel key in comments (#5870)
Some YouTube videos like https://www.youtube.com/watch?v=Ajkr_Wg-k8g
had an non comment key that was inside the Array that contained some
comment information that Invidious parses (like comment_key and
toolbar_key), that being the `commentFilterContextViewModel` key, which
is just an indicator on how comments are sorted:

```
{
    "commentThreadRenderer": { ... } <- comment information that is
    handled by line 134 of youtube.cr
},
{
    "commentFilterContextViewModel": {
        "text": {
            "content": "Top is selected, so you'll see featured comments"
        },
        "accessibility": {
            "accessibilityData": {
                "label": "Top is selected, so you'll see featured comments"
            }
        }
    } <- Useless information, this is not a comment
}
```
2026-08-02 16:20:43 -04:00
Fijxu
51dd4fefd0 fix: fix comments html rendering (#5862)
Now the structure no longer has an array of author thumbnails, is a
single URL:

```json
"author": {
    "channelId": "UCiLGHgWdQvfl1G8BPgcO55w",
    "displayName": "@uber_nerd-l7r",
    "avatarThumbnailUrl": "https://yt3.ggpht.com/ee1_iFgiBvgKHUr3r0_qUVqUpGKhDZaePYq8Q4tIsyVS9L1oRHHJLcHtXrSxyS63AmvldKicbw=s88-c-k-c0x00ffffff-no-rj",
    "isVerified": false,
    "isCurrentUser": false,
    "isCreator": false,
```
2026-08-02 03:48:25 -04:00
Fijxu
40378a2dc0 Fix lint and formatting 2026-08-01 21:29:31 -04:00
gabe4278
adfec7646b Hotfix - Fix YouTube change(#5818)
Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com>
2026-07-23 06:04:24 +02:00
bunchy7ss
30c0656a93 Hotfix - Fix YouTube change (#5819)
Credit to https://git.miningtcup.me/MiningTcup
2026-07-23 05:57:07 +02:00
absidue
9e8d102c94 Fix videos being incorrectly labelled as isUpcoming = true (#5800) 2026-07-11 07:33:23 +02:00
Fijxu
9c62c8b660 Add option to disable easy to abuse API endpoints (#5630)
* Add option to disable easy to abuse API endpoints

The API endpoints that will be disabled when this option are:
 - /api/v1/videos
 - /api/v1/clips
 - /api/v1/transcripts

There is still API endponts that need some sort of validation or
connection/proxying to Invidious companion like
`/api/v1/captions` and `/api/v1/storyboards` since they also do a video
request to Invidious companion. I'm not sure if the `/next` API endpoint
could be used to gather that type of information, if so, that would be
better.

Closes #5599

* Rename configuration variable, add additional comment for the option
2026-06-30 11:55:47 +02:00
unrealtournament
d61dd7205c [RefreshChannelsJob] Reduce backoff if no errors occur (#5759)
* [RefreshChannelsJob] Reduce backoff if no errors occur

* Change log level for backoff decrease
2026-06-30 10:29:03 +02:00
Émilien (perso)
77ad41678b fix: security issue playlist deletion cross user (#5790)
fixes #5777
2026-06-30 10:28:51 +02:00
Fijxu
ab099e46cf chore: update User-Agent header for Youtube requests (#5794) 2026-06-30 10:28:26 +02:00
Fijxu
08f862292a fix: fix playlists not showing any videos due to outdated playlist parsing (#5774)
* TODO, CHANGE COMMIT MESSAGE WHEN DONE

* save

* fix: fix playlists videos parsing

* revert text

* do not shadow outer item variable
2026-06-24 23:54:34 -04:00
Fijxu
c435dc1204 fix: fix private invidious playlists on rss feeds from being fetched without authentication (#5776) 2026-06-14 22:31:22 -04:00
Jan Moesen
6dec63a3e5 Use “www.youtube.com” consistently (#5768)
Saves an unnecessary redirect by using `www.youtube.com` on some parts of Invidious where `youtube.com` was used instead. youtube.com will redirect to www.youtube.com anyways.

Co-authored-by: janmoesen <@>
2026-06-09 16:25:27 -04:00
Fijxu
98f4f118b2 Add support for alternative domains for Invidious cookies (#5647)
* Add support for alternative domains for Invidious cookies

* check if @@secure is already true before changing it's value

* Add alternative_domains config option example
2026-06-04 19:59:32 -04:00
Fijxu
85534a988d Only include '&' if params are present (#5646) 2026-06-03 18:18:57 -04:00
Fijxu
e96ad036ca fix: Do not append query params quality=medium to videos that are about to premiere (#5755)
* fix: Do not append query params `quality=medium` to videos that are about to premiere

Video premieres do not have `audio_streams` and they aren't `video.live_now == true` either,
therefore we skip the checks that are made for older videos (`if audio_streams.empty? && !video.live_now` closure)
if the video is a premiere.

This commit also adds the `microformat` field to the `info` instance
variable of the `Video` struct, since it's needed for the function
`Video#premiere_timestamp : Time?`. This is more like a quick fix than a
proper fix because in `Invidious::Videos::Parser#parse_video_info`,
`premiere_timestamp` is gathered from the `microformat` JSON Object but
is used to set the `published` hash key for the `params` variable.

The parsers and structs really need a rework :/

* Revert "fix: Do not append query params `quality=medium` to videos that are about to premiere"

This reverts commit 5cfc8dace8.

* chore: build premiere_timestamp using video_type and published time
2026-05-30 15:49:21 -04:00
Fijxu
3a35552a66 fix: fix wrong call to I18n.translate() function 2026-05-29 23:51:34 -04:00
Fijxu
8ef5ea03d4 feat: Add support for POST requests on searches for privacy (#5551)
Use already set preferences variable

Use span for description, grammar fix from Copilot
2026-05-29 23:48:11 -04:00
shiny-comic
86c425b43f Fix disappearing end of the comments with emoji (#5587)
Previous code use UTF-8 to count characters however Emojis are UTF-16 units.
This difference leads to misalignment of index offsets.

Co-authored-by: shiny-comic <shiny-comic@winPC>
2026-05-28 16:51:06 -04:00
Fijxu
4ae227ce91 Encapsulate videos parser and clip functions inside it's own Invidious::Videos::Parser and Invidious::Videos::Clip module (#5745)
Part of https://github.com/iv-org/invidious/issues/5744
2026-05-28 13:11:41 -04:00
Fijxu
8b183caa2a fix: fix author verification in channels (#5751)
* fix author verification in channels

Fixes https://github.com/iv-org/invidious/issues/5730

Author verification badge is not longer located in
`c4TabbedHeaderRenderer`. It may be deprecated.

* Also detect AUDIO_BADGE for verified author
2026-05-28 13:10:58 -04:00
Fijxu
edb3a0fc36 Add support for /pl_c and /tvfilm_banner paths (thumbnails used in some playlists) (#5742)
* feat: add support for /pl_c/ images

This path can be found on Podcast images.

* add support for /pl_c and /tvfilm_banner paths

* add support for /pl_c and /tvfilm_banner paths 2

* remove leftover comment
2026-05-26 18:13:51 -04:00
Fijxu
6659cbbbd8 fix: fix channel videos and playlists on searches (#5736)
* fix: fix channel videos and playlists on searches

Channel videos are now encapsulated in a `lockupViewModel`.

There is 3 types of content that can be inside a `lockupViewModel`:

- LOCKUP_CONTENT_TYPE_VIDEO
- LOCKUP_CONTENT_TYPE_PLAYLIST
- LOCKUP_CONTENT_TYPE_PODCAST

This commit parses `LOCKUP_CONTENT_TYPE_VIDEO`, `LOCKUP_CONTENT_TYPE_PLAYLIST`, `LOCKUP_CONTENT_TYPE_PODCAST` types
to fix videos in channels, playlists in channels, podcast in channels, and other parts of Invidious were playlists and videos are displayed.

* remove unused variable `author_verified`

* fix parsing for podcasts

For some reason, Podcasts contains an empty JSON Object that we have to
skip, therefore we just iterate metadataRows until finding metadataParts
since metadataRows will not always contain a single Object.

* fix length_seconds for channel videos

* fix playlists parsing for playlists without metadataParts

On some channels like MrBeast, metadataParts is absent, missing the
author information, this is intended behaviour by Youtube since there is
no author information attached to them.

Example URL: https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA/playlists

* restore author_verified functionality

* more robust metadata_parts parsing

Videos that have two or more authors (in collaborations), have their
author information in JSON Objects inside metadataParts, alongside with
their view count and their published date, therefore, we need to iterate
the metadataParts array and do some filtering based on the content of
each JSON Object to find the view count and published date for some
videos.

Example:

```json
"metadataParts": [
    {
        "text": {
            "content": "Veritasium"
        },
        "icon": {
            "name": "CHECK_CIRCLE_FILLED",
            "height": 14,
            "width": 14,
            "accessibilityLabel": "Verified"
        }
    },
    {
        "text": {
            "content": "and Linus Tech Tips"
        },
        "icon": {
            "name": "CHECK_CIRCLE_FILLED",
            "height": 14,
            "width": 14,
            "accessibilityLabel": "Verified"
        }
    },
    {
        "text": {
            "content": "10M"
        },
        "accessibilityLabel": "10 million views"
    },
    {
        "text": {
            "content": "1y ago"
        }
    }
]
```

* improve playlist metadataRows and metadataParts parsing for channel playlists

* apply ameba suggestion

* Also parse lessons for playlists that are a course
2026-05-26 17:46:32 -04:00
Fijxu
99390d065d fix: fix Missing hash key: "collectionThumbnailViewModel" for channel video thumbnails (#5725)
Now the Innertube structure doesn't include `collectionThumbnailViewModel`
and `primaryThumbnail` keys.

Now the structure looks like this:
```
"horizontalListRenderer": {
    "items": [
        {
            "lockupViewModel": {
                "contentImage": {
                    "thumbnailViewModel": {
                        "image": {
                            "sources": []
...
```

Fixes: https://github.com/iv-org/invidious/issues/5516
2026-05-20 21:36:50 -04:00
Fijxu
529fc8a8a3 fix: restore referrerpolicy for embed youtube link that got removed in commit bc64cd9 2026-05-12 23:13:37 -04:00
Fijxu
9eda6e5bc4 chore: lint api/v1/channels.cr (#5693) 2026-04-25 16:57:45 -04:00
Fijxu
73c749f13f Encapsulate helpers constants and functions inside it's own Helpers module (#5639)
It encapsulates all related code from helpers.cr into it's own module.
2026-04-25 16:57:33 -04:00
Fijxu
bc64cd9b67 Encapsulate translation constants and functions inside it's own module (#5637)
It encapsulates all related code from translation into it's own module.

Required for the migration to the crystal stdlib logger: https://github.com/iv-org/invidious/pull/5426
2026-04-25 16:55:55 -04:00
ChunkyProgrammer
606467c693 Playlists: fix parsing error when some videos are paid for in a course (#5207)
* Playlists: fix parsing error when some videos are paid for in a course

* Remove redundant casting to string

fix rebase error

Co-Authored-By: syeopite <70992037+syeopite@users.noreply.github.com>

* Fix rebase issues

---------

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2026-04-09 14:52:03 +02:00
Ashley :3
21d0d1041a Remove noreferrer since youtube now requires referrers on embeds (#5642)
* Remove noreferer since youtube now requires referers on embeds

* Update src/invidious/views/watch.ecr

---------

Co-authored-by: Fijxu <fijxu@nadeko.net>
2026-02-23 21:36:12 -03:00
Fijxu
fda8d1b528 Remove trailing whitespaces from codebase (#5634)
Removes trailing whitespaces found across the codebase using `find . -type f -exec grep -lE ' +$' {} +`

[skip ci]
2026-02-19 14:28:22 -03:00
Jeroen Boersma
e7f8b15b21 Add title listen button time updates (#5625)
When switching between Listen and Watching the timestamp in the url of
the listen of watch button is now updated automatically.

This means if you switch between listening and viewing you keep in sync
with time.
2026-02-16 16:39:44 -03:00
Fijxu
60c31e3069 Remove sort by rating and date in video search filters (#5629)
* Remove sort by rating and date in video search filters

Closes https://github.com/iv-org/invidious/issues/5626

* Remove check of protobug generation of rating and date sort filters in Invidious spec
2026-02-16 14:06:06 -03:00
Fijxu
29c29f7c8d Update src/invidious/routes/routes.cr
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-06 18:50:36 +01:00
Fijxu
067a426235 refactor: Move top level constants to it's own modules 2026-02-06 18:50:36 +01:00
Samantaz Fox
ffd9f4b112 pages/watch: HTML escape 'action' in download widget
Caught in the review of PR 5224, but forgot to click on "send review" in time.
I realized that too late, after the PR was already merged.
2026-02-06 18:44:37 +01:00
Fijxu
0ee92e3298 Update src/invidious/routes/before_all.cr
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-06 18:35:20 +01:00
Fijxu
a3a97ccf07 Only generate companion CSP one time to reuse it 2026-02-06 18:35:20 +01:00
ThatMatrix
ce9494133d fix(user/imports.cr): double header removal caused first video to be skipped 2026-02-06 18:33:58 +01:00
ThatMatrix
e4beb00413 fix(user/imports.cr): splitting error fixed 2026-02-06 18:33:58 +01:00
ThatMatrix
471857ce8b Fix(user/importers): Fixed typos 2026-02-06 18:33:58 +01:00
ThatMatrix
7be6fbd75c Fix(user/importers): Fixed youtube csv playlist importer 2026-02-06 18:33:58 +01:00