Compare commits

...

118 Commits

Author SHA1 Message Date
broquemonsieur
9ac7173fc7
Merge 0cf71b20a1 into a88a723de3 2024-10-10 14:46:34 +00:00
Samantaz Fox
a88a723de3
Update CHANGELOG.md 2024-10-08 18:36:41 +02:00
Samantaz Fox
d5f5490aee
Search: Fix 'youtu.be' URLs in sanitizer (#4894)
Use the proper URL argument when transforming youtu.be URLs to their
youtube.com equivalents.

Thanks to Tuhgy on the fediverse for reporting this!

No related issue
2024-10-08 18:03:56 +02:00
Samantaz Fox
82d797b74e
Ameba: Disable Style/RedundantNext rule (#4888)
No related issue
2024-10-08 18:02:47 +02:00
Samantaz Fox
97895a491a
Playlists: Fix 'invalid byte sequence' error when subscribing (#4887)
In Crystal, handling multi-byte sequences in UTF-8 requires understanding that
slicing by bytes can lead to invalid sequences if the slicing isn't aligned
with character boundaries. In this case, attempting to slice a string by bytes
can cut through multi-byte UTF-8 sequences, leading to invalid sequences.

To avoid this, strings should be sliced based on characters rather than bytes.

Fixes issue 4886
2024-10-08 18:01:22 +02: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
d3830f7870
Translations update from Hosted Weblate (#4862) 2024-10-08 17:56:39 +02:00
Samantaz Fox
3cfcc16403
Videos: Convert URL before putting result into cache (#4850)
Closes issue 4837
2024-10-08 17:52:34 +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
82ac9a8609
Preferences: Add option to control preloading of video data (#4122)
This PR adds a configuration option to control the preloading of video data on
page load with the HTML5 'preload'[1] attribute on the `<video>` element.

The option is enabled by default, meaning that the `preload` attribute's value
will be 'auto'. If users want to prevent preloading of video data, they
can disable the option, which will set the attribute value to 'none'.

[1](https://www.w3schools.com/tags/att_video_preload.asp)

Closes issue 4110
2024-10-08 17:38:06 +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
f6e09250cd
Use "LIVE" instead of "LIVE NOW" when parsing the live_now video badge
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
2024-10-07 11:30:33 -04:00
Hosted Weblate
0fecde6917
Update Norwegian Bokmål translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Petter Reinholdtsen <pere-weblate@hungry.com>
2024-10-06 16:16:37 +02:00
Hosted Weblate
66f5b12ecd
Update Serbian (Cyrillic script) translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: NEXI <nexiphotographer@gmail.com>
2024-10-06 16:16:37 +02:00
Hosted Weblate
77f57714ea
Update Chinese (Simplified Han script) translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: 大王叫我来巡山 <hamburger2048@users.noreply.hosted.weblate.org>
2024-10-06 16:16:37 +02:00
Hosted Weblate
d9afe38504
Update Chinese (Traditional Han script) translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Jeff Huang <s8321414@gmail.com>
2024-10-06 16:16:36 +02:00
Hosted Weblate
3af11d800c
Update English (United States) translation
Co-authored-by: Dick Groskamp <dikgro@yahoo.co.uk>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:36 +02:00
Hosted Weblate
d72531d843
Update Korean translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: xrfmkrh <rF3nMd7sRKezjF2vcEQo@protonmail.com>
2024-10-06 16:16:35 +02:00
Hosted Weblate
ecfcad8d1c
Update Albanian translation
Co-authored-by: Besnik Bleta <besnik@programeshqip.org>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:35 +02:00
Hosted Weblate
d63b15dc1c
Update Serbian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: NEXI <nexiphotographer@gmail.com>
2024-10-06 16:16:34 +02:00
Hosted Weblate
edb69d601e
Update Persian translation
Co-authored-by: Danial Behzadi <dani.behzi@ubuntu.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:34 +02:00
Hosted Weblate
51562f4b24
Update Swedish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: bittin1ddc447d824349b2 <bittin@reimu.nl>
2024-10-06 16:16:34 +02:00
Hosted Weblate
76f045b8d7
Update French translation
Co-authored-by: ABCraft19 <lesenfantsbergaoui@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:33 +02:00
Hosted Weblate
46eaa0f9b8
Update Spanish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
2024-10-06 16:16:33 +02:00
Hosted Weblate
56bccaba77
Update Dutch translation
Update Dutch translation

Update Dutch translation

Co-authored-by: Dick Groskamp <dikgro@yahoo.co.uk>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:33 +02:00
Hosted Weblate
4e8d03221b
Update Interlingua translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Software In Interlingua <softinterlingua@gmail.com>
2024-10-06 16:16:32 +02:00
Hosted Weblate
5d46eba6f2
Update Arabic translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Rex_sa <rex.sa@pm.me>
2024-10-06 16:16:32 +02:00
Hosted Weblate
d3eedab545
Update Italian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Random <random-r@users.noreply.hosted.weblate.org>
2024-10-06 16:16:31 +02:00
Hosted Weblate
cd43997bba
Update Polish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Matthaiks <kitynska@gmail.com>
2024-10-06 16:16:31 +02:00
Hosted Weblate
fead7603e6
Update Croatian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Milo Ivir <mail@milotype.de>
2024-10-06 16:16:31 +02:00
Hosted Weblate
486b5b363c
Update Icelandic translation
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
2024-10-06 16:16:30 +02:00
Hosted Weblate
2b3619e489
Update Portuguese translation
Co-authored-by: Henrique Oliveira <ho.henrique@proton.me>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:30 +02:00
Hosted Weblate
7a95cb43ef
Update Czech translation
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-10-06 16:16:29 +02:00
Hosted Weblate
e09a7de5c7
Update Japanese translation
Update Japanese translation

Co-authored-by: Himmel <Himmel@users.noreply.hosted.weblate.org>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: maboroshin <maboroshin@users.noreply.hosted.weblate.org>
2024-10-06 16:16:29 +02:00
Hosted Weblate
79d1aaff1a
Update Ukrainian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
2024-10-06 16:16:29 +02:00
Hosted Weblate
d7a5ca8fff
Update Russian translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: lotigara <lotigara@yandex.ru>
2024-10-06 16:16:28 +02:00
Hosted Weblate
542d4fe553
Update Greek translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: hompre <46e989cc@opayq.com>
2024-10-06 16:16:28 +02:00
Hosted Weblate
33df8249f1
Update German translation
Update German translation

Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Lenny Angst <lenny@familie-angst.ch>
2024-10-06 16:16:27 +02:00
Hosted Weblate
4e7fd7ac3b
Update Portuguese (Brazil) translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Jose Delvani <jsdelvani@users.noreply.hosted.weblate.org>
2024-10-06 16:16:27 +02:00
Hosted Weblate
8912e2448d
Update Turkish translation
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
2024-10-06 16:16:26 +02:00
ChunkyProgrammer
98f1e4170b Rename CCommons to ClosedCaptions 2024-09-30 22:02:57 -04:00
ChunkyProgrammer
b384133dc9 Fix tests 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
broquemonsieur
0cf71b20a1
Merge branch 'iv-org:master' into main 2024-09-07 06:20:48 +00:00
Samantaz Fox
5e899d73a9
Search: Fix for youtu.be URL in sanitizer 2024-09-02 18:14:57 +02:00
Thomas Lange
f247b2f862
Update config/config.example.yml
Accept suggested change from @SamantazFox.

Co-authored-by: Samantaz Fox <coding@samantaz.fr>
2024-08-30 19:52:33 +02:00
Dmitry Sandalov
bd34659ff6
Fix 'invalid byte sequence' error when subscribing to playlists ([] accessor with range) 2024-08-29 22:47:59 +02:00
syeopite
f1baeef4bc
Ameba: Disable Style/RedundantNext rule 2024-08-28 23:49:10 -07:00
Dmitry Sandalov
157c4c3e98
Fix 'invalid byte sequence' error when subscribing to playlists 2024-08-28 23:54:31 +02:00
Samantaz Fox
b2133c6b2c
Videos: Convert URL before putting result into cache 2024-08-24 18:01:56 +02:00
broquemonsieur
0bee2e9bea
Merge branch 'iv-org:master' into main 2024-05-31 03:57:22 +00:00
syeopite
9980c0e00f
Update uptime logic to handle updown.io response 2024-05-22 13:28:15 -07:00
syeopite
aa96cf3453
Fix invalid logic for instance uptime comparison 2024-05-22 13:22:00 -07:00
syeopite
41c978d350
Use HTTP::Client directly in instance list job
The HTTP::Client created via `make_client` is affected by the
force_resolve configuration option. However, api.invidious.io
does not support ipv6 and as such any request with ipv6 to
api.invidious.io will instead raise.

Directly calling the HTTP::Client will ignore the force_resolve option
allowing requests to go through ipv4 when needed.
2024-05-22 13:22:00 -07:00
syeopite
cff25a7b25
Refactor instance fetching logic into separate job 2024-05-22 13:22:00 -07:00
tracedgod
5b11ca22d0 Use string interpolation instead of concatenation 2024-04-28 00:04:30 -04:00
tracedgod
6db4a46c5f update the url_search_issues variable to search for the current error on GitHub instead of showing all issues 2024-04-26 16:01:02 -04:00
broquemonsieur
a777695cf3
Merge branch 'iv-org:master' into main 2024-03-23 06:48:52 +00:00
broquemonsieur
870dff4014
Merge branch 'iv-org:master' into main 2024-02-07 06:15:48 +00:00
broquemonsieur
c4e245fc83
Merge branch 'iv-org:master' into main 2024-01-22 02:07:12 +00:00
broquemonsieur
10d8a4b3ca Add new migration 2023-12-29 04:53:28 -08:00
broquemonsieur
22455bbf9e Add new enum 2023-12-29 04:30:31 -08:00
broquemonsieur
a33c01bd53 Fix version number 2023-12-29 04:11:55 -08:00
broquemonsieur
3848e0d6da
Merge branch 'iv-org:master' into main 2023-12-21 05:37:49 +00:00
broquemonsieur
0284d37487
Merge branch 'iv-org:master' into main 2023-12-18 01:58:36 +00:00
broquemonsieur
f02ac49d3a
Merge branch 'iv-org:master' into main 2023-12-06 11:52:19 +00:00
broquemonsieur
7a31ca733d Revert mistake 2023-12-05 00:27:18 -08:00
broquemonsieur
df188c032c Complete the bifurcation of "list" and "comp" 2023-12-03 18:44:07 -08:00
broquemonsieur
379761ab7b Change "list" to "comp" 2023-12-03 17:20:36 -08:00
broquemonsieur
5fdaa1bf57
Merge branch 'iv-org:master' into main 2023-12-03 23:08:57 +00:00
broquemonsieur
3758d225c4 Resolve merge conflict 2023-10-21 14:05:29 -07:00
broquemonsieur
ee5d7f287f
Merge branch 'iv-org:master' into main 2023-10-21 03:56:49 +00:00
broquemonsieur
5cc6b85d29
Merge branch 'iv-org:master' into main 2023-10-15 23:21:24 +00:00
broquemonsieur
fa50e5dff6
Merge branch 'iv-org:master' into main 2023-10-08 17:26:55 +00:00
Thomas Lange
824cc1a5aa Don't redefine the "preload" option in player.js
If the HTML5 "<video>" element defines the "preload" attribute directly,
it isn't necessary to redefine the "preload" option in the player.js.
2023-09-27 15:36:40 +02:00
Thomas Lange
bf470704a5 Add option to control preloading of video data
Fix #4110 by adding an option to control the preloading of video data on
page load. If disabled ("false"), the browser will not preload any video
data until the user explicitly hits the "Play" button.

If enabled ("true"), the default behavior will be used, which means the
browser decides how much of the video will be preloaded.
2023-09-26 22:21:12 +02:00
broquemonsieur
cd3256fcff
Merge branch 'iv-org:master' into main 2023-09-22 02:13:57 +00:00
broquemonsieur
75cc1899cf
Merge branch 'iv-org:master' into main 2023-09-18 00:30:36 +00:00
broquemonsieur
93ac7cdeb4 Run Crystal formatting tool 2023-09-07 23:33:07 -07:00
broquemonsieur
205c5493db Replace EOF carriage returns 2023-09-07 23:33:07 -07:00
broquemonsieur
212509ec60 Revert docker-compose 2023-09-07 23:33:07 -07:00
broquemonsieur
0d968a320f Remove LOGGER statements 2023-09-07 23:33:07 -07:00
broquemonsieur
f7fc05eb67 Remove development-purpose file ignores 2023-09-07 23:33:07 -07:00
broquemonsieur
f48083da33 Add end marker continuation utility 2023-09-07 23:33:07 -07:00
broquemonsieur
510d85c045 Query DB for timestamps after current id 2023-09-07 23:33:07 -07:00
broquemonsieur
472a2d7e76 Use markers to implement timestamps 2023-09-07 23:33:07 -07:00
broquemonsieur
d7a53d0159 Finish vetting changes for autoplay stability 2023-09-07 23:33:01 -07:00
broquemonsieur
f05d38aa8e Prevent autoplay breakage by vetting each change from top to compilation_video.ecr 2023-09-07 23:28:58 -07:00
broquemonsieur
0211d69f11 Enable swap arrows to rearrange order of videos 2023-09-07 23:28:58 -07:00
broquemonsieur
890802481b Use ion for arrow swap icons 2023-09-07 23:28:58 -07:00
broquemonsieur
a8c0023eb0 Debug SQL query for timestamp adjustment 2023-09-07 23:28:58 -07:00
broquemonsieur
ea878e22a1 Debug the DB methods for compilations 2023-09-07 23:28:53 -07:00
broquemonsieur
60a184eda3 Add timestamp DB handling 2023-09-07 23:25:40 -07:00
broquemonsieur
be42dd0a4b Redo conflict resolution 2023-09-07 23:25:32 -07:00
broquemonsieur
da290e5d6f Add timestamps to update compilation POST request 2023-09-07 22:41:53 -07:00
broquemonsieur
ff6a9b965d Make the layout nice for video panels 2023-09-07 22:41:53 -07:00
broquemonsieur
7b757aaf9c Address gitignore persistence 2023-09-07 22:41:53 -07:00
broquemonsieur
b95a4e8432 Use text input for timestamp 2023-09-07 22:41:46 -07:00
broquemonsieur
bfa9f77441 Add margins to video panel elements 2023-09-07 22:37:26 -07:00
broquemonsieur
0e2fefe1e9 Add arrows to change video order 2023-09-07 22:31:46 -07:00
broquemonsieur
2a9789cc1e Add CSS element for compilation video 2023-09-07 22:31:40 -07:00
broquemonsieur
128d541323 Remove compid check for Nil error debugging 2023-09-07 22:18:16 -07:00
broquemonsieur
8c15c1e8cc Add migration table for compilations 2023-09-07 22:18:16 -07:00
broquemonsieur
1d209c422e getcompilation route to routes that are registered 2023-09-07 22:18:11 -07:00
broquemonsieur
7cfa09984e Add compilations to feeds menu 2023-09-07 22:13:19 -07:00
broquemonsieur
ea48239543 Add erc for viewing one compliation 2023-09-07 22:13:19 -07:00
broquemonsieur
74d42c18dd Add ecr for individual compilation items (videos) 2023-09-07 22:13:19 -07:00
broquemonsieur
bac4fd9097 Add create_compilation route and ecr 2023-09-07 22:13:19 -07:00
broquemonsieur
b6181b9d97 Add authenticated API for compilation creation 2023-09-07 22:13:15 -07:00
broquemonsieur
7c92b051b3 Add custom item for CompilationVideo 2023-09-07 22:07:52 -07:00
broquemonsieur
696ca42274 Add structs and DB methods for Compilations 2023-09-02 17:15:10 -07:00
broquemonsieur
6b984c6677 Remove files that were prematurely added and add backend Compilation files 2023-09-02 17:15:10 -07:00
broquemonsieur
bef234fd74 Add compilations to DB 2023-09-02 17:15:10 -07:00
broquemonsieur
24f55a7876 Add backend Compilation symbols 2023-09-02 17:15:10 -07:00
broquemonsieur
d0a3c994f4 Add Compilation symbols until "Compilations" appears in feeds menu 2023-09-02 17:15:10 -07:00
broquemonsieur
5fb47c5e9e add Compilation symbols 2023-09-02 17:15:10 -07:00
broquemonsieur
8aff1d0409 Create compilations file 2023-09-02 17:15:10 -07:00
83 changed files with 2755 additions and 275 deletions

View File

@ -38,6 +38,9 @@ Style/RedundantBegin:
Style/RedundantReturn:
Enabled: false
Style/RedundantNext:
Enabled: false
Style/ParenthesesAroundCondition:
Enabled: false

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/invidious
/sentry
/config/config.yml
.DS_Store

View File

@ -1,5 +1,39 @@
# CHANGELOG
## vX.Y.0 (future)
### Full list of pull requests merged since the last release (newest first)
* Search: Fix 'youtu.be' URLs in sanitizer ([#4894], by @SamantazFox)
* Ameba: Disable Style/RedundantNext rule ([#4888], thanks @syeopite)
* Playlists: Fix 'invalid byte sequence' error when subscribing ([#4887], thanks @DmitrySandalov)
* Parse more metadata badges for SearchVideos ([#4863], thanks @ChunkyProgrammer)
* Translations update from Hosted Weblate ([#4862], thanks to our many translators)
* Videos: Convert URL before putting result into cache ([#4850], by @SamantazFox)
* HTML: Add error message to "search issues on GitHub" link ([#4652], thanks @tracedgod)
* Preferences: Add option to control preloading of video data ([#4122], thanks @Nerdmind)
* Performance: Improve speed of automatic instance redirection ([#4193], thanks @syeopite)
* Remove myself from CODEOWNERS on the config file ([#4942], by @TheFrenchGhosty)
* Update latest version WEB_CREATOR + fix comment web embed ([#4930], thanks @unixfox)
* use WEB_CREATOR when po_token with WEB_EMBED as a fallback ([#4928], thanks @unixfox)
* Revert "use web screen embed for fixing potoken functionality"
* use web screen embed for fixing potoken functionality ([#4923], thanks @unixfox)
[#4122]: https://github.com/iv-org/invidious/pull/4122
[#4193]: https://github.com/iv-org/invidious/pull/4193
[#4652]: https://github.com/iv-org/invidious/pull/4652
[#4850]: https://github.com/iv-org/invidious/pull/4850
[#4862]: https://github.com/iv-org/invidious/pull/4862
[#4863]: https://github.com/iv-org/invidious/pull/4863
[#4887]: https://github.com/iv-org/invidious/pull/4887
[#4888]: https://github.com/iv-org/invidious/pull/4888
[#4894]: https://github.com/iv-org/invidious/pull/4894
[#4923]: https://github.com/iv-org/invidious/pull/4923
[#4928]: https://github.com/iv-org/invidious/pull/4928
[#4930]: https://github.com/iv-org/invidious/pull/4930
[#4942]: https://github.com/iv-org/invidious/pull/4942
## v2.20240825.2 (2024-08-26)

View File

@ -814,5 +814,67 @@ h1, h2, h3, h4, h5, p,
}
#download_widget {
width: 100%;
width: 100%;
}
/*
* Compilations
*/
input.compilation-video-timestamp {
width: 50px;
height: 20px;
}
div.compilation-video-panel {
display:flex;
justify-content:flex-start;
width:calc(100% - 20px);
height:100px;
border:2px solid #ccc;
margin: 10px;
/*background: #d9d9d9;*/
}
div.compilation-order-swap-arrows {
display:flex;
flex-direction:column;
justify-content:space-between;
}
svg.compilation-video-swap-arrow {
border: solid black;
width:20px;
height:50%;
background-color: beige;
margin: 10px;
}
div.compilation-video-input-panel {
display:flex;
flex-direction:column;
min-width: 0;
margin: 10px;
}
div.compilation-video-title {
display:flex;
justify-content:flex-start;
}
span.compilation-video-title {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
div.compilation-video-timestamp-set {
display:flex;
justify-content: flex-start;
align-items: center;
}
div.compilation-video-thumbnail {
position: relative;
box-sizing: border-box;
}

View File

@ -0,0 +1,63 @@
'use strict';
var compilation_data = JSON.parse(document.getElementById('compilation_data').textContent);
var payload = 'csrf_token=' + compilation_data.csrf_token;
function add_compilation_video(target) {
var select = target.parentNode.children[0].children[1];
var option = select.children[select.selectedIndex];
var url = '/compilation_ajax?action_add_video=1&redirect=false' +
'&video_id=' + target.getAttribute('data-id') +
'&compilation_id=' + option.getAttribute('data-compid');
helpers.xhr('POST', url, {payload: payload}, {
on200: function (response) {
option.textContent = '✓' + option.textContent;
}
});
}
function add_compilation_item(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
tile.style.display = 'none';
var url = '/compilation_ajax?action_add_video=1&redirect=false' +
'&video_id=' + target.getAttribute('data-id') +
'&compilation_id=' + target.getAttribute('data-compid');
helpers.xhr('POST', url, {payload: payload}, {
onNon200: function (xhr) {
tile.style.display = '';
}
});
}
function remove_compilation_item(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
tile.style.display = 'none';
var url = '/compilation_ajax?action_remove_video=1&redirect=false' +
'&set_video_id=' + target.getAttribute('data-index') +
'&compilation_id=' + target.getAttribute('data-compid');
helpers.xhr('POST', url, {payload: payload}, {
onNon200: function (xhr) {
tile.style.display = '';
}
});
}
function move_compilation_video_before(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
tile.style.display = 'none';
var url = '/compilation_ajax?action_move_video_before=1&redirect=false' +
'&set_video_id=' + target.getAttribute('data-index') +
'&compilation_id=' + target.getAttribute('data-compid');
helpers.xhr('POST', url, {payload: payload}, {
onNon200: function (xhr) {
tile.style.display = '';
}
});
}

View File

@ -1,6 +1,39 @@
'use strict';
var video_data = JSON.parse(document.getElementById('video_data').textContent);
function get_compilation(compid) {
var compid_url;
compid_url = '/api/v1/compilations/' + compid +
'?index=' + video_data.index +
'&continuation' + video_data.id +
'&format=html&hl=' + video_data.preferences.locale;
helpers.xhr('GET', compid_url, {retries: 5, entity_name: 'compilation'}, {
on200: function (response) {
if (!response.nextVideo)
return;
player.on('ended', function () {
var url = new URL('https://example.com/embed/' + response.nextVideo);
url.searchParams.set('comp', compid);
if (!compid.startsWith('RD'))
url.searchParams.set('index', response.index);
if (video_data.params.autoplay || video_data.params.continue_autoplay)
url.searchParams.set('autoplay', '1');
if (video_data.params.listen !== video_data.preferences.listen)
url.searchParams.set('listen', video_data.params.listen);
if (video_data.params.speed !== video_data.preferences.speed)
url.searchParams.set('speed', video_data.params.speed);
if (video_data.params.local !== video_data.preferences.local)
url.searchParams.set('local', video_data.params.local);
location.assign(url.pathname + url.search);
});
}
});
}
function get_playlist(plid) {
var plid_url;
if (plid.startsWith('RD')) {
@ -43,6 +76,8 @@ function get_playlist(plid) {
addEventListener('load', function (e) {
if (video_data.plid) {
get_playlist(video_data.plid);
} else if (video_data.compid) {
get_compilation(video_data.compid)
} else if (video_data.video_series) {
player.on('ended', function () {
var url = new URL('https://example.com/embed/' + video_data.video_series.shift());

View File

@ -60,12 +60,21 @@
document.querySelectorAll('[data-onclick="add_playlist_video"]').forEach(function (el) {
el.onclick = function () { add_playlist_video(el); };
});
document.querySelectorAll('[data-onclick="add_compilation_video"]').forEach(function (el) {
el.onclick = function () { add_compilation_video(el); };
});
document.querySelectorAll('[data-onclick="add_playlist_item"]').forEach(function (el) {
el.onclick = function () { add_playlist_item(el); };
});
document.querySelectorAll('[data-onclick="add_compilation_item"]').forEach(function (el) {
el.onclick = function () { add_compilation_item(el); };
});
document.querySelectorAll('[data-onclick="remove_playlist_item"]').forEach(function (el) {
el.onclick = function () { remove_playlist_item(el); };
});
document.querySelectorAll('[data-onclick="remove_compilation_item"]').forEach(function (el) {
el.onclick = function () { remove_compilation_item(el); };
});
document.querySelectorAll('[data-onclick="revoke_token"]').forEach(function (el) {
el.onclick = function () { revoke_token(el); };
});

View File

@ -3,7 +3,6 @@ var player_data = JSON.parse(document.getElementById('player_data').textContent)
var video_data = JSON.parse(document.getElementById('video_data').textContent);
var options = {
preload: 'auto',
liveui: true,
playbackRates: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0],
controlBar: {
@ -255,8 +254,13 @@ if (video_data.params.video_start > 0 || video_data.params.video_end > 0) {
player.markers({
onMarkerReached: function (marker) {
if (marker.text === 'End')
player.loop() ? player.markers.prev('Start') : player.pause();
if (marker.text === 'End') {
if (video_data.ending_timestamp_seconds) {
player.currentTime(player.duration());
} else {
player.loop() ? player.markers.prev('Start') : player.pause();
}
}
},
markers: markers
});

View File

@ -50,6 +50,59 @@ function continue_autoplay(event) {
}
}
function get_compilation(compid) {
var compilation = document.getElementById('compilation');
compilation.innerHTML = spinnerHTMLwithHR;
var compid_url;
compid_url = '/api/v1/compilations/' + compid +
'?index=' + video_data.index +
'&continuation=' + video_data.id +
'&format=html&hl=' + video_data.preferences.locale;
helpers.xhr('GET', compid_url, {retries: 5, entity_name: 'compilation'}, {
on200: function (response) {
compilation.innerHTML = response.compilationHtml;
if (!response.nextVideo) return;
var nextVideo = document.getElementById(response.nextVideo);
nextVideo.parentNode.parentNode.scrollTop = nextVideo.offsetTop;
player.on('ended', function () {
var url = new URL('https://example.com/watch?v=' + response.nextVideo);
url.searchParams.set('comp', compid);
if (!compid.startsWith('RD'))
url.searchParams.set('index', response.index);
if (video_data.params.autoplay || video_data.params.continue_autoplay)
url.searchParams.set('autoplay', '1');
if (video_data.params.listen !== video_data.preferences.listen)
url.searchParams.set('listen', video_data.params.listen);
if (video_data.params.speed !== video_data.preferences.speed)
url.searchParams.set('speed', video_data.params.speed);
if (video_data.params.local !== video_data.preferences.local)
url.searchParams.set('local', video_data.params.local);
url.searchParams.set('t',video_data.starting_timestamp_seconds);
url.searchParams.set('end',video_data.ending_timestamp_seconds);
location.assign(url.pathname + url.search);
});
},
onNon200: function (xhr) {
compilation.innerHTML = '';
document.getElementById('continue').style.display = '';
},
onError: function (xhr) {
compilation.innerHTML = spinnerHTMLwithHR;
},
onTimeout: function (xhr) {
compilation.innerHTML = spinnerHTMLwithHR;
}
});
}
function get_playlist(plid) {
var playlist = document.getElementById('playlist');
@ -177,7 +230,8 @@ if (video_data.play_next) {
addEventListener('load', function (e) {
if (video_data.plid)
get_playlist(video_data.plid);
if (video_data.compid)
get_compilation(video_data.compid);
if (video_data.params.comments[0] === 'youtube') {
get_youtube_comments();
} else if (video_data.params.comments[0] === 'reddit') {

View File

@ -485,6 +485,14 @@ hmac_key: "CHANGE_ME!!"
##
#playlist_length_limit: 500
##
## Maximum custom compilation length limit.
##
## Accepted values: Integer
## Default: 500
##
#compilation_length_limit: 500
#########################################
#
# Default user preferences
@ -707,6 +715,22 @@ default_user_preferences:
# Video player behavior
# -----------------------------
##
## This option controls the value of the HTML5 <video> element's
## "preload" attribute.
##
## If set to 'false', no video data will be loaded until the user
## explicitly starts the video by clicking the "Play" button.
## If set to 'true', the web browser will buffer some video data
## while the page is loading.
##
## See: https://www.w3schools.com/tags/att_video_preload.asp
##
## Accepted values: true, false
## Default: true
##
#preload: true
##
## Automatically play videos on page load.
##

View File

@ -0,0 +1,21 @@
-- Table: public.compilation_videos
-- DROP TABLE public.compilation_videos;
CREATE TABLE IF NOT EXISTS public.compilation_videos
(
title text,
id text,
author text,
ucid text,
length_seconds integer,
starting_timestamp_seconds integer,
ending_timestamp_seconds integer,
published timestamptz,
compid text references compilations(id),
index int8,
order_index integer,
PRIMARY KEY (index,compid)
);
GRANT ALL ON TABLE public.compilation_videos TO current_user;

View File

@ -0,0 +1,31 @@
-- Type: public.compilation_privacy
-- DROP TYPE public.compilation_privacy;
CREATE TYPE public.compilation_privacy AS ENUM
(
'Unlisted',
'Private'
);
-- Table: public.compilations
-- DROP TABLE public.compilations;
CREATE TABLE IF NOT EXISTS public.compilations
(
title text,
id text primary key,
author text,
description text,
video_count integer,
created timestamptz,
updated timestamptz,
privacy compilation_privacy,
index int8[],
first_video_id text,
first_video_starting_timestamp_seconds integer,
first_video_ending_timestamp_seconds integer
);
GRANT ALL ON public.compilations TO current_user;

View File

@ -10,3 +10,5 @@ psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/nonces.sql
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/annotations.sql
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/playlists.sql
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/playlist_videos.sql
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/compilations.sql
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/compilation_videos.sql

View File

@ -483,7 +483,7 @@
"comments_view_x_replies_3": "عرض رد {{count}}",
"comments_view_x_replies_4": "عرض الردود {{count}}",
"comments_view_x_replies_5": "عرض رد {{count}}",
"search_message_use_another_instance": " يمكنك أيضًا البحث عن <a href=\"`x`\"> في مثيل آخر </a>.",
"search_message_use_another_instance": "يمكنك أيضًا البحث عن <a href=\"`x`\"> في مثيل آخر </a>.",
"comments_points_count_0": "{{count}} نقطة",
"comments_points_count_1": "نقطة واحدة",
"comments_points_count_2": "نقطتان",

View File

@ -471,7 +471,7 @@
"search_filters_title": "Filtry",
"search_filters_duration_option_medium": "Střední (4 - 20 minut)",
"search_filters_duration_option_long": "Dlouhá (> 20 minut)",
"search_message_use_another_instance": " Můžete také <a href=\"`x`\">hledat na jiné instanci</a>.",
"search_message_use_another_instance": "Můžete také <a href=\"`x`\">hledat na jiné instanci</a>.",
"search_filters_features_label": "Vlastnosti",
"search_filters_features_option_three_sixty": "360°",
"search_filters_features_option_vr180": "VR180",

View File

@ -47,6 +47,7 @@
"Preferences": "Einstellungen",
"preferences_category_player": "Wiedergabeeinstellungen",
"preferences_video_loop_label": "Immer wiederholen: ",
"preferences_preload_label": "Videodaten vorladen: ",
"preferences_autoplay_label": "Automatisch abspielen: ",
"preferences_continue_label": "Immer automatisch nächstes Video abspielen: ",
"preferences_continue_autoplay_label": "Nächstes Video automatisch abspielen: ",
@ -322,7 +323,7 @@
"channel_tab_community_label": "Gemeinschaft",
"search_filters_sort_option_relevance": "Relevanz",
"search_filters_sort_option_rating": "Bewertung",
"search_filters_sort_option_date": "Datum",
"search_filters_sort_option_date": "Hochladedatum",
"search_filters_sort_option_views": "Aufrufe",
"search_filters_type_label": "Inhaltstyp",
"search_filters_duration_label": "Dauer",
@ -454,7 +455,7 @@
"Portuguese (auto-generated)": "Portugiesisch (automatisch generiert)",
"search_filters_title": "Filtern",
"search_message_change_filters_or_query": "Versuchen Sie, Ihre Suchanfrage zu erweitern und/oder die Filter zu ändern.",
"search_message_use_another_instance": " Sie können auch <a href=\"`x`\">auf einer anderen Instanz suchen</a>.",
"search_message_use_another_instance": "Sie können auch <a href=\"`x`\">auf einer anderen Instanz suchen</a>.",
"Popular enabled: ": "„Beliebt“-Seite aktiviert: ",
"search_message_no_results": "Keine Ergebnisse gefunden.",
"search_filters_duration_option_medium": "Mittel (4 - 20 Minuten)",
@ -493,5 +494,8 @@
"Add to playlist": "Einer Wiedergabeliste hinzufügen",
"Search for videos": "Nach Videos suchen",
"toggle_theme": "Thema wechseln",
"Add to playlist: ": "Einer Wiedergabeliste hinzufügen: "
"Add to playlist: ": "Einer Wiedergabeliste hinzufügen: ",
"carousel_go_to": "Zu Folie `x` gehen",
"carousel_slide": "Folie {{current}} von {{total}}",
"carousel_skip": "Karussell überspringen"
}

View File

@ -489,5 +489,10 @@
"search_filters_date_label": "Ημερομηνία αναφόρτωσης",
"Search for videos": "Αναζήτηση βίντεο",
"The Popular feed has been disabled by the administrator.": "Η δημοφιλής ροή έχει απενεργοποιηθεί από τον διαχειριστή.",
"Answer": "Απάντηση"
"Answer": "Απάντηση",
"Add to playlist": "Λίιστα αναπαραγωγής",
"Add to playlist: ": "Λίστα αναπαραγωγής: ",
"carousel_slide": "Εικόνα {{current}}απο {{total}}",
"carousel_go_to": "Πήγαινε στην εικόνα`x`",
"toggle_theme": "Αλλαγή θέματος"
}

View File

@ -71,6 +71,7 @@
"Preferences": "Preferences",
"preferences_category_player": "Player preferences",
"preferences_video_loop_label": "Always loop: ",
"preferences_preload_label": "Preload video data: ",
"preferences_autoplay_label": "Autoplay: ",
"preferences_continue_label": "Play next by default: ",
"preferences_continue_autoplay_label": "Autoplay next video: ",
@ -180,17 +181,22 @@
"Delete playlist `x`?": "Delete playlist `x`?",
"Delete playlist": "Delete playlist",
"Create playlist": "Create playlist",
"Create compilation": "Create compilation",
"Title": "Title",
"Playlist privacy": "Playlist privacy",
"Compilation privacy": "Compilation privacy",
"Editing playlist `x`": "Editing playlist `x`",
"Editing compilation `x`": "Editing compilation `x`",
"playlist_button_add_items": "Add videos",
"compilation_button_add_items": "Add videos",
"compilation_button_play": "Play",
"Show more": "Show more",
"Show less": "Show less",
"Watch on YouTube": "Watch on YouTube",
"Switch Invidious Instance": "Switch Invidious Instance",
"search_message_no_results": "No results found.",
"search_message_change_filters_or_query": "Try widening your search query and/or changing the filters.",
"search_message_use_another_instance": " You can also <a href=\"`x`\">search on another instance</a>.",
"search_message_use_another_instance": "You can also <a href=\"`x`\">search on another instance</a>.",
"Hide annotations": "Hide annotations",
"Show annotations": "Show annotations",
"Genre: ": "Genre: ",
@ -245,6 +251,7 @@
"Not a playlist.": "Not a playlist.",
"Playlist does not exist.": "Playlist does not exist.",
"Could not pull trending pages.": "Could not pull trending pages.",
"Compilation does not exist.": "Compilation does not exist.",
"Hidden field \"challenge\" is a required field": "Hidden field \"challenge\" is a required field",
"Hidden field \"token\" is a required field": "Hidden field \"token\" is a required field",
"Erroneous challenge": "Erroneous challenge",
@ -419,10 +426,11 @@
"Audio mode": "Audio mode",
"Video mode": "Video mode",
"Playlists": "Playlists",
"Compilations": "Compilations",
"search_filters_title": "Filters",
"search_filters_date_label": "Upload date",
"search_filters_date_option_none": "Any date",
"search_filters_date_option_hour": "Last Hour",
"search_filters_date_option_hour": "Last hour",
"search_filters_date_option_today": "Today",
"search_filters_date_option_week": "This week",
"search_filters_date_option_month": "This month",
@ -454,7 +462,7 @@
"search_filters_sort_label": "Sort By",
"search_filters_sort_option_relevance": "Relevance",
"search_filters_sort_option_rating": "Rating",
"search_filters_sort_option_date": "Upload Date",
"search_filters_sort_option_date": "Upload date",
"search_filters_sort_option_views": "View count",
"search_filters_apply_button": "Apply selected filters",
"Current version: ": "Current version: ",
@ -475,6 +483,7 @@
"download_subtitles": "Subtitles - `x` (.vtt)",
"user_created_playlists": "`x` created playlists",
"user_saved_playlists": "`x` saved playlists",
"user_created_compilations": "`x` created compilations",
"Video unavailable": "Video unavailable",
"preferences_save_player_pos_label": "Save playback position: ",
"crash_page_you_found_a_bug": "It looks like you found a bug in Invidious!",

View File

@ -478,7 +478,7 @@
"tokens_count_0": "{{count}} token",
"tokens_count_1": "{{count}} tokens",
"tokens_count_2": "{{count}} tokens",
"search_message_use_another_instance": " También puede <a href=\"`x`\">buscar en otra instancia</a>.",
"search_message_use_another_instance": "También puedes <a href=\"`x`\">buscar en otra instancia</a>.",
"Popular enabled: ": "¿Habilitar la sección popular? ",
"error_video_not_in_playlist": "El video que solicitaste no existe en esta lista de reproducción. <a href=\"`x`\">Haz clic aquí para acceder a la página de inicio de la lista de reproducción.</a>",
"channel_tab_streams_label": "Directos",

View File

@ -360,7 +360,7 @@
"search_filters_duration_label": "مدت",
"search_filters_features_label": "ویژگی‌ها",
"search_filters_sort_label": "به ترتیب",
"search_filters_date_option_hour": "یک ساعت گذشته",
"search_filters_date_option_hour": "ساعت گذشته",
"search_filters_date_option_today": "امروز",
"search_filters_date_option_week": "این هفته",
"search_filters_date_option_month": "این ماه",
@ -461,7 +461,7 @@
"Song: ": "آهنگ: ",
"Channel Sponsor": "اسپانسر کانال",
"Standard YouTube license": "پروانه استاندارد YouTube",
"search_message_use_another_instance": " شما همچنین می‌توانید <a href=\"`x`\">در نمونه دیگر هم جستجو کنید</a>.",
"search_message_use_another_instance": "همچنین می‌توانید <a href=\"`x`\">در نمونه‌ای دیگر هم جست‌وجو کنید</a>.",
"Download is disabled": "دریافت غیرفعال است",
"crash_page_before_reporting": "پیش از گزارش ایراد، مطمئنید شوید که:",
"playlist_button_add_items": "افزودن ویدیو",

View File

@ -484,7 +484,7 @@
"search_filters_duration_option_medium": "Moyenne (de 4 à 20 minutes)",
"search_filters_apply_button": "Appliquer les filtres",
"search_message_no_results": "Aucun résultat.",
"search_message_use_another_instance": " Vous pouvez également <a href=\"`x`\">effectuer votre recherche sur une autre instance</a>.",
"search_message_use_another_instance": "Vous pouvez également <a href=\"`x`\">effectuer votre recherche sur une autre instance</a>.",
"search_filters_type_option_all": "Tous les types",
"search_filters_date_label": "Date d'ajout",
"search_filters_features_option_vr180": "VR180",

View File

@ -449,30 +449,30 @@
"Cantonese (Hong Kong)": "Kantonski (Hong Kong)",
"Chinese": "Kineski",
"Chinese (Taiwan)": "Kineski (Tajvan)",
"Dutch (auto-generated)": "Nizozemski (automatski generiran)",
"French (auto-generated)": "Francuski (automatski generiran)",
"Indonesian (auto-generated)": "Indonezijski (automatski generiran)",
"Dutch (auto-generated)": "Nizozemski (automatski generirano)",
"French (auto-generated)": "Francuski (automatski generirano)",
"Indonesian (auto-generated)": "Indonezijski (automatski generirano)",
"Interlingue": "Interlingua",
"Japanese (auto-generated)": "Japanski (automatski generiran)",
"Russian (auto-generated)": "Ruski (automatski generiran)",
"Turkish (auto-generated)": "Turski (automatski generiran)",
"Vietnamese (auto-generated)": "Vijetnamski (automatski generiran)",
"Japanese (auto-generated)": "Japanski (automatski generirano)",
"Russian (auto-generated)": "Ruski (automatski generirano)",
"Turkish (auto-generated)": "Turski (automatski generirano)",
"Vietnamese (auto-generated)": "Vijetnamski (automatski generirano)",
"Spanish (Spain)": "Španjolski (Španjolska)",
"Italian (auto-generated)": "Talijanski (automatski generiran)",
"Italian (auto-generated)": "Talijanski (automatski generirano)",
"Portuguese (Brazil)": "Portugalski (Brazil)",
"Spanish (Mexico)": "Španjolski (Meksiko)",
"German (auto-generated)": "Njemački (automatski generiran)",
"German (auto-generated)": "Njemački (automatski generirano)",
"Chinese (China)": "Kineski (Kina)",
"Chinese (Hong Kong)": "Kineski (Hong Kong)",
"Korean (auto-generated)": "Korejski (automatski generiran)",
"Portuguese (auto-generated)": "Portugalski (automatski generiran)",
"Spanish (auto-generated)": "Španjolski (automatski generiran)",
"Korean (auto-generated)": "Korejski (automatski generirano)",
"Portuguese (auto-generated)": "Portugalski (automatski generirano)",
"Spanish (auto-generated)": "Španjolski (automatski generirano)",
"preferences_watch_history_label": "Aktiviraj povijest gledanja: ",
"search_filters_title": "Filtri",
"search_filters_date_option_none": "Bilo koji datum",
"search_filters_date_label": "Datum prijenosa",
"search_message_no_results": "Nema rezultata.",
"search_message_use_another_instance": " Također možeš <a href=\"`x`\">tražiti na jednoj drugoj instanci</a>.",
"search_message_use_another_instance": "Također možeš <a href=\"`x`\">tražiti na jednoj drugoj instanci</a>.",
"search_message_change_filters_or_query": "Pokušaj proširiti upit za pretragu i/ili promijeni filtre.",
"search_filters_features_option_vr180": "VR180",
"search_filters_duration_option_none": "Bilo koje duljine",

View File

@ -7,7 +7,7 @@
"invidious": "Invidious",
"Image CAPTCHA": "Imagine CAPTCHA",
"newest": "plus nove",
"generic_button_save": "Salvar",
"generic_button_save": "Salveguardar",
"Dark mode: ": "Modo obscur: ",
"preferences_dark_mode_label": "Thema: ",
"preferences_category_subscription": "Preferentias de subscription",
@ -23,7 +23,7 @@
"light": "clar",
"No": "Non",
"youtube": "YouTube",
"LIVE": "IN DIRECTE",
"LIVE": "IN DIRECTO",
"reddit": "Reddit",
"preferences_category_player": "Preferentias de reproductor",
"Preferences": "Preferentias",