307 Commits

Author SHA1 Message Date
Omar Roth
e56129111a Update CHANGELOG and bump version 2019-11-05 23:38:49 -05:00
Omar Roth
0e1d6aa85c Update error messages for video extractor 2019-11-05 19:39:11 -05:00
Omar Roth
bcdb8cd770 Fix default fo dark_mode 2019-11-04 17:08:13 -05:00
Omar Roth
7b2ca55089 Fix escaping in email query 2019-11-04 12:26:05 -05:00
Omar Roth
f6ef0b684a Fix word-break for links in channel RSS 2019-11-03 08:53:16 -05:00
Omar Roth
02e1cdf210 Add support for '/yts/img' endpoint 2019-11-01 12:02:38 -04:00
Omar Roth
b58950c574 Fix decoding for channel playlists extractor 2019-11-01 12:00:59 -04:00
Omar Roth
833a60f29c Update pubsub to use client pool 2019-11-01 07:34:36 -04:00
Omar Roth
f776d67c03 Update sed replace in Dockerfile 2019-10-28 12:49:03 -04:00
Omar Roth
13e7cca1a4 Bump read timeout 2019-10-28 12:34:50 -04:00
Omar Roth
0f3c477ff3 Remove dependency on ImageMagick (replace with rsvg-convert) 2019-10-28 10:49:05 -04:00
Omar Roth
039cc30c07 Fix host replace in Dockerfile 2019-10-28 10:45:22 -04:00
Omar Roth
25c8cd9246 Fix escaping for search params 2019-10-28 06:17:39 -04:00
Omar Roth
c58841100a Fix extractor for channel community cursor 2019-10-27 21:44:17 -04:00
Omar Roth
03e24cccd0 Add support for configurable administrator email 2019-10-27 14:18:07 -04:00
Omar Roth
35f011758d Merge pull request #850 from XVnNzb2kFEhV9Tjm/master
Add Japanese translations
2019-10-27 14:09:31 -04:00
Omar Roth
2ebfaf76f2 Refactor continuation token handling 2019-10-27 13:50:42 -04:00
Omar Roth
0cf187dee7 Add support for image captcha in Google login 2019-10-27 00:19:05 -04:00
Omar Roth
bdeb325bad Fix monkeypatch for HTTP::Client 2019-10-26 11:51:23 -04:00
Omar Roth
a1225b6d0d Sanitize input to decode_length_seconds 2019-10-26 10:17:25 -04:00
XVnNzb2kFEhV9Tjm
f0368b02c4 Add Japanese translations 2019-10-26 18:34:25 +09:00
Omar Roth
202de1436d Fix broken connections in pool 2019-10-25 23:06:08 -04:00
Omar Roth
7f8746fcd4 Remove invalid connections from pool 2019-10-25 22:40:53 -04:00
Omar Roth
e05a25d701 Vary user-agent 2019-10-25 18:02:33 -04:00
Omar Roth
6930570fa2 Add HTTPClient pool 2019-10-25 12:58:16 -04:00
Omar Roth
aba2c5b938 Remove code for /api/v1/insights 2019-10-25 12:25:57 -04:00
Tommy
d82f86dcd9 Update entrypoint.postgres.sh (#843)
* Update entrypoint.postgres.sh
2019-10-22 07:37:26 -04:00
Omar Roth
159b4f9734 Format source 2019-10-21 21:40:03 -04:00
Omar Roth
46a737c7a1 Skip deleted videos in playlist 2019-10-21 19:00:56 -04:00
Omar Roth
a731486ab7 Fix typo in locale regex 2019-10-21 11:11:29 -04:00
Omar Roth
c3e57f1fdd Fix typo in footer 2019-10-20 23:02:16 -04:00
Omar Roth
a9af484412 Merge pull request #839 from TheFrenchGhosty/crypto
Add protocol to the cryptocurrencies
2019-10-20 22:39:24 -04:00
Omar Roth
007646774e Fix typo in English locale 2019-10-20 21:01:27 -04:00
Omar Roth
2d78e35e16 Fix typo in syncing user preferences 2019-10-20 20:58:50 -04:00
Omar Roth
7524b5e349 Move feed_menu and default_home into user preferences 2019-10-20 20:43:33 -04:00
Omar Roth
2a04a48b89 Fix redirect for livestreams 2019-10-20 12:48:55 -04:00
TheFrenchGhosty
3cbdaab81e Add protocol to the cryptocurrencies 2019-10-19 20:23:27 +02:00
Omar Roth
8c858a5953 Merge pull request #829 from l10n-tw/translation
Update zh_TW translations.
2019-10-19 13:14:33 -04:00
TheFrenchGhosty
1812958106 French Translation updated, custom playlists update, enhancements and corrections (#830)
* French Translation updated, custom playlists update and corrections
2019-10-19 13:13:49 -04:00
Omar Roth
4e5324916c Merge pull request #836 from EsmailELBoBDev2/master
Update ar.json
2019-10-19 13:12:58 -04:00
Esmail EL BoB
1a77becc6a Update ar.json 2019-10-18 17:22:45 +00:00
Omar Roth
23ccaea2ff Fix comment event listener 2019-10-18 12:44:11 -04:00
Omar Roth
2a4b252a9d Only force resolve for www.youtube.com 2019-10-18 12:41:03 -04:00
Jeff Huang
9ae4edfee5 Update zh_TW translations. 2019-10-17 08:48:34 +08:00
Omar Roth
bf48809b61 Allow unlisted playlists to be viewed from /api/v1/playlists/ 2019-10-16 08:21:26 -04:00
Omar Roth
57a80a3c10 Add missing text to locales 2019-10-15 22:52:11 -04:00
Omar Roth
3f3e52d7ae Fix indexId for created playlist video 2019-10-15 22:09:01 -04:00
Omar Roth
5c69110658 Merge pull request #673 from omarroth/add-playlists
Add initial support for custom playlists
2019-10-15 21:29:34 -04:00
Omar Roth
be055d9dcb Add support for custom playlists 2019-10-15 21:17:14 -04:00
Omar Roth
1e34a61911 Fix white-space for RSS feeds 2019-10-14 21:07:07 -04:00
Omar Roth
97bd1da2a2 Remove SSL redirect 2019-10-14 21:07:07 -04:00
Omar Roth
330ffb803f Remove invalid source map directive for videojs-quality-selector 2019-10-14 21:07:07 -04:00
Omar Roth
7b77f200be Merge pull request #817 from TheFrenchGhosty/master
French Translation updated - Rewording and corrections
2019-10-13 17:34:45 -05:00
TheFrenchGhosty
15a3c8408f Assume feed means subscriptions feed 2019-10-12 23:15:53 +02:00
TheFrenchGhosty
bc1784ed2b French Translation updated, rewording and corrections 2019-10-12 23:11:40 +02:00
Omar Roth
55f0a82249 Remove Patreon links 2019-10-12 10:07:18 -04:00
Omar Roth
7aada3f328 Avoid override for X-Client headers 2019-10-10 23:45:46 -04:00
Omar Roth
dad885c051 Add YouTube-Client headers to HTTP requests 2019-10-10 22:03:39 -04:00
Omar Roth
f5c7bbfda8 Add support for zh-TW translation 2019-10-09 10:23:26 -04:00
ButterflyOfFire
f832743009 Update Arabic translation 2019-10-09 16:22:39 +02:00
Omar Roth
7551de6439 Merge pull request #791 from l10n-tw/translation
Add zh-TW translations.
2019-10-09 10:22:34 -04:00
Omar Roth
e03b4b7505 Hide scrollbar for player menus 2019-10-05 11:51:31 -04:00
Omar Roth
2d59fdd178 Fix default value for empty description 2019-10-04 17:04:43 -04:00
Omar Roth
e61c8046f4 Fix z-index, scrollbar in player 2019-10-04 12:50:44 -04:00
Omar Roth
c0796ac3d6 Add description to RSS body 2019-10-04 12:50:22 -04:00
Omar Roth
68be24ffc6 Refactor process_video_params 2019-10-04 12:23:28 -04:00
Omar Roth
9dcc87c705 Refactor storyboard generation 2019-10-04 10:26:02 -04:00
Omar Roth
d36c536107 Merge pull request #792 from delightfulagony/master
Fixed bug that made the whole 'Invidious' home link div clickable. Solves #691
2019-10-04 10:25:10 -04:00
agony
affeeb39de Fixed bug that made the whole 'Invidious' div clickable. Solves #691 2019-10-02 14:05:58 +02:00
Jeff Huang
f5d8a952f2 Add zh-TW translations. 2019-10-02 16:28:25 +08:00
Omar Roth
da07f99d3d Bump supported Crystal version 2019-09-30 15:36:54 -04:00
Omar Roth
eef66de68c Merge pull request #743 from girst/rssparams
Forward query string parameters from Atom feeds
2019-09-30 15:36:35 -04:00
girst
4aa1180fce Forward parameters given in &params= from Atom feeds
Any parameters given in &params=... are appended to /watch URLs.  This
allows e.g. passing &raw=1&listen=1 to a playlist of music and use an
rss reader like newsboat as a media player, like so:

    https://invidio.us/feed/playlist/XXX?params=%26raw%3D1%listen%3D1

All three feeds--channels, playlists, subscriptions--are supported.
2019-09-30 17:48:13 +02:00
Omar Roth
553d52a45e Update silvermine quality selector 2019-09-26 17:11:10 -04:00
Omar Roth
347b153884 Merge pull request #765 from leonklingele/docker-travis-warnings
docker,travis: fail build on any warning
2019-09-24 20:51:12 -04:00
Omar Roth
1e7c176481 Merge pull request #766 from leonklingele/travis-shallow-clone
travis: unshallowly clone Git repo
2019-09-24 20:50:48 -04:00
Omar Roth
e390405d0c Update privacy policy 2019-09-24 20:47:49 -04:00
Leon Klingele
7378a84c96 travis: unshallowly clone Git repo
This fixes a compilation error if too many commits were made after the
most recent tag:

    fatal: No names found, cannot describe anything.
    In src/invidious.cr:60:19
      60 | CURRENT_VERSION = {{ "#{`git describe --tags --abbrev=0`.strip}" }}
    Error: expanding macro

See https://travis-ci.org/leonklingele/invidious/jobs/588672881#L275-L290.
2019-09-25 01:23:12 +02:00
Leon Klingele
b25013c4a2 docker,travis: fail build on any warning 2019-09-25 01:22:51 +02:00
Omar Roth
6942916f13 Merge remote-tracking branch 'weblate/master' 2019-09-24 13:48:49 -04:00
Omar Roth
f69f0b97f5 Add fix for index out of bounds during high load 2019-09-24 13:38:50 -04:00
Omar Roth
4361ea9686 Update DB calls for 0.31.0 2019-09-24 13:38:50 -04:00
Omar Roth
be2ee33273 Fix overflow for player controls 2019-09-24 13:38:50 -04:00
Omar Roth
8c2ddb0255 Add config options for host binding and port 2019-09-24 13:38:50 -04:00
Omar Roth
466a5a932b Add support for Turkish translation 2019-09-24 13:38:50 -04:00
Oguz Ersen
8a3c6382e9 Add Turkish translation 2019-09-24 13:38:46 -04:00
Oguz Ersen
a2b45120c5 Update Turkish translation 2019-09-24 19:31:37 +02:00
Oguz Ersen
546ad52e11 Add Turkish translation 2019-09-24 19:31:37 +02:00
leonklingele
1aefc5b540 Update to Crystal 0.31.0, resolve compiler deprecation warnings, update dependencies (#764)
* shard: update to crystal 0.31.0

Additionally, no longer use the Crystal "markdown" library which has
been removed from the Crystal stdlib in version 0.31.0.
See https://github.com/crystal-lang/crystal/pull/8115.

Also fix some deprecation warnings using the following commands:

    find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.escape/URI\.encode_www_form/g' "{}" \;
    find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.unescape/URI\.decode_www_form/g' "{}" \;
    sed -i 's/while \%pull\.kind \!\= \:end_object/until \%pull\.kind\.end_object\?/g' src/invidious/helpers/patch_mapping.cr
2019-09-24 13:31:33 -04:00
Omar Roth
1085ca4a2d Fix typo in Google login 2019-09-22 09:54:54 -04:00
Omar Roth
9766322e99 Update videojs-quality-selector 2019-09-21 22:22:20 -04:00
Omar Roth
cfb68e3bff Add additional handling for unplayable videos 2019-09-21 20:06:08 -04:00
Omar Roth
a006963fb8 Update Google login 2019-09-21 20:06:08 -04:00
Omar Roth
24c95c27c3 Merge pull request #752 from gnomus/master
[Fix][Docker] Update Package Repository for Install
2019-09-14 10:05:35 -04:00
gnomus
3c40c0be6b Update Package Repository for Install 2019-09-13 15:06:44 +02:00
Omar Roth
b1fc80b79a Update sub_count extractor 2019-09-12 21:09:23 -04:00
Omar Roth
50d793e49b Hide video count for auto-generated channels 2019-09-12 13:11:21 -04:00
Omar Roth
34c43b8349 Add support for abbreviated sub count in search 2019-09-12 13:06:27 -04:00
Omar Roth
7002a316fd Filter movies from recommended videos 2019-09-12 13:06:10 -04:00
Omar Roth
1f37faad42 Fix plurilzation regex 2019-09-09 18:09:21 -04:00
Omar Roth
68cf24d100 Add support for channel redirects 2019-09-08 12:08:59 -04:00
Omar Roth
86491da253 Fix map for recommended videos 2019-09-07 21:56:33 -04:00
Omar Roth
90249cdafa Fix extractor for short_view_count_text 2019-09-07 20:09:08 -04:00
Omar Roth
7c75111c41 Refactor error handling for API endpoints 2019-09-05 14:12:14 -04:00
Omar Roth
7b53b6bfef Shrink continuation cursor for YouTube comments 2019-09-04 15:47:27 -04:00
Jorge Maldonado Ventura
fded5fd900 Update Spanish translation 2019-09-03 21:10:49 -04:00
Swann Martinet
950965bd4a Update French translation 2019-09-03 21:10:49 -04:00
Swann Martinet
3a359319fa Update German translation 2019-09-03 21:10:49 -04:00
Allan Nordhøy
d3dd82c699 Update Norwegian Bokmål translation 2019-09-03 21:10:49 -04:00
Jorge Maldonado Ventura
81f192bccb Update Esperanto translation 2019-09-03 21:10:49 -04:00
ButterflyOfFire
60a23febed Update Arabic translation 2019-09-03 21:10:48 -04:00
Esmail EL BoB
d0e280cbac Update ar.json (#728)
* Update ar.json
2019-09-03 21:04:04 -04:00
unbranched
ecb62c8659 Italian translation update (#724)
* Italian translation update
2019-09-03 21:02:53 -04:00
Omar Roth
12669df92b Merge pull request #729 from Infinisil/migrate
Provide db user in migrate-db-3646395.sh
2019-09-01 17:30:22 -04:00
Omar Roth
44b2afeffa Merge pull request #675 from Dragnucs/patch-1
Add Postgres health check
2019-09-01 09:53:04 -04:00
Omar Roth
70f435e909 Fix nillable for recommendedVideos 2019-08-31 16:24:13 -04:00
Omar Roth
512d82071e Fix invalid viewCountText in related videos 2019-08-31 15:58:38 -04:00
Omar Roth
3896230199 Fix type cast for viewCount 2019-08-31 01:11:45 -04:00
tleydxdy
b902880a05 fix docker build (#734) 2019-08-31 01:11:25 -04:00
Silvan Mosberger
418526af16 Provide db user in migrate-db-3646395.sh 2019-08-29 02:25:15 +02:00
Omar Roth
45ad212459 Handle redirects in /videoplayback 2019-08-27 09:53:44 -05:00
Omar Roth
0f49d424d3 Refactor search params 2019-08-27 09:35:15 -05:00
Omar Roth
01e42c8d6f Flatten viewCountText 2019-08-27 08:52:22 -05:00
Omar Roth
26107bd6c3 Minor refactor 2019-08-27 08:08:26 -05:00
Omar Roth
7d3ecd2297 Bump JS/CSS dependencies 2019-08-27 08:01:33 -05:00
Omar Roth
16056661dd Update recommended videos extractor 2019-08-27 08:00:04 -05:00
Omar Roth
059f50dad4 Add 'playlistThumbnail' to playlist objects 2019-08-21 19:08:11 -05:00
Omar Roth
4c9975a7d9 Use accurate sub count when available 2019-08-21 18:35:54 -05:00
Omar Roth
9f9cc1ffb5 Refactor search extractor 2019-08-21 18:23:20 -05:00
Omar Roth
e768e1e277 Fix allowed_regions for globally blocked videos 2019-08-19 10:16:11 -05:00
leonklingele
acaf7b969a js: add support to detect alt, meta and control key in keydown handler (#704)
This fixes a quite severe user experience issue where pressing the
'alt', 'meta' and/or 'ctrl' key along with one of the supported keys
(e.g. 'f' to enter video fullscreen mode) would overwrite the default
browser behavior. In the case of 'f+meta' we would enter fullscreen
mode, and not open the browser search panel as one might expect.

This change is required to stay consistent with the way YouTube
handles keydown events.
2019-08-18 23:22:39 -05:00
Omar Roth
2b94975345 Fix playlist_thumbnail extractor 2019-08-16 20:06:21 -05:00
leonklingele
e6b4e12689 js: add support for keydown events (#678)
* js: add support for keydown events

This will modify the player behavior even if the player element is unfocused.

Based on the YouTube key bindings, allow to

- toggle playback with space and 'k' key
- increase and decrease player volume with up / down arrow key
- mute and unmute player with 'm' key
- jump forwards and backwards by 5 seconds with right / left arrow key
- jump forwards and backwards by 10 seconds with 'l' / 'j'  key
- set video progress with number keys 0–9
- toggle captions with 'c' key
- toggle fullscreen mode with 'f' key
- play next video with 'N' key
- increase and decrease playback speed with '>' / '<' key

* js: remove unused dependency 'videojs.hotkeys.min.js'

Support for controlling the player volume by scrolling over it is
still retained by copying over the relevant code part from the
aforementioned library.
2019-08-16 16:01:14 -05:00
Dragnucs
7eaac995bd Change font family to better native selection (#679) 2019-08-16 15:59:05 -05:00
Omar Roth
a19cdb5e72 Fix season playlists 2019-08-16 15:46:59 -05:00
psvenk
f54fbd057e Add prefers-color-scheme support (#601)
* Add prefers-color-scheme support

This should fix <https://github.com/omarroth/invidious/issues/559>.
The cookie storage format has been changed from boolean
("true"/"false") to tri-state ("dark"/"light"/""), so that users
without a cookie set will get dark mode if they have enabled the dark
theme in their operating system. The code for handling the cookie
state, along with the user's operating system theme, has been factored
out into a new function `update_mode`, which is called both at window
load and at the "storage" event listener, because the "storage" event
listener is only trigerred when a change is made to the localStorage
from another tab/window (for more info - see
<https://stackoverflow.com/a/4679754>).
2019-08-15 11:29:55 -05:00
Omar Roth
19eceb4ecc Merge pull request #694 from 2secslater/player-preferences-typo-fix
Fix annoying typo in Preferences view for the player view
2019-08-14 19:17:29 -05:00
Omar Roth
dcff1ec25f Merge pull request #698 from leonklingele/docker-build-on-alpine-edge
docker: use alpine:edge base image for building
2019-08-14 18:50:15 -05:00
Leon Klingele
567cda4cd3 docker: use alpine:edge base image for building
This fixes currently failing Docker builds.
kemalcr/kemal in version 0.26.0 requires Crystal 0.30.0 which is not
yet available on Alpine 3.10 (previously used as the Docker base image).
2019-08-15 01:37:25 +02:00
Omar Roth
900d8790b3 Refactor geo-bypass 2019-08-14 18:09:07 -05:00
Omar Roth
cad284519f Merge pull request #696 from leonklingele/shard-update-dependencies-and-crystal-version
shard: update dependencies and Crystal version
2019-08-14 18:07:26 -05:00
Omar Roth
0727acf458 Merge pull request #695 from leonklingele/crystalfmt
Format Crystal files
2019-08-14 18:06:37 -05:00
Omar Roth
d8813179be Merge pull request #682 from leonklingele/ci-travis-test-docker-stages
travis: also test Docker build
2019-08-14 17:59:53 -05:00
Leon Klingele
10d690c8fb shard: update to crystal 0.30.1 2019-08-14 23:44:27 +02:00
Leon Klingele
52f71cdda0 shard: update dependencies
This updates will/crystal-pg to 0.18.1 and kemalcr/kemal tp 0.26.0.
2019-08-14 23:44:03 +02:00
Leon Klingele
2a9a348164 Format Crystal files
Crystal 0.30.1 apparently introduced some breaking changes to their
code formatter which made CI fail.

The code was automatically formatted by running

    crystal tool format
2019-08-14 23:31:07 +02:00
Andrew
00346781bb Fix annoying typo in Preferences view 2019-08-14 20:12:37 +00:00
Leon Klingele
4c6e92eea1 travis: also test Docker build 2019-08-10 17:00:50 +02:00
Omar Roth
b63f469110 Fix typo in ConfigPreferences 2019-08-09 14:09:24 -05:00
Omar Roth
f6f176afc1 Merge pull request #680 from leonklingele/add-player-styles
Add support for player styles
2019-08-09 13:49:51 -05:00
Omar Roth
3de37a61c5 Update videojs-http-source-selector 2019-08-09 10:36:41 -05:00
Omar Roth
2d955dae48 Force redirect for videos without audio 2019-08-09 10:36:22 -05:00
Leon Klingele
46577fb128 Add support for player styles
This currently includes the following styles:

- Invidious, the default
- YouTube, using a centered play button and always visible video control bar

Implements https://github.com/omarroth/invidious/issues/670.
Supersedes https://github.com/omarroth/invidious/pull/661.
2019-08-09 02:04:36 +02:00
Dragnucs
37dba6ebfd Add Postgres health check 2019-08-07 08:07:36 +00:00
Omar Roth
66b949bed1 Format history.ecr 2019-08-05 18:57:32 -05:00
Omar Roth
c9a05187fb Update icon for unlisted videos 2019-08-05 18:57:32 -05:00
Omar Roth
cc956583fb Fix detection of unavailable videos 2019-08-05 18:57:32 -05:00
Omar Roth
14206efb09 Merge pull request #671 from leonklingele/shard-upgrade-dependencies
shard: update dependencies
2019-08-04 22:37:36 -05:00
Leon Klingele
5e6d7f5d16 shard: update dependencies 2019-08-05 04:19:09 +02:00
Omar Roth
7a33831d14 Fix detection of premium content 2019-08-04 20:57:34 -05:00
Omar Roth
4f120e19fd Fix overflow for channel description 2019-08-04 09:46:26 -05:00
Omar Roth
37d064d836 Bump Crystal version 2019-08-04 09:16:29 -05:00
leonklingele
824150f89b Add Travis CI and pin dependencies (#655) 2019-08-04 09:10:32 -05:00
Omar Roth
f7dc4cca2c Merge pull request #665 from leonklingele/improve-dockerfile
docker: various improvements to Dockerfile
2019-08-04 08:07:16 -05:00
Leon Klingele
ea39bb4334 docker: various improvements to Dockerfile
This includes the following changes:

- Use multi-stage build to run application in an optimized environment, see
  https://docs.docker.com/develop/develop-images/multistage-build/
- Run application on alpine instead of archlinux to further reduce image size
- Build Crystal application with --release for improved runtime performance
- Run application as non-root user for better security, see
  https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
- Only rebuild Docker layers when required
2019-08-04 11:21:32 +02:00
Omar Roth
5680d5a7be Sort dash representations by framerate 2019-08-02 15:24:38 -05:00
Omar Roth
004246124b Merge pull request #664 from leonklingele/css-fix-jumpy-page-on-search-field-focus
Fix jumpy page on search field focus
2019-08-01 12:50:08 -05:00
Omar Roth
c41beae99a Add fix for channels with empty descriptions 2019-08-01 07:49:33 -05:00
Leon Klingele
fe2cffb25b Fix jumpy page on search field focus 2019-08-01 09:35:57 +02:00
Omar Roth
f71d5c429d Add description to channel pages 2019-07-31 19:29:16 -05:00
Omar Roth
dce5816b18 Fix image url extractor 2019-07-31 19:16:09 -05:00
leonklingele
f99a7b2a8c Fix engagement for zero-view videos (#654)
Division by zero resulted in 'NaN'.

Fixes https://github.com/omarroth/invidious/issues/653.
2019-07-31 09:48:45 -05:00
mondstern
ec36c69984 Update German translation 2019-07-31 09:37:43 -05:00
recette-lemon
2458db03de Update Icelandic translation 2019-07-31 09:36:55 -05:00
Brn9hrd7
7528b7bc1a Update german translation (#650) 2019-07-31 09:32:16 -05:00
TheFrenchGhosty
8af33084ed French translation updated - New words, consistency (#643)
* New words translated, more consistency
2019-07-31 08:52:41 -05:00
Omar Roth
f643175156 Fix typo in video extractor 2019-07-30 10:12:41 -05:00
Omar Roth
0321dda1d7 Fix handling for video content warnings 2019-07-29 20:39:12 -05:00
Omar Roth
ff5d79e3ee Update video extractor 2019-07-29 19:41:45 -05:00
Omar Roth
4ee3ec09df Autofill search for playlists and communities page 2019-07-27 08:51:10 -05:00
Omar Roth
cfe9d47fa0 Add support for '/embed/?list' 2019-07-25 10:36:35 -05:00
Omar Roth
607d6125fc Add support for '/embed/live_stream' 2019-07-24 19:18:26 -05:00
Omar Roth
6215259565 Add support for Google login verification 2019-07-22 13:28:36 -05:00
Omar Roth
d034fecc89 Remove default arguments from function definitions 2019-07-20 20:33:44 -05:00
Omar Roth
f18d8229c0 Refactor continuation protocol buffers 2019-07-20 20:18:08 -05:00
Omar Roth
e736626953 Fix continuation for last page of playlists 2019-07-20 11:38:20 -05:00
Omar Roth
c2c438637a Merge remote-tracking branch 'weblate/master' 2019-07-18 21:58:51 -05:00
Omar Roth
94638fe42c Update translations 2019-07-18 21:52:25 -05:00
recette-lemon
55ecfda39a Update Icelandic translation 2019-07-18 21:52:25 -05:00
Omar Roth
d97a272aa5 Fix check for 2-step verification 2019-07-18 21:52:24 -05:00
W2hJ3MOmIRovEpTeahe80jC
80a1944b9d Update Icelandic translation 2019-07-19 01:52:11 +02:00
recette-lemon
138cf943a9 Update Icelandic translation 2019-07-19 01:52:11 +02:00
recette-lemon
c7e672e533 Update Icelandic translation 2019-07-19 01:52:11 +02:00
Omar Roth
1b74a04efd Add 'force_resolve' to fix issues with rate limiting 2019-07-18 18:51:10 -05:00
Omar Roth
290c7e6009 Disable autoplay in community tabs 2019-07-14 10:13:40 -05:00
Omar Roth
e8a56e0fea Add '1.75' playback speed 2019-07-14 10:13:40 -05:00
Omar Roth
1ae7b646b3 Merge pull request #633 from EsmailELBoBDev2/patch-4
Update ar.json
2019-07-14 10:13:04 -05:00
Esmail EL BoB
42e2d73ce2 Update ar.json 2019-07-14 06:07:02 +00:00
Omar Roth
9e2a65a5ce Update CHANGELOG and bump version 2019-07-12 23:45:21 -05:00
Omar Roth
fea20ea913 Add support for Icelandic translation 2019-07-12 21:07:40 -05:00
Omar Roth
5b2480fff2 Merge remote-tracking branch 'weblate/master' 2019-07-12 21:04:20 -05:00
Omar Roth
b0dca2a363 Minor refactor 2019-07-12 21:00:50 -05:00
Jorge Maldonado Ventura
59bbe72798 Update Esperanto translation 2019-07-12 19:05:25 +02:00
recette-lemon
f99a30a57e Update Icelandic translation 2019-07-12 19:05:25 +02:00
Allan Nordhøy
aa4cb29621 Update Norwegian Bokmål translation 2019-07-12 19:05:25 +02:00
recette-lemon
91ad4e396b Update Icelandic translation 2019-07-12 19:05:25 +02:00
recette-lemon
351e17aacf Update Icelandic translation 2019-07-12 19:05:25 +02:00
recette-lemon
6c8e09acdb Add Icelandic translation 2019-07-12 19:05:25 +02:00
Omar Roth
1a7b341745 Update Google login 2019-07-12 12:04:39 -05:00
Omar Roth
af592ea8c1 Fix extraction for ytInitialData 2019-07-11 07:27:54 -05:00
Omar Roth
bb096a0357 Raise 400 on invalid request to '/feed/webhook' 2019-07-10 11:26:05 -05:00
Omar Roth
3c226892c6 Add fix for empty title tag when fetching videos 2019-07-10 10:44:44 -05:00
Omar Roth
47f6fe069a Add fix for unsupported attachment types 2019-07-09 23:09:16 -05:00
Omar Roth
aa3c1d930b Remove empty representations from dash manifests 2019-07-09 10:08:27 -05:00
Omar Roth
99b0b4f5b8 Fix escaping for materialized view SQL 2019-07-09 09:34:19 -05:00
Omar Roth
bcd239ac2b Add community page 2019-07-09 09:31:04 -05:00
Omar Roth
2cc25b1e6e Add administrator option to disable proxying 2019-07-08 12:15:18 -05:00
Omar Roth
5fd3ed782f Add fix for #600 2019-07-08 10:00:08 -05:00
Omar Roth
c34a24b633 Attempt to optimize query for subscription feed 2019-07-07 14:00:42 -05:00
Omar Roth
775612ec5a Prevent embeds from appearing in watch history 2019-07-05 16:55:28 -05:00
Omar Roth
fd43b16213 Add av01 formats to itag list 2019-07-05 13:43:44 -05:00
Omar Roth
5a455ec4f7 Fix redirect for livestream segments 2019-07-05 12:08:39 -05:00
Omar Roth
1277c3d156 Fix chunk size for livestreams 2019-07-05 11:35:04 -05:00
Omar Roth
8033d1ca6d Fix chunking for livestream segments 2019-07-05 11:02:12 -05:00
Omar Roth
28df6881a7 Try to prevent redirect for DASH streams 2019-07-04 23:29:28 -05:00
Omar Roth
e5fa5df7be Chunk video files to bypass throttling 2019-07-04 23:29:28 -05:00
Omar Roth
f7dbf2bdd4 Add 'pipe' for proxying assets 2019-07-04 23:29:28 -05:00
Omar Roth
857c57daba Add support for Chinese translation 2019-07-04 23:11:04 -05:00
Omar Roth
5515da3c2d Merge pull request #620 from outloudvi/l10n-zh-cn
Add translation of Simplified Chinese
2019-07-04 23:06:26 -05:00
Outvi V
cfc111f855 Add zh-CN translation 2019-07-04 13:08:01 +08:00
Omar Roth
3dd4043827 Fix 404 for video thumbnails 2019-07-03 13:54:15 -05:00
Omar Roth
351ecfae0f Fix body when proxying assets with status code > 300 2019-07-03 13:13:40 -05:00
Omar Roth
b22393092b Fix protocol for video author thumbnails 2019-07-03 13:10:18 -05:00
Omar Roth
1485ee8027 Fix channel thumbnail size in FireFox 2019-07-03 10:53:33 -05:00
Omar Roth
60826c2d0c Fix author thumbnail for community replies 2019-07-03 10:12:03 -05:00
Omar Roth
fb383458d7 Add /api/v1/search/suggestions 2019-07-03 10:11:47 -05:00
Omar Roth
196ee1aa8b Add '/api/v1/channels/comments' 2019-07-02 18:53:19 -05:00
Omar Roth
2df97cd2f5 Fix provided author for '/videos' endpoint 2019-07-02 07:29:01 -05:00
Omar Roth
501b523680 Fit channel link to content 2019-07-01 14:26:27 -05:00
Omar Roth
6efa6691b1 Clean up comment templating 2019-07-01 13:38:30 -05:00
Omar Roth
c47f1ae236 Add Reddit comment permalink 2019-07-01 12:37:28 -05:00
Omar Roth
aac240fe41 Resize comment thumbnails 2019-07-01 12:08:29 -05:00
Omar Roth
041debcd93 Revert "Chunk videoplayback response to avoid throttling"
This reverts commit 818cd2454d.
2019-07-01 10:45:09 -05:00
Omar Roth
0632a2d3c8 Fix logging for /watch URLs 2019-07-01 10:07:19 -05:00
Omar Roth
9f40b3a873 Add missing table to check_tables 2019-07-01 09:29:52 -05:00
Omar Roth
8fad0af935 Add caption styling 2019-06-30 22:46:08 -05:00
Omar Roth
48ad744ebf Add support for default channel banners 2019-06-30 12:59:38 -05:00
Omar Roth
556d5b0ca5 Resize channel thumbnails 2019-06-30 12:39:51 -05:00
Omar Roth
e30d70b6d4 Refactor proxy_list into global 2019-06-28 21:17:56 -05:00
Omar Roth
a58f5a925a Add banner to "/playlists" page 2019-06-28 21:00:28 -05:00
Omar Roth
a3cc3c57fd Add cursor: none to player 2019-06-28 20:55:23 -05:00
Omar Roth
0d0d3edeae Add thumbnail and banners to channel page 2019-06-28 20:48:24 -05:00
Omar Roth
dd0be7c522 Revert "Push potential fix for #578"
This reverts commit ebfd7d2153.
2019-06-28 11:05:08 -05:00
Omar Roth
9d2982fcd7 Fix typo in '/videoplayback' 2019-06-26 15:03:09 -05:00
Omar Roth
ebfd7d2153 Push potential fix for #578 2019-06-26 14:44:06 -05:00
Omar Roth
818cd2454d Chunk videoplayback response to avoid throttling 2019-06-26 14:43:33 -05:00
Omar Roth
b31d1c06f5 Fix typo in StaticFileHandler 2019-06-23 15:41:44 -05:00
Omar Roth
6cd884555c Patch StaticFileHandler to serve files from memory 2019-06-23 12:54:46 -05:00
Omar Roth
47ef74a1bb Refactor commonly used request and response headers 2019-06-23 08:39:25 -05:00
Omar Roth
cc6d6ddd66 Prevent firing _onStreamProgress after aborting 2019-06-22 20:08:37 -05:00
Omar Roth
6a6cf015a6 Merge pull request #598 from tleydxdy/patch-1
let docker listen to 127.0.0.1 by default
2019-06-22 19:47:35 -05:00
Omar Roth
ca79e81b39 Fix simpleText in comments extractor 2019-06-21 21:53:28 -05:00
Omar Roth
a9e86cecf5 Fix comment extractor 2019-06-21 20:25:31 -05:00
Tolstovka
5773b1c3e5 Update Ukrainian translation 2019-06-19 02:10:52 +02:00
Tolstovka
b562b3410b Update Russian translation 2019-06-19 02:10:52 +02:00
Jorge Maldonado Ventura
f6440e9830 Update Esperanto translation 2019-06-19 02:10:52 +02:00
ssantos
e43636e1e9 Update German translation 2019-06-19 02:10:52 +02:00
Omar Roth
6783bf9903 Update README 2019-06-17 18:10:04 -05:00
Omar Roth
807723c5b2 Fix status codes on error 2019-06-17 14:06:02 -05:00
tleydxdy
d3c4936116 let docker listen to 127.0.0.1 by default 2019-06-17 10:46:37 -04:00
Omar Roth
bbb40aef51 Fix event listener for notifications.js 2019-06-16 18:11:34 -05:00
Omar Roth
485a3e29e7 Optimize get_subscriptions AJAX 2019-06-16 17:33:24 -05:00
Omar Roth
1477f99c2c Add target="_blank" to embed titles 2019-06-16 14:49:00 -05:00
Omar Roth
2e1f9d5fa9 Fix title URL for embedded videos 2019-06-16 13:14:56 -05:00
Omar Roth
9dea251862 Fix typo in notifications.js 2019-06-16 12:57:56 -05:00
Omar Roth
17edfd6573 Shorten timeout for AJAX 2019-06-16 12:55:17 -05:00
Omar Roth
458e9d6cc7 Update license for sse.js 2019-06-16 09:46:09 -05:00
Omar Roth
485459b8b2 Add clickable title for embedded videos 2019-06-16 09:41:33 -05:00
Omar Roth
fcf377d26b Fix escaping for login page 2019-06-15 20:42:42 -05:00
Omar Roth
3be1c9261f Fix sleep in pull_top_videos 2019-06-15 19:18:36 -05:00
Omar Roth
38600b3347 Update list of domains for pulling Reddit comments 2019-06-15 18:58:21 -05:00
Omar Roth
62f7f7a689 Update shard.yml 2019-06-15 10:34:31 -05:00
Omar Roth
552f616305 Fix retry on timeout for AJAX requests 2019-06-15 10:09:32 -05:00
Omar Roth
a3164177f8 Fix SMS for Google login 2019-06-15 10:09:25 -05:00
Omar Roth
fa6bf21cd1 Update Google login 2019-06-09 13:48:31 -05:00
Omar Roth
eecf76c1fb Fix typo in short_description 2019-06-08 16:34:55 -05:00
Omar Roth
d1635cf24e Set max preference size 2019-06-08 16:04:55 -05:00
Omar Roth
b43e9ed7e7 Refactor 'description_html' 2019-06-08 15:08:27 -05:00
Omar Roth
12b2ab5da8 Add 'to_json' into respective structs 2019-06-08 13:31:41 -05:00
Omar Roth
1c9085556c Add support for 'attribution_link' 2019-06-08 11:13:00 -05:00
Omar Roth
9122f8acee Add title overlay to embedded videos 2019-06-08 10:52:47 -05:00
Omar Roth
ef8c9f093c Add premiere date to watch page 2019-06-08 10:18:45 -05:00
Omar Roth
801dffd571 Fix RSS content-type 2019-06-07 21:39:32 -05:00
Omar Roth
0b1c57b39f Add notifications to private feed 2019-06-07 21:27:37 -05:00
Omar Roth
2febc268f7 Fix warnings in Crystal 0.29 2019-06-07 21:13:50 -05:00
Omar Roth
58995bb3a2 Add support for log levels 2019-06-07 21:13:50 -05:00
Omar Roth
8c944815bc Minor refactor 2019-06-07 21:13:50 -05:00
Omar Roth
f065a21542 Fix 404 handling for endpoints matching short URLs 2019-06-07 21:13:50 -05:00
Omar Roth
27e032d10d Add '/api/v1/auth/feeds' 2019-06-07 21:13:50 -05:00
Omar Roth
ab3980cd38 Enforce maximum email length 2019-06-07 21:13:50 -05:00
Omar Roth
1db648a525 Merge pull request #577 from EsmailELBoBDev2/patch-3
Update ar.json
2019-06-07 10:26:36 -05:00
Omar Roth
ce3b5b683d Merge pull request #580 from Vistaus/master
Updated Dutch translation
2019-06-07 10:25:57 -05:00
Heimen Stoffels
9d23f1298d Updated Dutch translation 2019-06-07 12:29:03 +02:00
Esmail EL BoB
3f791b65b5 Update ar.json 2019-06-07 04:46:46 +00:00
Omar Roth
317d8703ca Optimize query for pulling popular videos 2019-06-06 21:33:30 -05:00
Omar Roth
fda619f704 Fix 'unique_res' to keep resolutions unique within a representation 2019-06-06 21:32:39 -05:00
Omar Roth
e4a0669da8 Fix typo in video param 2019-06-06 21:31:10 -05:00
115 changed files with 11156 additions and 4022 deletions

34
.travis.yml Normal file
View File

@@ -0,0 +1,34 @@
dist: bionic
jobs:
include:
- stage: build
# TODO: Shallowly clone again once the .git folder is no longer required for building
git:
depth: false
language: crystal
crystal: latest
before_install:
- shards update
- shards install
install:
- crystal build --warnings all --error-on-warnings src/invidious.cr
script:
- crystal tool format --check
- crystal spec
- stage: build_docker
# TODO: Shallowly clone again once the .git folder is no longer required for building
git:
depth: false
language: minimal
services:
- docker
install:
- docker-compose build
script:
- docker-compose up -d
- sleep 15 # Wait for cluster to become ready, TODO: do not sleep
- HEADERS="$(curl -I -s http://localhost:3000/)"
- STATUS="$(echo $HEADERS | head -n1)"
- if [[ "$STATUS" != *"200 OK"* ]]; then echo "$HEADERS"; exit 1; fi

View File

@@ -1,3 +1,200 @@
# 0.20.0 (2019-011-06)
# Version 0.20.0: Custom Playlists
It's been quite a while since the last release! There've been [198 commits](https://github.com/omarroth/invidious/compare/0.19.0..0.20.0) from 27 contributors.
A couple smaller features have since been added. Channel pages and playlists in particular have received a bit of a face-lift, with both now displaying their descriptions as expected, and playlists providing video count and published information. Channels will also now provide video descriptions in their RSS feed.
Turkish (tr), Chinese (zh-TW, in addition to zh-CN), and Japanese (jp) are all now supported languages. Thank you as always to the hard work done by translators that makes this possible.
The feed menu and default home page are both now configurable for registered and unregistered users, and is quite a bit of an improvement for users looking to reduce distractions for their daily use.
## For Administrators
`feed_menu` and `default_home` are now configurable by the user, and have therefore been moved into `default_user_preferences`:
```yaml
feed_menu: ["Popular", "Top"]
default_home: Top
# becomes:
default_user_preferences:
feed_menu: ["Popular", "Top"]
default_home: Top
```
Several new options have also been added, including the ability to set a support email for the instance using `admin_email: EMAIL`, and forcing the use of a specific connection in the case of rate-limiting using `force_resolve` (see below).
## For Developers
Authenticated endpoints are now [properly documented](https://github.com/omarroth/invidious/wiki/Authenticated-Endpoints), as well how to generate and use API tokens. My hope is that this makes some of the more [interesting](https://github.com/omarroth/invidious/wiki/Authenticated-Endpoints#get-apiv1authnotifications) endpoints more accessible for developers to use in their own applications.
API endpoints for interacting with custom playlists have also been added with documentation available [here](https://github.com/omarroth/invidious/wiki/Authenticated-Endpoints#get-apiv1authplaylists).
## Custom playlists
This is probably the feature that has been the longest in the pipe and that I'm quite pleased is now implemented. It is now possible to create custom playlists, which can be played and edited through Invidious. API endpoints have also been added (documentation [here](https://github.com/omarroth/invidious/wiki/Authenticated-Endpoints#get-apiv1authplaylists)).
Overall I'm quite pleased with how smoothly it has been rolled out and with the experience so far, and I'm exctited for how it can be extended and improved in future.
## [instances.invidio.us](https://instances.invidio.us)
It is now possible to view a list of public instances (as provided in the [wiki](https://github.com/omarroth/invidious/wiki/Invidious-Instances)) through an API or a pretty new interface [here](https://instances.invidio.us). It combines uptime information, statistics from each instance and basic information already provided in the wiki. I expect it should be much more user-friendly than compiling the information yourself, and is already used by [Invidition](https://codeberg.org/Booteille/Invidition) to provide a list of instances for users to choose from.
The site itself is licensed under the AGPLv3 and the source is available [here](https://github.com/omarroth/instances.invidio.us).
## Video unavailable [#811](https://github.com/omarroth/invidious/issues/811)
Many users have likely noticed this error message if using Invidious directly or through another service, such as FreeTube. This issue is caused by rate-limiting by Google, and is not a new issuee for projects like Invidious (notably [youtube-dl](https://github.com/ytdl-org/youtube-dl#http-error-429-too-many-requests-or-402-payment-required)) and appears to be affecting smaller, private instances as well.
There is not a permanent fix for administrators currently, however there is some information available [here](https://github.com/omarroth/invidious/issues/811#issuecomment-540017772) that may provide a temporary solution. Unfortanately, in most cases the best option is to wait for the instance to be unbanned or to move the instance to a different IP. A more informative error message is also now provided, which should help an administrator more quickly diagnose the problem.
For those interested, I would recommend following [#811](https://github.com/omarroth/invidious/issues/811) for any future progress on the issue.
## BAT verified publisher
I'm quite late to this announcement, however I'm pleased to mention that Invidious is now a BAT verified publisher! I would recommend looking [here](https://basicattentiontoken.org/about/) or [here](https://www.reddit.com/r/BATProject/comments/7cr7yc/new_to_bat_read_this_introduction_to_basic/) for learning more about what it is and how it works. Overall I think it makes an interesting substitute for services like Liberapay, and a (hopefully) much less-intrusive alternative to direct advertising.
BAT is combined under other cryptocurrencies below. Currently there's a fairly significant delay in payout, which is the reason for the large fluctuation in crypto donations between September and October (and also the reason for the late announcement).
## Release schedule
Currently I'm quite pleased with the current state of the project. There's plenty of things I'd still like to add, however at this point I expect the rate of most new additions will slow down a bit, with more focus on stabililty and any long-standing bugs.
Because of this, I'm planning on releasing a new version quarterly, with any necessary hotfixes being pushed as a new patch release as necessary. As always it will be possible to run Invidious directly from [master](https://github.com/omarroth/invidious/wiki/Updating) if you'd still like to have the lastest version.
I'll plan on providing finances each release, with a similar monthly breakdown as below.
## Finances for September 2019
### Donations
- [Patreon](https://www.patreon.com/omarroth) : \$64.37
- [Liberapay](https://liberapay.com/omarroth) : \$76.04
- Crypto : ~\$99.89 (converted from BAT, BCH, BTC)
- Total : \$240.30
### Expenses
- invidious-lb1 (nyc1) : \$10.00 (load balancer)
- invidious-update1 (s-1vcpu-1gb) : \$5.00 (updates feeds)
- invidious-node1 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node2 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node3 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node4 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node5 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node6 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node7 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node8 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node9 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node10 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node11 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node12 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node13 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node14 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node15 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node16 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-db1 (s-4vcpu-8gb) : \$40.00 (database)
- Total : \$135.00
## Finances for October 2019
- [Liberapay](https://liberapay.com/omarroth) : \$134.40
- Crypto : ~\$8.29 (converted from BAT, BCH, BTC)
- Total : \$142.69
### Expenses
- invidious-lb1 (nyc1) : \$5.00 (load balancer)
- invidious-lb2 (nyc1) : \$5.00 (load balancer)
- invidious-lb3 (nyc1) : \$5.00 (load balancer)
- invidious-lb4 (nyc1) : \$5.00 (load balancer)
- invidious-update1 (s-1vcpu-1gb) : \$5.00 (updates feeds)
- invidious-node1 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node2 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node3 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node4 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node5 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node6 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node7 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node8 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node9 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node10 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node11 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node12 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node13 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node14 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node15 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node16 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node17 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node18 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-db1 (s-4vcpu-8gb) : \$40.00 (database)
- Total : \$155.00
# 0.19.0 (2019-07-13)
# Version 0.19.0: Communities
Hello again everyone! Focus this month has mainly been on improving playback performance, along with a couple new features I'd like to announce. There have been [109 commits](https://github.com/omarroth/invidious/compare/0.18.0...0.19.0) this past month from 10 contributors.
This past month has seen the addition of Chinese (`zh-CN`) and Icelandic (`is`) translations. I would like to give a huge thanks to their respective translators, and again an enormous thanks to everyone who helps translate the site.
I'm delighted to mention that [FreeTube 0.6.0](https://github.com/FreeTubeApp/FreeTube) now supports 1080p thanks to the Invidious API. I would very much recommend reading the [relevant post](https://freetube.writeas.com/freetube-release-0-6-0-beta-1080p-and-a-lot-of-qol) for some more information on how it works, along with several other major improvements. Folks that are interested in adding similar functionality for their own projects should feel free to get in touch.
This past month there has been quite a bit of work on improving memory usage and improving download and playback speeds. As mentioned in the previous release, some extra hardware has been allocated which should also help with this. I'm still looking for ways to improve performance and feedback is always appreciated.
Along with performance, a couple quality of life improvements have been added, including author thumbnails and banners, clickable titles for embedded videos, and better styling for captions, among some other enhancements.
## Communities
Support for YouTube's [communities tab](https://creatoracademy.youtube.com/page/lesson/community-tab) has been added. It's a very interesting but surprisingly unknown feature. Essentially, providing comments for a channel, rather than a video, where an author can post updates for their subscribers.
It's commonly used to promote interesting links and foster discussion. I hope this feature helps people find more interesting content that otherwise would have been overlooked.
## For Developers
For accessing channel communities, an `/api/v1/channels/comments/:ucid` endpoint has been added, with similar behavior and schema to `/api/v1/comments/:id`, with an extra `attachment` field for top-level comments. More info on usage and available data can be found in the [wiki](https://github.com/omarroth/invidious/wiki/API#get-apiv1channelscommentsucid-apiv1channelsucidcomments).
An `/api/v1/auth/feeds` endpoint has been added for programmatically accessing a user's subscription feed, with options for displaying notifications and filtering an existing feed.
An `/api/v1/search/suggestions` endpoint has been added for retrieving suggestions for a given query.
## For Administrators
It is now possible to disable more resource intensive features, such as downloads and DASH functionality by adding `disable_proxy` to your config. See [#453](https://github.com/omarroth/invidious/issues/453) and the [Wiki](https://github.com/omarroth/invidious/wiki/Configuration) for more information and example usage. I expect this to be a big help for folks with limited bandwidth when hosting their own instances.
## Finances
### Donations
- [Patreon](https://www.patreon.com/omarroth) : \$38.39
- [Liberapay](https://liberapay.com/omarroth) : \$84.85
- Crypto : ~\$0.00 (converted from BCH, BTC)
- Total : \$123.24
### Expenses
- invidious-load1 (nyc1) : \$10.00 (load balancer)
- invidious-update1 (s-1vcpu-1gb) : \$5.00 (updates feeds)
- invidious-node1 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node2 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node3 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node4 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node5 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node6 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node7 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node8 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node9 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-node10 (s-1vcpu-1gb) : \$5.00 (web server)
- invidious-db1 (s-4vcpu-8gb) : \$40.00 (database)
- Total : \$105.00
The goal on Patreon has been updated to reflect the above expenses. As mentioned above, the main reason for more hardware is to improve playback and download speeds, although I'm still looking into improving performance without allocating more hardware.
As always I'm grateful for everyone's support and feedback. I'll see you all next month.
# 0.18.0 (2019-06-06)
# Version 0.18.0: Native Notifications and Optimizations

View File

@@ -1,5 +1,7 @@
# Invidious
[![Build Status](https://travis-ci.org/omarroth/invidious.svg?branch=master)](https://travis-ci.org/omarroth/invidious)
## Invidious is an alternative front-end to YouTube
- Audio-only mode (and no need to keep window open on mobile)
@@ -23,16 +25,19 @@
- Developer [API](https://github.com/omarroth/invidious/wiki/API)
Liberapay: https://liberapay.com/omarroth
Patreon: https://patreon.com/omarroth
BTC: 356DpZyMXu6rYd55Yqzjs29n79kGKWcYrY
BCH: qq4ptclkzej5eza6a50et5ggc58hxsq5aylqut2npk
Onion links:
## Invidious Instances
- kgg2m7yk5aybusll.onion
- axqzx4s6s54s32yentfqojs3x5i7faxza6xo3ehd4bzzsg2ii4fv2iid.onion
See [Invidious Instances](https://github.com/omarroth/invidious/wiki/Invidious-Instances) for a full list of publicly available instances.
[Alternative Invidious instances](https://github.com/omarroth/invidious/wiki/Invidious-Instances)
### Official Instances
- [invidio.us](https://invidio.us) 🇺🇸
Issuer: Let's Encrypt, [SSLLabs Verification](https://www.ssllabs.com/ssltest/analyze.html?d=invidio.us)
- [kgg2m7yk5aybusll.onion](http://kgg2m7yk5aybusll.onion)
- [axqzx4s6s54s32yentfqojs3x5i7faxza6xo3ehd4bzzsg2ii4fv2iid.onion](http://axqzx4s6s54s32yentfqojs3x5i7faxza6xo3ehd4bzzsg2ii4fv2iid.onion)
## Screenshots
@@ -74,7 +79,7 @@ $ docker-compose build
```bash
# Arch Linux
$ sudo pacman -S shards crystal imagemagick librsvg postgresql
$ sudo pacman -S shards crystal librsvg postgresql
# Ubuntu or Debian
# First you have to add the repository to your APT configuration. For easy setup just run in your command line:
@@ -83,7 +88,7 @@ $ curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash
$ curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -
$ echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list
$ sudo apt-get update
$ sudo apt install crystal libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev librsvg2-dev postgresql imagemagick libsqlite3-dev
$ sudo apt install crystal libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev postgresql librsvg2-bin libsqlite3-dev
```
#### Add invidious user and clone repository
@@ -138,7 +143,7 @@ $ sudo systemctl start invidious.service
```bash
# Install dependencies
$ brew update
$ brew install shards crystal-lang postgres imagemagick librsvg
$ brew install shards crystal postgres imagemagick librsvg
# Clone repository and setup postgres database
$ git clone https://github.com/omarroth/invidious

View File

@@ -21,10 +21,9 @@ body {
color: #f0f0f0;
}
.pure-form > fieldset > input,
.pure-control-group > input,
.pure-form > fieldset > select,
.pure-control-group > select {
input,
select,
textarea {
color: rgba(35, 35, 35, 1);
}

View File

@@ -1,7 +1,25 @@
html,
body {
font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica,
Arial, sans-serif;
}
.deleted {
background-color: rgb(255, 0, 0, 0.5);
}
.channel-profile > * {
font-size: 1.17em;
font-weight: bold;
vertical-align: middle;
}
.channel-profile > img {
width: 48px;
height: auto;
}
.channel-owner {
background-color: #008bec;
color: #fff;
@@ -92,6 +110,7 @@ img.thumbnail {
height: 100%;
left: 0;
top: 0;
object-fit: cover;
}
.length {
@@ -102,7 +121,6 @@ img.thumbnail {
border-radius: 2px;
padding: 2px;
font-size: 16px;
font-family: sans-serif;
right: 0.25em;
bottom: -0.75em;
}
@@ -115,7 +133,6 @@ img.thumbnail {
border-radius: 2px;
padding: 4px 8px 4px 8px;
font-size: 16px;
font-family: sans-serif;
left: 0.2em;
top: -0.7em;
}
@@ -145,9 +162,12 @@ img.thumbnail {
.navbar .index-link {
font-weight: bold;
display: inline;
}
.navbar > .searchbar .pure-form input[type="search"] {
margin-bottom: 1px;
border-top: 0;
border-left: 0;
border-right: 0;
@@ -158,7 +178,6 @@ img.thumbnail {
box-shadow: none;
transition: 0.1s border-bottom;
-webkit-appearance: none;
}
@@ -177,6 +196,7 @@ input[type="search"]::-webkit-search-cancel-button {
/* attract focus to the searchbar by adding a subtle transition */
.navbar > .searchbar .pure-form input[type="search"]:focus {
margin-bottom: 0px;
border-bottom: 2px solid #aaa;
}
@@ -263,13 +283,27 @@ input[type="search"]::-webkit-search-cancel-button {
}
/* Control Bar */
@media screen and (max-width: 480px) {
@media screen and (max-width: 640px) {
.video-js .vjs-control-bar,
.vjs-menu-button-popup .vjs-menu .vjs-menu-content {
overflow: -webkit-paged-x;
overflow-x: scroll;
}
}
ul.vjs-menu-content::-webkit-scrollbar {
display: none;
}
.vjs-user-inactive {
cursor: none;
}
.video-js .vjs-text-track-display > div > div > div {
background-color: rgba(0, 0, 0, 0.75) !important;
border-radius: 9px !important;
padding: 5px !important;
}
.vjs-play-control,
.vjs-volume-panel,
.vjs-current-time,
@@ -301,9 +335,18 @@ input[type="search"]::-webkit-search-cancel-button {
order: 6;
}
.vjs-playback-rate > .vjs-menu {
width: 50px;
}
.vjs-control-bar {
display: flex;
flex-direction: row;
scrollbar-width: none;
}
.vjs-control-bar::-webkit-scrollbar {
display: none;
}
.video-js .vjs-icon-cog {
@@ -351,9 +394,16 @@ span > select {
background-color: rgba(0, 182, 240, 1);
}
/* Overlay */
.video-js .vjs-overlay {
background-color: rgba(35, 35, 35, 0.75);
color: rgba(255, 255, 255, 1);
}
/* ProgressBar marker */
.vjs-marker {
background-color: rgba(255, 255, 255, 1);
z-index: 0;
}
/* Big "Play" Button */
@@ -400,3 +450,22 @@ video.video-js {
.pure-control-group label {
word-wrap: normal;
}
.video-js.player-style-invidious {
/* This is already the default */
}
.video-js.player-style-youtube .vjs-control-bar {
display: flex;
flex-direction: row;
}
.video-js.player-style-youtube .vjs-big-play-button {
/*
Styles copied from video-js.min.css, definition of
.vjs-big-play-centered .vjs-big-play-button
*/
top: 50%;
left: 50%;
margin-top: -0.81666em;
margin-left: -1.5em;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
/**
* videojs-http-source-selector
* @version 1.1.5
* @version 1.1.6
* @copyright 2019 Justin Fujita <Justin@pivotshare.com>
* @license MIT
*/

View File

@@ -0,0 +1 @@
.video-js .vjs-overlay{color:#fff;position:absolute;text-align:center}.video-js .vjs-overlay-no-background{max-width:33%}.video-js .vjs-overlay-background{background-color:#646464;background-color:rgba(255,255,255,0.4);border-radius:3px;padding:10px;width:33%}.video-js .vjs-overlay-top-left{top:5px;left:5px}.video-js .vjs-overlay-top{left:50%;margin-left:-16.5%;top:5px}.video-js .vjs-overlay-top-right{right:5px;top:5px}.video-js .vjs-overlay-right{right:5px;top:50%;transform:translateY(-50%)}.video-js .vjs-overlay-bottom-right{bottom:3.5em;right:5px}.video-js .vjs-overlay-bottom{bottom:3.5em;left:50%;margin-left:-16.5%}.video-js .vjs-overlay-bottom-left{bottom:3.5em;left:5px}.video-js .vjs-overlay-left{left:5px;top:50%;transform:translateY(-50%)}.video-js .vjs-overlay-center{left:50%;margin-left:-16.5%;top:50%;transform:translateY(-50%)}.video-js .vjs-no-flex .vjs-overlay-left,.video-js .vjs-no-flex .vjs-overlay-center,.video-js .vjs-no-flex .vjs-overlay-right{margin-top:-15px}

View File

@@ -1,6 +1,6 @@
/**
* videojs-share
* @version 3.0.0
* @version 3.2.1
* @copyright 2019 Mikhail Khazov <mkhazov.work@gmail.com>
* @license MIT
*/

Binary file not shown.

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2018-6-14: Created with FontForge (http://fontforge.org)
2019-5-24: Created with FontForge (http://fontforge.org)
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<metadata>
Created by FontForge 20160407 at Thu Jun 14 08:50:34 2018
Created by FontForge 20160407 at Fri May 24 15:45:40 2019
By Adam Bradley
Copyright (c) 2018, Adam Bradley
Copyright (c) 2019, Adam Bradley
</metadata>
<defs>
<font id="Ionicons" horiz-adv-x="416" >

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

101
assets/js/community.js Normal file
View File

@@ -0,0 +1,101 @@
String.prototype.supplant = function (o) {
return this.replace(/{([^{}]*)}/g, function (a, b) {
var r = o[b];
return typeof r === 'string' || typeof r === 'number' ? r : a;
});
}
function hide_youtube_replies(event) {
var target = event.target;
sub_text = target.getAttribute('data-inner-text');
inner_text = target.getAttribute('data-sub-text');
body = target.parentNode.parentNode.children[1];
body.style.display = 'none';
target.innerHTML = sub_text;
target.onclick = show_youtube_replies;
target.setAttribute('data-inner-text', inner_text);
target.setAttribute('data-sub-text', sub_text);
}
function show_youtube_replies(event) {
var target = event.target;
sub_text = target.getAttribute('data-inner-text');
inner_text = target.getAttribute('data-sub-text');
body = target.parentNode.parentNode.children[1];
body.style.display = '';
target.innerHTML = sub_text;
target.onclick = hide_youtube_replies;
target.setAttribute('data-inner-text', inner_text);
target.setAttribute('data-sub-text', sub_text);
}
function number_with_separator(val) {
while (/(\d+)(\d{3})/.test(val.toString())) {
val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2');
}
return val;
}
function get_youtube_replies(target, load_more) {
var continuation = target.getAttribute('data-continuation');
var body = target.parentNode.parentNode;
var fallback = body.innerHTML;
body.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
var url = '/api/v1/channels/comments/' + community_data.ucid +
'?format=html' +
'&hl=' + community_data.preferences.locale +
'&thin_mode=' + community_data.preferences.thin_mode +
'&continuation=' + continuation;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 10000;
xhr.open('GET', url, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
if (load_more) {
body = body.parentNode.parentNode;
body.removeChild(body.lastElementChild);
body.innerHTML += xhr.response.contentHtml;
} else {
body.removeChild(body.lastElementChild);
var p = document.createElement('p');
var a = document.createElement('a');
p.appendChild(a);
a.href = 'javascript:void(0)';
a.onclick = hide_youtube_replies;
a.setAttribute('data-sub-text', community_data.hide_replies_text);
a.setAttribute('data-inner-text', community_data.show_replies_text);
a.innerText = community_data.hide_replies_text;
var div = document.createElement('div');
div.innerHTML = xhr.response.contentHtml;
body.appendChild(p);
body.appendChild(div);
}
} else {
body.innerHTML = fallback;
}
}
}
xhr.ontimeout = function () {
console.log('Pulling comments failed.');
body.innerHTML = fallback;
}
xhr.send();
}

View File

@@ -1,5 +1,7 @@
function get_playlist(plid, timeouts = 0) {
if (timeouts > 10) {
function get_playlist(plid, retries) {
if (retries == undefined) retries = 5;
if (retries <= 0) {
console.log('Failed to pull playlist');
return;
}
@@ -10,15 +12,15 @@ function get_playlist(plid, timeouts = 0) {
'&format=html&hl=' + video_data.preferences.locale;
} else {
var plid_url = '/api/v1/playlists/' + plid +
'?continuation=' + video_data.id +
'?index=' + video_data.index +
'&continuation' + video_data.id +
'&format=html&hl=' + video_data.preferences.locale;
}
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('GET', plid_url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
@@ -44,6 +46,9 @@ function get_playlist(plid, timeouts = 0) {
}
url.searchParams.set('list', plid);
if (!plid.startsWith('RD')) {
url.searchParams.set('index', xhr.response.index);
}
location.assign(url.pathname + url.search);
});
}
@@ -51,38 +56,47 @@ function get_playlist(plid, timeouts = 0) {
}
}
xhr.ontimeout = function () {
console.log('Pulling playlist timed out.');
get_playlist(plid, timeouts++);
xhr.onerror = function () {
console.log('Pulling playlist failed... ' + retries + '/5');
setTimeout(function () { get_playlist(plid, retries - 1) }, 1000);
}
xhr.ontimeout = function () {
console.log('Pulling playlist failed... ' + retries + '/5');
get_playlist(plid, retries - 1);
}
xhr.send();
}
if (video_data.plid) {
get_playlist(video_data.plid);
} else if (video_data.video_series) {
player.on('ended', function () {
var url = new URL('https://example.com/embed/' + video_data.video_series.shift());
window.addEventListener('load', function (e) {
if (video_data.plid) {
get_playlist(video_data.plid);
} else if (video_data.video_series) {
player.on('ended', function () {
var url = new URL('https://example.com/embed/' + video_data.video_series.shift());
if (video_data.params.autoplay || video_data.params.continue_autoplay) {
url.searchParams.set('autoplay', '1');
}
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.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.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);
}
if (video_data.params.local !== video_data.preferences.local) {
url.searchParams.set('local', video_data.params.local);
}
if (video_data.video_series.length !== 0) {
url.searchParams.set('playlist', video_data.video_series.join(','))
}
if (video_data.video_series.length !== 0) {
url.searchParams.set('playlist', video_data.video_series.join(','))
}
location.assign(url.pathname + url.search);
});
}
location.assign(url.pathname + url.search);
});
}
});

View File

@@ -1,32 +1,37 @@
var notifications, delivered;
function get_subscriptions(callback, failures = 1) {
if (failures >= 10) {
return
function get_subscriptions(callback, retries) {
if (retries == undefined) retries = 5;
if (retries <= 0) {
return;
}
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.open('GET', '/api/v1/auth/subscriptions', true);
xhr.send(null);
xhr.timeout = 10000;
xhr.open('GET', '/api/v1/auth/subscriptions?fields=authorId', true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
subscriptions = xhr.response;
callback(subscriptions);
} else {
console.log('Pulling subscriptions failed... ' + failures + '/10');
get_subscriptions(callback, failures++)
}
}
}
xhr.ontimeout = function () {
console.log('Pulling subscriptions failed... ' + failures + '/10');
get_subscriptions(callback, failures++);
xhr.onerror = function () {
console.log('Pulling subscriptions failed... ' + retries + '/5');
setTimeout(function () { get_subscriptions(callback, retries - 1) }, 1000);
}
xhr.ontimeout = function () {
console.log('Pulling subscriptions failed... ' + retries + '/5');
get_subscriptions(callback, retries - 1);
}
xhr.send();
}
function create_notification_stream(subscriptions) {
@@ -42,7 +47,7 @@ function create_notification_stream(subscriptions) {
notifications.onmessage = function (event) {
if (!event.id) {
return
return;
}
var notification = JSON.parse(event.data);
@@ -77,21 +82,16 @@ function create_notification_stream(subscriptions) {
}
}
notifications.onerror = function (event) {
console.log('Something went wrong with notifications, trying to reconnect...');
notifications.close();
get_subscriptions(create_notification_stream);
}
notifications.ontimeout = function (event) {
console.log('Something went wrong with notifications, trying to reconnect...');
notifications.close();
get_subscriptions(create_notification_stream);
}
notifications.addEventListener('error', handle_notification_error);
notifications.stream();
}
function handle_notification_error(event) {
console.log('Something went wrong with notifications, trying to reconnect...');
notifications = { close: function () { } };
setTimeout(function () { get_subscriptions(create_notification_stream) }, 1000);
}
window.addEventListener('load', function (e) {
localStorage.setItem('notification_count', document.getElementById('notification_count') ? document.getElementById('notification_count').innerText : '0');
@@ -100,10 +100,11 @@ window.addEventListener('load', function (e) {
} else {
setTimeout(function () {
if (!localStorage.getItem('stream')) {
get_subscriptions(create_notification_stream);
notifications = { close: function () { } };
localStorage.setItem('stream', true);
get_subscriptions(create_notification_stream);
}
}, Math.random() * 1000 + 10);
}, Math.random() * 1000 + 50);
}
window.addEventListener('storage', function (e) {
@@ -113,10 +114,11 @@ window.addEventListener('load', function (e) {
} else {
setTimeout(function () {
if (!localStorage.getItem('stream')) {
get_subscriptions(create_notification_stream);
notifications = { close: function () { } };
localStorage.setItem('stream', true);
get_subscriptions(create_notification_stream);
}
}, Math.random() * 1000 + 10);
}, Math.random() * 1000 + 50);
}
} else if (e.key === 'notification_count') {
var notification_ticker = document.getElementById('notification_ticker');

View File

@@ -1,20 +1,20 @@
var options = {
preload: "auto",
preload: 'auto',
liveui: true,
playbackRates: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0],
playbackRates: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0],
controlBar: {
children: [
"playToggle",
"volumePanel",
"currentTimeDisplay",
"timeDivider",
"durationDisplay",
"progressControl",
"remainingTimeDisplay",
"captionsButton",
"qualitySelector",
"playbackRateMenuButton",
"fullscreenToggle"
'playToggle',
'volumePanel',
'currentTimeDisplay',
'timeDivider',
'durationDisplay',
'progressControl',
'remainingTimeDisplay',
'captionsButton',
'qualitySelector',
'playbackRateMenuButton',
'fullscreenToggle'
]
}
}
@@ -29,7 +29,7 @@ short_url = location.origin + '/' + video_data.id + embed_url.search;
embed_url = location.origin + '/embed/' + video_data.id + embed_url.search;
var shareOptions = {
socials: ["fbFeed", "tw", "reddit", "email"],
socials: ['fbFeed', 'tw', 'reddit', 'email'],
url: short_url,
title: player_data.title,
@@ -38,69 +38,23 @@ var shareOptions = {
embedCode: "<iframe id='ivplayer' type='text/html' width='640' height='360' src='" + embed_url + "' frameborder='0'></iframe>"
}
var player = videojs("player", options, function () {
this.hotkeys({
volumeStep: 0.1,
seekStep: 5,
enableModifiersForNumbers: false,
enableHoverScroll: true,
customKeys: {
// Toggle play with K Key
play: {
key: function (e) {
return e.which === 75;
},
handler: function (player, options, e) {
if (player.paused()) {
player.play();
} else {
player.pause();
}
}
},
// Go backward 10 seconds
backward: {
key: function (e) {
return e.which === 74;
},
handler: function (player, options, e) {
player.currentTime(player.currentTime() - 10);
}
},
// Go forward 10 seconds
forward: {
key: function (e) {
return e.which === 76;
},
handler: function (player, options, e) {
player.currentTime(player.currentTime() + 10);
}
},
// Increase speed
increase_speed: {
key: function (e) {
return (e.which === 190 && e.shiftKey);
},
handler: function (player, _, e) {
size = options.playbackRates.length;
index = options.playbackRates.indexOf(player.playbackRate());
player.playbackRate(options.playbackRates[(index + 1) % size]);
}
},
// Decrease speed
decrease_speed: {
key: function (e) {
return (e.which === 188 && e.shiftKey);
},
handler: function (player, _, e) {
size = options.playbackRates.length;
index = options.playbackRates.indexOf(player.playbackRate());
player.playbackRate(options.playbackRates[(size + index - 1) % size]);
}
}
}
var player = videojs('player', options);
if (location.pathname.startsWith('/embed/')) {
player.overlay({
overlays: [{
start: 'loadstart',
content: '<h1><a rel="noopener" target="_blank" href="' + location.origin + '/watch?v=' + video_data.id + '">' + player_data.title + '</a></h1>',
end: 'playing',
align: 'top'
}, {
start: 'pause',
content: '<h1><a rel="noopener" target="_blank" href="' + location.origin + '/watch?v=' + video_data.id + '">' + player_data.title + '</a></h1>',
end: 'playing',
align: 'top'
}]
});
});
}
player.on('error', function (event) {
if (player.error().code === 2 || player.error().code === 4) {
@@ -163,27 +117,28 @@ player.on('waiting', function () {
}
});
if (video_data.premiere_timestamp && Math.round(new Date() / 1000) < video_data.premiere_timestamp) {
player.getChild('bigPlayButton').hide();
}
if (video_data.params.autoplay) {
var bpb = player.getChild('bigPlayButton');
bpb.hide();
if (bpb) {
bpb.hide();
player.ready(function () {
new Promise(function (resolve, reject) {
setTimeout(() => resolve(1), 1);
}).then(function (result) {
var promise = player.play();
player.ready(function () {
new Promise(function (resolve, reject) {
setTimeout(() => resolve(1), 1);
}).then(function (result) {
var promise = player.play();
if (promise !== undefined) {
promise.then(_ => {
}).catch(error => {
bpb.show();
});
}
});
if (promise !== undefined) {
promise.then(_ => {
}).catch(error => {
bpb.show();
});
}
});
}
});
}
if (!video_data.params.listen && video_data.params.quality === 'dash') {
@@ -196,45 +151,321 @@ player.vttThumbnails({
// Enable annotations
if (!video_data.params.listen && video_data.params.annotations) {
var video_container = document.getElementById('player');
let xhr = new XMLHttpRequest();
xhr.responseType = 'text';
xhr.timeout = 60000;
xhr.open('GET', '/api/v1/annotations/' + video_data.id, true);
xhr.send();
window.addEventListener('load', function (e) {
var video_container = document.getElementById('player');
let xhr = new XMLHttpRequest();
xhr.responseType = 'text';
xhr.timeout = 60000;
xhr.open('GET', '/api/v1/annotations/' + video_data.id, true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
videojs.registerPlugin('youtubeAnnotationsPlugin', youtubeAnnotationsPlugin);
if (!player.paused()) {
player.youtubeAnnotationsPlugin({ annotationXml: xhr.response, videoContainer: video_container });
} else {
player.one('play', function (event) {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
videojs.registerPlugin('youtubeAnnotationsPlugin', youtubeAnnotationsPlugin);
if (!player.paused()) {
player.youtubeAnnotationsPlugin({ annotationXml: xhr.response, videoContainer: video_container });
});
} else {
player.one('play', function (event) {
player.youtubeAnnotationsPlugin({ annotationXml: xhr.response, videoContainer: video_container });
});
}
}
}
}
}
window.addEventListener('__ar_annotation_click', e => {
const { url, target, seconds } = e.detail;
var path = new URL(url);
window.addEventListener('__ar_annotation_click', e => {
const { url, target, seconds } = e.detail;
var path = new URL(url);
if (path.href.startsWith('https://www.youtube.com/watch?') && seconds) {
path.search += '&t=' + seconds;
}
if (path.href.startsWith('https://www.youtube.com/watch?') && seconds) {
path.search += '&t=' + seconds;
}
path = path.pathname + path.search;
path = path.pathname + path.search;
if (target === 'current') {
window.location.href = path;
} else if (target === 'new') {
window.open(path, '_blank');
}
if (target === 'current') {
window.location.href = path;
} else if (target === 'new') {
window.open(path, '_blank');
}
});
xhr.send();
});
}
function increase_volume(delta) {
const curVolume = player.volume();
let newVolume = curVolume + delta;
if (newVolume > 1) {
newVolume = 1;
} else if (newVolume < 0) {
newVolume = 0;
}
player.volume(newVolume);
}
function toggle_muted() {
const isMuted = player.muted();
player.muted(!isMuted);
}
function skip_seconds(delta) {
const duration = player.duration();
const curTime = player.currentTime();
let newTime = curTime + delta;
if (newTime > duration) {
newTime = duration;
} else if (newTime < 0) {
newTime = 0;
}
player.currentTime(newTime);
}
function set_time_percent(percent) {
const duration = player.duration();
const newTime = duration * (percent / 100);
player.currentTime(newTime);
}
function toggle_play() {
if (player.paused()) {
player.play();
} else {
player.pause();
}
}
const toggle_captions = (function () {
let toggledTrack = null;
const onChange = function (e) {
toggledTrack = null;
};
const bindChange = function (onOrOff) {
player.textTracks()[onOrOff]('change', onChange);
};
// Wrapper function to ignore our own emitted events and only listen
// to events emitted by Video.js on click on the captions menu items.
const setMode = function (track, mode) {
bindChange('off');
track.mode = mode;
window.setTimeout(function () {
bindChange('on');
}, 0);
};
bindChange('on');
return function () {
if (toggledTrack !== null) {
if (toggledTrack.mode !== 'showing') {
setMode(toggledTrack, 'showing');
} else {
setMode(toggledTrack, 'disabled');
}
toggledTrack = null;
return;
}
// Used as a fallback if no captions are currently active.
// TODO: Make this more intelligent by e.g. relying on browser language.
let fallbackCaptionsTrack = null;
const tracks = player.textTracks();
for (let i = 0; i < tracks.length; i++) {
const track = tracks[i];
if (track.kind !== 'captions') {
continue;
}
if (fallbackCaptionsTrack === null) {
fallbackCaptionsTrack = track;
}
if (track.mode === 'showing') {
setMode(track, 'disabled');
toggledTrack = track;
return;
}
}
// Fallback if no captions are currently active.
if (fallbackCaptionsTrack !== null) {
setMode(fallbackCaptionsTrack, 'showing');
toggledTrack = fallbackCaptionsTrack;
}
};
})();
function toggle_fullscreen() {
if (player.isFullscreen()) {
player.exitFullscreen();
} else {
player.requestFullscreen();
}
}
function increase_playback_rate(steps) {
const maxIndex = options.playbackRates.length - 1;
const curIndex = options.playbackRates.indexOf(player.playbackRate());
let newIndex = curIndex + steps;
if (newIndex > maxIndex) {
newIndex = maxIndex;
} else if (newIndex < 0) {
newIndex = 0;
}
player.playbackRate(options.playbackRates[newIndex]);
}
window.addEventListener('keydown', e => {
if (e.target.tagName.toLowerCase() === 'input') {
// Ignore input when focus is on certain elements, e.g. form fields.
return;
}
// See https://github.com/ctd1500/videojs-hotkeys/blob/bb4a158b2e214ccab87c2e7b95f42bc45c6bfd87/videojs.hotkeys.js#L310-L313
const isPlayerFocused = false
|| e.target === document.querySelector('.video-js')
|| e.target === document.querySelector('.vjs-tech')
|| e.target === document.querySelector('.iframeblocker')
|| e.target === document.querySelector('.vjs-control-bar')
;
let action = null;
const code = e.keyCode;
const decoratedKey =
e.key
+ (e.altKey ? '+alt' : '')
+ (e.ctrlKey ? '+ctrl' : '')
+ (e.metaKey ? '+meta' : '')
;
switch (decoratedKey) {
case ' ':
case 'k':
action = toggle_play;
break;
case 'ArrowUp':
if (isPlayerFocused) {
action = increase_volume.bind(this, 0.1);
}
break;
case 'ArrowDown':
if (isPlayerFocused) {
action = increase_volume.bind(this, -0.1);
}
break;
case 'm':
action = toggle_muted;
break;
case 'ArrowRight':
action = skip_seconds.bind(this, 5);
break;
case 'ArrowLeft':
action = skip_seconds.bind(this, -5);
break;
case 'l':
action = skip_seconds.bind(this, 10);
break;
case 'j':
action = skip_seconds.bind(this, -10);
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
const percent = (code - 48) * 10;
action = set_time_percent.bind(this, percent);
break;
case 'c':
action = toggle_captions;
break;
case 'f':
action = toggle_fullscreen;
break;
case 'N':
action = next_video;
break;
case 'P':
// TODO: Add support to play back previous video.
break;
case '.':
// TODO: Add support for next-frame-stepping.
break;
case ',':
// TODO: Add support for previous-frame-stepping.
break;
case '>':
action = increase_playback_rate.bind(this, 1);
break;
case '<':
action = increase_playback_rate.bind(this, -1);
break;
default:
console.info('Unhandled key down event: %s:', decoratedKey, e);
break;
}
if (action) {
e.preventDefault();
action();
}
}, false);
// Add support for controlling the player volume by scrolling over it. Adapted from
// https://github.com/ctd1500/videojs-hotkeys/blob/bb4a158b2e214ccab87c2e7b95f42bc45c6bfd87/videojs.hotkeys.js#L292-L328
(function () {
const volumeStep = 0.05;
const enableVolumeScroll = true;
const enableHoverScroll = true;
const doc = document;
const pEl = document.getElementById('player');
var volumeHover = false;
var volumeSelector = pEl.querySelector('.vjs-volume-menu-button') || pEl.querySelector('.vjs-volume-panel');
if (volumeSelector != null) {
volumeSelector.onmouseover = function () { volumeHover = true; };
volumeSelector.onmouseout = function () { volumeHover = false; };
}
var mouseScroll = function mouseScroll(event) {
var activeEl = doc.activeElement;
if (enableHoverScroll) {
// If we leave this undefined then it can match non-existent elements below
activeEl = 0;
}
// When controls are disabled, hotkeys will be disabled as well
if (player.controls()) {
if (volumeHover) {
if (enableVolumeScroll) {
event = window.event || event;
var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
event.preventDefault();
if (delta == 1) {
increase_volume(volumeStep);
} else if (delta == -1) {
increase_volume(-volumeStep);
}
}
}
}
};
player.on('mousewheel', mouseScroll);
player.on("DOMMouseScroll", mouseScroll);
}());
// Since videojs-share can sometimes be blocked, we defer it until last
player.share(shareOptions);

View File

@@ -0,0 +1,47 @@
function add_playlist_item(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
tile.style.display = 'none';
var url = '/playlist_ajax?action_add_video=1&redirect=false' +
'&video_id=' + target.getAttribute('data-id') +
'&playlist_id=' + target.getAttribute('data-plid');
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 10000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status != 200) {
tile.style.display = '';
}
}
}
xhr.send('csrf_token=' + playlist_data.csrf_token);
}
function remove_playlist_item(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
tile.style.display = 'none';
var url = '/playlist_ajax?action_remove_video=1&redirect=false' +
'&set_video_id=' + target.getAttribute('data-index') +
'&playlist_id=' + target.getAttribute('data-plid');
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 10000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status != 200) {
tile.style.display = '';
}
}
}
xhr.send('csrf_token=' + playlist_data.csrf_token);
}

File diff suppressed because one or more lines are too long

View File

@@ -94,7 +94,7 @@ var SSE = function (url, options) {
}
this._onStreamProgress = function(e) {
if (this.xhr.status !== 200) {
if (this.xhr.status !== 200 && this.readyState !== this.CLOSED) {
this._onStreamFailure(e);
return;
}

View File

@@ -7,8 +7,8 @@ if (subscribe_button.getAttribute('data-type') === 'subscribe') {
subscribe_button.onclick = unsubscribe;
}
function subscribe(timeouts = 0) {
if (timeouts >= 10) {
function subscribe(retries = 5) {
if (retries <= 0) {
console.log('Failed to subscribe.');
return;
}
@@ -17,10 +17,9 @@ function subscribe(timeouts = 0) {
'&c=' + subscribe_data.ucid;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('POST', url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send('csrf_token=' + subscribe_data.csrf_token);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var fallback = subscribe_button.innerHTML;
subscribe_button.onclick = unsubscribe;
@@ -35,14 +34,21 @@ function subscribe(timeouts = 0) {
}
}
xhr.ontimeout = function () {
console.log('Subscribing timed out.');
subscribe(timeouts++);
xhr.onerror = function () {
console.log('Subscribing failed... ' + retries + '/5');
setTimeout(function () { subscribe(retries - 1) }, 1000);
}
xhr.ontimeout = function () {
console.log('Subscribing failed... ' + retries + '/5');
subscribe(retries - 1);
}
xhr.send('csrf_token=' + subscribe_data.csrf_token);
}
function unsubscribe(timeouts = 0) {
if (timeouts >= 10) {
function unsubscribe(retries = 5) {
if (retries <= 0) {
console.log('Failed to subscribe');
return;
}
@@ -51,10 +57,9 @@ function unsubscribe(timeouts = 0) {
'&c=' + subscribe_data.ucid;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('csrf_token=' + subscribe_data.csrf_token);
var fallback = subscribe_button.innerHTML;
subscribe_button.onclick = subscribe;
@@ -69,8 +74,15 @@ function unsubscribe(timeouts = 0) {
}
}
xhr.ontimeout = function () {
console.log('Unsubscribing timed out.');
unsubscribe(timeouts++);
xhr.onerror = function () {
console.log('Unsubscribing failed... ' + retries + '/5');
setTimeout(function () { unsubscribe(retries - 1) }, 1000);
}
xhr.ontimeout = function () {
console.log('Unsubscribing failed... ' + retries + '/5');
unsubscribe(retries - 1);
}
xhr.send('csrf_token=' + subscribe_data.csrf_token);
}

View File

@@ -1,28 +1,34 @@
var toggle_theme = document.getElementById('toggle_theme')
var toggle_theme = document.getElementById('toggle_theme');
toggle_theme.href = 'javascript:void(0);';
toggle_theme.addEventListener('click', function () {
var dark_mode = document.getElementById('dark_theme').media == 'none';
var dark_mode = document.getElementById('dark_theme').media === 'none';
var url = '/toggle_theme?redirect=false';
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('GET', url, true);
xhr.send();
set_mode(dark_mode);
localStorage.setItem('dark_mode', dark_mode);
window.localStorage.setItem('dark_mode', dark_mode ? 'dark' : 'light');
xhr.send();
});
window.addEventListener('storage', function (e) {
if (e.key == 'dark_mode') {
var dark_mode = e.newValue === 'true';
set_mode(dark_mode);
if (e.key === 'dark_mode') {
update_mode(e.newValue);
}
});
function set_mode(bool) {
window.addEventListener('load', function () {
window.localStorage.setItem('dark_mode', document.getElementById('dark_mode_pref').textContent);
// Update localStorage if dark mode preference changed on preferences page
update_mode(window.localStorage.dark_mode);
});
function set_mode (bool) {
document.getElementById('dark_theme').media = !bool ? 'none' : '';
document.getElementById('light_theme').media = bool ? 'none' : '';
@@ -32,3 +38,21 @@ function set_mode(bool) {
toggle_theme.children[0].setAttribute('class', 'icon ion-ios-moon');
}
}
function update_mode (mode) {
if (mode === 'true' /* for backwards compatibility */ || mode === 'dark') {
// If preference for dark mode indicated
set_mode(true);
}
else if (mode === 'false' /* for backwards compaibility */ || mode === 'light') {
// If preference for light mode indicated
set_mode(false);
}
else if (document.getElementById('dark_mode_pref').textContent === '' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// If no preference indicated here and no preference indicated on the preferences page (backend), but the browser tells us that the operating system has a dark theme
set_mode(true);
}
// else do nothing, falling back to the mode defined by the `dark_mode` preference on the preferences page (backend)
}

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
/**
* videojs-http-source-selector
* @version 1.1.5
* @version 1.1.6
* @copyright 2019 Justin Fujita <Justin@pivotshare.com>
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e=e||self)["videojs-http-source-selector"]=t(e.videojs)}(this,function(i){"use strict";function o(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}var a=function(n){function e(e,t){var o;return o=n.call(this,e,t)||this,t.selectable=!0,o}o(e,n);var t=e.prototype;return t.handleClick=function(){var e=this.options_;console.log("Changing quality to:",e.label),this.selected_=!0,this.selected(!0);for(var t=this.player().qualityLevels(),o=0;o<t.length;o++)e.index==t.length?t[o].enabled=!0:e.index==o?t[o].enabled=!0:t[o].enabled=!1},t.update=function(){var e=this.player().qualityLevels().selectedIndex;this.selected(this.options_.index==e),this.selected_=this.options_.index===e},e}((i=i&&i.hasOwnProperty("default")?i.default:i).getComponent("MenuItem")),r=i.getComponent("MenuButton"),n=function(l){function e(e,t){var o;o=l.call(this,e,t)||this,r.apply(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(o),arguments);var n=o.player().qualityLevels();if(t&&t.default)if("low"==t.default)for(var i=0;i<n.length;i++)n[i].enabled=0==i;else if(t.default="high")for(i=0;i<n.length;i++)n[i].enabled=i==n.length-1;return o}o(e,l);var t=e.prototype;return t.createEl=function(){return i.dom.createEl("div",{className:"vjs-http-source-selector vjs-menu-button vjs-menu-button-popup vjs-control vjs-button"})},t.buildCSSClass=function(){return r.prototype.buildCSSClass.call(this)+" vjs-icon-cog"},t.update=function(){return r.prototype.update.call(this)},t.createItems=function(){for(var e=[],t=this.player().qualityLevels(),o=[],n=0;n<t.length;n++){var i=t.length-(n+1),l=i===t.selectedIndex,r=""+i,s=i;t[i].height?(r=t[i].height+"p",s=parseInt(t[i].height,10)):t[i].bitrate&&(r=Math.floor(t[i].bitrate/1e3)+" kbps",s=parseInt(t[i].bitrate,10)),0<=o.indexOf(r)||(o.push(r),e.push(new a(this.player_,{label:r,index:i,selected:l,sortVal:s})))}return 1<t.length&&e.push(new a(this.player_,{label:"Auto",index:t.length,selected:!1,sortVal:99999})),e.sort(function(e,t){return e.options_.sortVal<t.options_.sortVal?1:e.options_.sortVal>t.options_.sortVal?-1:0}),e},e}(r),l={},e=i.registerPlugin||i.plugin,t=function(e){var t=this;this.ready(function(){!function(n,e){if(n.addClass("vjs-http-source-selector"),console.log("videojs-http-source-selector initialized!"),console.log("player.techName_:"+n.techName_),"Html5"!=n.techName_)return;n.on(["loadedmetadata"],function(e){if(n.qualityLevels(),i.log("loadmetadata event"),"undefined"==n.videojs_http_source_selector_initialized||1==n.videojs_http_source_selector_initialized)console.log("player.videojs_http_source_selector_initialized == true");else{console.log("player.videojs_http_source_selector_initialized == false"),n.videojs_http_source_selector_initialized=!0;var t=n.controlBar,o=t.getChild("fullscreenToggle").el();t.el().insertBefore(t.addChild("SourceMenuButton").el(),o)}})}(t,i.mergeOptions(l,e))}),i.registerComponent("SourceMenuButton",n),i.registerComponent("SourceMenuItem",a)};return e("httpSourceSelector",t),t.VERSION="1.1.5",t});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e=e||self)["videojs-http-source-selector"]=t(e.videojs)}(this,function(r){"use strict";function o(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var e=(r=r&&r.hasOwnProperty("default")?r.default:r).getComponent("MenuItem"),t=r.getComponent("Component"),a=function(n){function e(e,t){return t.selectable=!0,t.multiSelectable=!1,n.call(this,e,t)||this}o(e,n);var t=e.prototype;return t.handleClick=function(){var e=this.options_;console.log("Changing quality to:",e.label),n.prototype.handleClick.call(this);for(var t=this.player().qualityLevels(),o=0;o<t.length;o++)e.index==t.length?t[o].enabled=!0:e.index==o?t[o].enabled=!0:t[o].enabled=!1},t.update=function(){var e=this.player().qualityLevels().selectedIndex;this.selected(this.options_.index==e)},e}(e);t.registerComponent("SourceMenuItem",a);var u=r.getComponent("MenuButton"),n=function(i){function e(e,t){var o;o=i.call(this,e,t)||this,u.apply(s(o),arguments);var n=o.player().qualityLevels();if(t&&t.default)if("low"==t.default)for(var l=0;l<n.length;l++)n[l].enabled=0==l;else if(t.default="high")for(l=0;l<n.length;l++)n[l].enabled=l==n.length-1;return o.player().qualityLevels().on(["change","addqualitylevel"],r.bind(s(o),o.update)),o}o(e,i);var t=e.prototype;return t.createEl=function(){return r.dom.createEl("div",{className:"vjs-http-source-selector vjs-menu-button vjs-menu-button-popup vjs-control vjs-button"})},t.buildCSSClass=function(){return u.prototype.buildCSSClass.call(this)+" vjs-icon-cog"},t.update=function(){return u.prototype.update.call(this)},t.createItems=function(){for(var e=[],t=this.player().qualityLevels(),o=[],n=0;n<t.length;n++){var l=t.length-(n+1),i=l===t.selectedIndex,r=""+l,s=l;t[l].height?(r=t[l].height+"p",s=parseInt(t[l].height,10)):t[l].bitrate&&(r=Math.floor(t[l].bitrate/1e3)+" kbps",s=parseInt(t[l].bitrate,10)),0<=o.indexOf(r)||(o.push(r),e.push(new a(this.player_,{label:r,index:l,selected:i,sortVal:s})))}return 1<t.length&&e.push(new a(this.player_,{label:"Auto",index:t.length,selected:!1,sortVal:99999})),e.sort(function(e,t){return e.options_.sortVal<t.options_.sortVal?1:e.options_.sortVal>t.options_.sortVal?-1:0}),e},e}(u),l={},i=r.registerPlugin||r.plugin,c=function(e){var t=this;this.ready(function(){!function(n,e){if(n.addClass("vjs-http-source-selector"),console.log("videojs-http-source-selector initialized!"),console.log("player.techName_:"+n.techName_),"Html5"!=n.techName_)return;n.on(["loadedmetadata"],function(e){if(n.qualityLevels(),r.log("loadmetadata event"),"undefined"==n.videojs_http_source_selector_initialized||1==n.videojs_http_source_selector_initialized)console.log("player.videojs_http_source_selector_initialized == true");else{console.log("player.videojs_http_source_selector_initialized == false"),n.videojs_http_source_selector_initialized=!0;var t=n.controlBar,o=t.getChild("fullscreenToggle").el();t.el().insertBefore(t.addChild("SourceMenuButton").el(),o)}})}(t,r.mergeOptions(l,e))}),r.registerComponent("SourceMenuButton",n),r.registerComponent("SourceMenuItem",a)};return i("httpSourceSelector",c),c.VERSION="1.1.6",c});

2
assets/js/videojs-overlay.min.js vendored Normal file
View File

@@ -0,0 +1,2 @@
/*! @name videojs-overlay @version 2.1.4 @license Apache-2.0 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js"),require("global/window")):"function"==typeof define&&define.amd?define(["video.js","global/window"],e):t.videojsOverlay=e(t.videojs,t.window)}(this,function(t,e){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}t=t&&t.hasOwnProperty("default")?t.default:t,e=e&&e.hasOwnProperty("default")?e.default:e;var r={align:"top-left",class:"",content:"This overlay will show up while the video is playing",debug:!1,showBackground:!0,attachToControlBar:!1,overlays:[{start:"playing",end:"paused"}]},i=t.getComponent("Component"),o=t.dom||t,s=t.registerPlugin||t.plugin,a=function(t){return"number"==typeof t&&t==t},h=function(t){return"string"==typeof t&&/^\S+$/.test(t)},d=function(r){var i,s;function d(t,e){var i;return i=r.call(this,t,e)||this,["start","end"].forEach(function(t){var e=i.options_[t];if(a(e))i[t+"Event_"]="timeupdate";else if(h(e))i[t+"Event_"]=e;else if("start"===t)throw new Error('invalid "start" option; expected number or string')}),["endListener_","rewindListener_","startListener_"].forEach(function(t){i[t]=function(e){return d.prototype[t].call(n(n(i)),e)}}),"timeupdate"===i.startEvent_&&i.on(t,"timeupdate",i.rewindListener_),i.debug('created, listening to "'+i.startEvent_+'" for "start" and "'+(i.endEvent_||"nothing")+'" for "end"'),i.hide(),i}s=r,(i=d).prototype=Object.create(s.prototype),i.prototype.constructor=i,i.__proto__=s;var l=d.prototype;return l.createEl=function(){var t=this.options_,n=t.content,r=t.showBackground?"vjs-overlay-background":"vjs-overlay-no-background",i=o.createEl("div",{className:"\n vjs-overlay\n vjs-overlay-"+t.align+"\n "+t.class+"\n "+r+"\n vjs-hidden\n "});return"string"==typeof n?i.innerHTML=n:n instanceof e.DocumentFragment?i.appendChild(n):o.appendContent(i,n),i},l.debug=function(){if(this.options_.debug){for(var e=t.log,n=e,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];e.hasOwnProperty(i[0])&&"function"==typeof e[i[0]]&&(n=e[i.shift()]),n.apply(void 0,["overlay#"+this.id()+": "].concat(i))}},l.hide=function(){return r.prototype.hide.call(this),this.debug("hidden"),this.debug('bound `startListener_` to "'+this.startEvent_+'"'),this.endEvent_&&(this.debug('unbound `endListener_` from "'+this.endEvent_+'"'),this.off(this.player(),this.endEvent_,this.endListener_)),this.on(this.player(),this.startEvent_,this.startListener_),this},l.shouldHide_=function(t,e){var n=this.options_.end;return a(n)?t>=n:n===e},l.show=function(){return r.prototype.show.call(this),this.off(this.player(),this.startEvent_,this.startListener_),this.debug("shown"),this.debug('unbound `startListener_` from "'+this.startEvent_+'"'),this.endEvent_&&(this.debug('bound `endListener_` to "'+this.endEvent_+'"'),this.on(this.player(),this.endEvent_,this.endListener_)),this},l.shouldShow_=function(t,e){var n=this.options_.start,r=this.options_.end;return a(n)?a(r)?t>=n&&t<r:this.hasShownSinceSeek_?Math.floor(t)===n:(this.hasShownSinceSeek_=!0,t>=n):n===e},l.startListener_=function(t){var e=this.player().currentTime();this.shouldShow_(e,t.type)&&this.show()},l.endListener_=function(t){var e=this.player().currentTime();this.shouldHide_(e,t.type)&&this.hide()},l.rewindListener_=function(t){var e=this.player().currentTime(),n=this.previousTime_,r=this.options_.start,i=this.options_.end;e<n&&(this.debug("rewind detected"),a(i)&&!this.shouldShow_(e)?(this.debug("hiding; "+i+" is an integer and overlay should not show at this time"),this.hasShownSinceSeek_=!1,this.hide()):h(i)&&e<r&&(this.debug("hiding; show point ("+r+") is before now ("+e+") and end point ("+i+") is an event"),this.hasShownSinceSeek_=!1,this.hide())),this.previousTime_=e},d}(i);t.registerComponent("Overlay",d);var l=function(e){var n=this,i=t.mergeOptions(r,e);Array.isArray(this.overlays_)&&this.overlays_.forEach(function(t){n.removeChild(t),n.controlBar&&n.controlBar.removeChild(t),t.dispose()});var o=i.overlays;delete i.overlays,this.overlays_=o.map(function(e){var r=t.mergeOptions(i,e),o="string"==typeof r.attachToControlBar||!0===r.attachToControlBar;if(!n.controls()||!n.controlBar)return n.addChild("overlay",r);if(o&&-1!==r.align.indexOf("bottom")){var s=n.controlBar.children()[0];if(void 0!==n.controlBar.getChild(r.attachToControlBar)&&(s=n.controlBar.getChild(r.attachToControlBar)),s){var a=n.controlBar.addChild("overlay",r);return n.controlBar.el().insertBefore(a.el(),s.el()),a}}var h=n.addChild("overlay",r);return n.el().insertBefore(h.el(),n.controlBar.el()),h})};return l.VERSION="2.1.4",s("overlay",l),l});

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
/* videojs-hotkeys v0.2.25 - https://github.com/ctd1500/videojs-hotkeys */
!function(e,n){"undefined"!=typeof window&&window.videojs?n(window.videojs):"function"==typeof define&&define.amd?define("videojs-hotkeys",["video.js"],function(e){return n(e.default||e)}):"undefined"!=typeof module&&module.exports&&(module.exports=n(require("video.js")))}(0,function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.25"});(e.registerPlugin||e.plugin)("hotkeys",function(n){function t(e){return"function"==typeof s?s(e):s}function r(e){null!=e&&"function"==typeof e.then&&e.then(null,function(e){})}var o=this,u=o.el(),l=document,i={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableHoverScroll:!1,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},c=e.mergeOptions||e.util.mergeOptions,a=(n=c(i,n||{})).volumeStep,s=n.seekStep,m=n.enableMute,f=n.enableVolumeScroll,y=n.enableHoverScroll,v=n.enableFullscreen,d=n.enableNumbers,p=n.enableJogStyle,b=n.alwaysCaptureHotkeys,h=n.enableModifiersForNumbers,w=n.enableInactiveFocus,k=n.skipInitialFocus,S=e.VERSION;u.hasAttribute("tabIndex")||u.setAttribute("tabIndex","-1"),u.style.outline="none",!b&&o.autoplay()||k||o.one("play",function(){u.focus()}),w&&o.on("userinactive",function(){var e=function(){clearTimeout(n)},n=setTimeout(function(){o.off("useractive",e);var n=l.activeElement,t=u.querySelector(".vjs-control-bar");n&&n.parentElement==t&&u.focus()},10);o.one("useractive",e)}),o.on("play",function(){var e=u.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var K=!1,q=u.querySelector(".vjs-volume-menu-button")||u.querySelector(".vjs-volume-panel");null!=q&&(q.onmouseover=function(){K=!0},q.onmouseout=function(){K=!1});var j=function(e){if(y)n=0;else var n=l.activeElement;if(o.controls()&&(b||n==u||n==u.querySelector(".vjs-tech")||n==u.querySelector(".iframeblocker")||n==u.querySelector(".vjs-control-bar")||K)&&f){e=window.event||e;var t=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==t?o.volume(o.volume()+a):-1==t&&o.volume(o.volume()-a)}},F=function(e,t){return n.playPauseKey(e,t)?1:n.rewindKey(e,t)?2:n.forwardKey(e,t)?3:n.volumeUpKey(e,t)?4:n.volumeDownKey(e,t)?5:n.muteKey(e,t)?6:n.fullscreenKey(e,t)?7:void 0};return o.on("keydown",function(e){var i,c,s=e.which,f=e.preventDefault,y=o.duration();if(o.controls()){var w=l.activeElement;if(b||w==u||w==u.querySelector(".vjs-tech")||w==u.querySelector(".vjs-control-bar")||w==u.querySelector(".iframeblocker"))switch(F(e,o)){case 1:f(),b&&e.stopPropagation(),o.paused()?r(o.play()):o.pause();break;case 2:i=!o.paused(),f(),i&&o.pause(),(c=o.currentTime()-t(e))<=0&&(c=0),o.currentTime(c),i&&r(o.play());break;case 3:i=!o.paused(),f(),i&&o.pause(),(c=o.currentTime()+t(e))>=y&&(c=i?y-.001:y),o.currentTime(c),i&&r(o.play());break;case 5:f(),p?(c=o.currentTime()-1,o.currentTime()<=1&&(c=0),o.currentTime(c)):o.volume(o.volume()-a);break;case 4:f(),p?((c=o.currentTime()+1)>=y&&(c=y),o.currentTime(c)):o.volume(o.volume()+a);break;case 6:m&&o.muted(!o.muted());break;case 7:v&&(o.isFullscreen()?o.exitFullscreen():o.requestFullscreen());break;default:if((s>47&&s<59||s>95&&s<106)&&(h||!(e.metaKey||e.ctrlKey||e.altKey))&&d){var k=48;s>95&&(k=96);var S=s-k;f(),o.currentTime(o.duration()*S*.1)}for(var K in n.customKeys){var q=n.customKeys[K];q&&q.key&&q.handler&&q.key(e)&&(f(),q.handler(o,n,e))}}}}),o.on("dblclick",function(e){if(null!=S&&S<="7.1.0"&&o.controls()){var n=e.relatedTarget||e.toElement||l.activeElement;n!=u&&n!=u.querySelector(".vjs-tech")&&n!=u.querySelector(".iframeblocker")||v&&(o.isFullscreen()?o.exitFullscreen():o.requestFullscreen())}}),o.on("mousewheel",j),o.on("DOMMouseScroll",j),this})});

View File

@@ -73,29 +73,33 @@ if (continue_button) {
continue_button.onclick = continue_autoplay;
}
function next_video() {
var url = new URL('https://example.com/watch?v=' + video_data.next_video);
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('continue', '1');
location.assign(url.pathname + url.search);
}
function continue_autoplay(event) {
if (event.target.checked) {
player.on('ended', function () {
var url = new URL('https://example.com/watch?v=' + video_data.next_video);
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('continue', '1');
location.assign(url.pathname + url.search);
next_video();
});
} else {
player.off('ended');
@@ -109,10 +113,11 @@ function number_with_separator(val) {
return val;
}
function get_playlist(plid, timeouts = 0) {
function get_playlist(plid, retries) {
if (retries == undefined) retries = 5;
playlist = document.getElementById('playlist');
if (timeouts > 10) {
if (retries <= 0) {
console.log('Failed to pull playlist');
playlist.innerHTML = '';
return;
@@ -128,15 +133,15 @@ function get_playlist(plid, timeouts = 0) {
'&format=html&hl=' + video_data.preferences.locale;
} else {
var plid_url = '/api/v1/playlists/' + plid +
'?continuation=' + video_data.id +
'?index=' + video_data.index +
'&continuation=' + video_data.id +
'&format=html&hl=' + video_data.preferences.locale;
}
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('GET', plid_url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
@@ -164,6 +169,9 @@ function get_playlist(plid, timeouts = 0) {
}
url.searchParams.set('list', plid);
if (!plid.startsWith('RD')) {
url.searchParams.set('index', xhr.response.index);
}
location.assign(url.pathname + url.search);
});
}
@@ -174,19 +182,32 @@ function get_playlist(plid, timeouts = 0) {
}
}
xhr.ontimeout = function () {
console.log('Pulling playlist timed out.');
xhr.onerror = function () {
playlist = document.getElementById('playlist');
playlist.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
get_playlist(plid, timeouts + 1);
console.log('Pulling playlist timed out... ' + retries + '/5');
setTimeout(function () { get_playlist(plid, retries - 1) }, 1000);
}
xhr.ontimeout = function () {
playlist = document.getElementById('playlist');
playlist.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
console.log('Pulling playlist timed out... ' + retries + '/5');
get_playlist(plid, retries - 1);
}
xhr.send();
}
function get_reddit_comments(timeouts = 0) {
function get_reddit_comments(retries) {
if (retries == undefined) retries = 5;
comments = document.getElementById('comments');
if (timeouts > 10) {
if (retries <= 0) {
console.log('Failed to pull comments');
comments.innerHTML = '';
return;
@@ -201,9 +222,8 @@ function get_reddit_comments(timeouts = 0) {
'&hl=' + video_data.preferences.locale;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('GET', url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
@@ -238,7 +258,8 @@ function get_reddit_comments(timeouts = 0) {
comments.children[0].children[1].children[0].onclick = swap_comments;
} else {
if (video_data.params.comments[1] === 'youtube') {
get_youtube_comments(timeouts + 1);
console.log('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_youtube_comments(retries - 1) }, 1000);
} else {
comments.innerHTML = fallback;
}
@@ -246,16 +267,24 @@ function get_reddit_comments(timeouts = 0) {
}
}
xhr.ontimeout = function () {
console.log('Pulling comments timed out.');
get_reddit_comments(timeouts + 1);
xhr.onerror = function () {
console.log('Pulling comments failed... ' + retries + '/5');
setInterval(function () { get_reddit_comments(retries - 1) }, 1000);
}
xhr.ontimeout = function () {
console.log('Pulling comments failed... ' + retries + '/5');
get_reddit_comments(retries - 1);
}
xhr.send();
}
function get_youtube_comments(timeouts = 0) {
function get_youtube_comments(retries) {
if (retries == undefined) retries = 5;
comments = document.getElementById('comments');
if (timeouts > 10) {
if (retries <= 0) {
console.log('Failed to pull comments');
comments.innerHTML = '';
return;
@@ -271,9 +300,8 @@ function get_youtube_comments(timeouts = 0) {
'&thin_mode=' + video_data.preferences.thin_mode;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('GET', url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
@@ -303,7 +331,7 @@ function get_youtube_comments(timeouts = 0) {
comments.children[0].children[1].children[0].onclick = swap_comments;
} else {
if (video_data.params.comments[1] === 'youtube') {
get_youtube_comments(timeouts + 1);
setTimeout(function () { get_youtube_comments(retries - 1) }, 1000);
} else {
comments.innerHTML = '';
}
@@ -311,12 +339,21 @@ function get_youtube_comments(timeouts = 0) {
}
}
xhr.ontimeout = function () {
console.log('Pulling comments timed out.');
xhr.onerror = function () {
comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
get_youtube_comments(timeouts + 1);
console.log('Pulling comments failed... ' + retries + '/5');
setInterval(function () { get_youtube_comments(retries - 1) }, 1000);
}
xhr.ontimeout = function () {
comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
console.log('Pulling comments failed... ' + retries + '/5');
get_youtube_comments(retries - 1);
}
xhr.send();
}
function get_youtube_replies(target, load_more) {
@@ -334,9 +371,8 @@ function get_youtube_replies(target, load_more) {
'&continuation=' + continuation;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('GET', url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
@@ -371,9 +407,11 @@ function get_youtube_replies(target, load_more) {
}
xhr.ontimeout = function () {
console.log('Pulling comments timed out.');
console.log('Pulling comments failed.');
body.innerHTML = fallback;
}
xhr.send();
}
if (video_data.play_next) {
@@ -401,19 +439,21 @@ if (video_data.play_next) {
});
}
if (video_data.plid) {
get_playlist(video_data.plid);
}
window.addEventListener('load', function (e) {
if (video_data.plid) {
get_playlist(video_data.plid);
}
if (video_data.params.comments[0] === 'youtube') {
get_youtube_comments();
} else if (video_data.params.comments[0] === 'reddit') {
get_reddit_comments();
} else if (video_data.params.comments[1] === 'youtube') {
get_youtube_comments();
} else if (video_data.params.comments[1] === 'reddit') {
get_reddit_comments();
} else {
comments = document.getElementById('comments');
comments.innerHTML = '';
}
if (video_data.params.comments[0] === 'youtube') {
get_youtube_comments();
} else if (video_data.params.comments[0] === 'reddit') {
get_reddit_comments();
} else if (video_data.params.comments[1] === 'youtube') {
get_youtube_comments();
} else if (video_data.params.comments[1] === 'reddit') {
get_reddit_comments();
} else {
comments = document.getElementById('comments');
comments.innerHTML = '';
}
});

View File

@@ -6,10 +6,9 @@ function mark_watched(target) {
'&id=' + target.getAttribute('data-id');
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('csrf_token=' + watched_data.csrf_token);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
@@ -18,11 +17,13 @@ function mark_watched(target) {
}
}
}
xhr.send('csrf_token=' + watched_data.csrf_token);
}
function mark_unwatched(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
tile.style.display = "none";
tile.style.display = 'none';
var count = document.getElementById('count')
count.innerText = count.innerText - 1;
@@ -30,10 +31,9 @@ function mark_unwatched(target) {
'&id=' + target.getAttribute('data-id');
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.timeout = 10000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('csrf_token=' + watched_data.csrf_token);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
@@ -43,4 +43,6 @@ function mark_unwatched(target) {
}
}
}
xhr.send('csrf_token=' + watched_data.csrf_token);
}

View File

@@ -1,5 +1,5 @@
#!/bin/sh
psql invidious < config/sql/session_ids.sql
psql invidious kemal < config/sql/session_ids.sql
psql invidious kemal -c "INSERT INTO session_ids (SELECT unnest(id), email, CURRENT_TIMESTAMP FROM users) ON CONFLICT (id) DO NOTHING"
psql invidious kemal -c "ALTER TABLE users DROP COLUMN id"

View File

@@ -0,0 +1,19 @@
-- Table: public.playlist_videos
-- DROP TABLE public.playlist_videos;
CREATE TABLE playlist_videos
(
title text,
id text,
author text,
ucid text,
length_seconds integer,
published timestamptz,
plid text references playlists(id),
index int8,
live_now boolean,
PRIMARY KEY (index,plid)
);
GRANT ALL ON TABLE public.playlist_videos TO kemal;

18
config/sql/playlists.sql Normal file
View File

@@ -0,0 +1,18 @@
-- Table: public.playlists
-- DROP TABLE public.playlists;
CREATE TABLE public.playlists
(
title text,
id text primary key,
author text,
description text,
video_count integer,
created timestamptz,
updated timestamptz,
privacy privacy,
index int8[]
);
GRANT ALL ON public.playlists TO kemal;

10
config/sql/privacy.sql Normal file
View File

@@ -0,0 +1,10 @@
-- Type: public.privacy
-- DROP TYPE public.privacy;
CREATE TYPE public.privacy AS ENUM
(
'Public',
'Unlisted',
'Private'
);

View File

@@ -7,13 +7,15 @@ services:
restart: unless-stopped
volumes:
- postgresdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
invidious:
build:
context: .
dockerfile: docker/Dockerfile
restart: unless-stopped
ports:
- "3000:3000"
- "127.0.0.1:3000:3000"
depends_on:
- postgres

View File

@@ -1,15 +1,29 @@
FROM archlinux/base
RUN pacman -Sy --noconfirm shards crystal imagemagick librsvg \
which pkgconf gcc ttf-liberation glibc
# base-devel contains many other basic packages, that are normally assumed to already exist on a clean arch system
ADD . /invidious
FROM alpine:edge AS builder
RUN apk add --no-cache crystal shards libc-dev \
yaml-dev libxml2-dev sqlite-dev zlib-dev openssl-dev \
sqlite-static zlib-static openssl-libs-static
WORKDIR /invidious
COPY ./shard.yml ./shard.yml
RUN shards update && shards install
COPY ./src/ ./src/
# TODO: .git folder is required for building this is destructive.
# See definition of CURRENT_BRANCH, CURRENT_COMMIT and CURRENT_VERSION.
COPY ./.git/ ./.git/
RUN crystal build --static --release --warnings all --error-on-warnings \
# TODO: Remove next line, see https://github.com/crystal-lang/crystal/issues/7946
-Dmusl \
./src/invidious.cr
RUN sed -i 's/host: localhost/host: postgres/' config/config.yml && \
shards update && shards install && \
crystal build src/invidious.cr
FROM alpine:latest
RUN apk add --no-cache librsvg ttf-opensans
WORKDIR /invidious
RUN addgroup -g 1000 -S invidious && \
adduser -u 1000 -S invidious -G invidious
COPY ./assets/ ./assets/
COPY ./config/config.yml ./config/config.yml
COPY ./config/sql/ ./config/sql/
COPY ./locales/ ./locales/
RUN sed -i 's/host: \(127.0.0.1\|localhost\)/host: postgres/' config/config.yml
COPY --from=builder /invidious/invidious .
USER invidious
CMD [ "/invidious/invidious" ]

View File

@@ -19,6 +19,9 @@ if [ ! -f /var/lib/postgresql/data/setupFinished ]; then
su postgres -c 'psql invidious kemal < config/sql/session_ids.sql'
su postgres -c 'psql invidious kemal < config/sql/nonces.sql'
su postgres -c 'psql invidious kemal < config/sql/annotations.sql'
su postgres -c 'psql invidious kemal < config/sql/playlists.sql'
su postgres -c 'psql invidious kemal < config/sql/playlist_videos.sql'
su postgres -c 'psql invidious kemal < config/sql/privacy.sql'
touch /var/lib/postgresql/data/setupFinished
echo "### invidious database setup finished"
exit

View File

@@ -1,15 +1,16 @@
{
"`x` subscribers": "`x` المشتركين",
"`x` videos": "`x` الفيديوهات",
"`x` playlists": "`x` قوائم التشغيل",
"LIVE": "مباشر",
"Shared `x` ago": "تم رفع الفيديو منذ `x`",
"Unsubscribe": "إلغاء الإشتراك",
"Subscribe": "إشتراك",
"View channel on YouTube": "زيارة القناة على موقع يوتيوب",
"View playlist on YouTube": "",
"View playlist on YouTube": "عرض قائمة التشغيل على اليوتيوب",
"newest": "الأجدد",
"oldest": "الأقدم",
"popular": "الاكثر شعبية",
"popular": "الأكثر شعبية",
"last": "اخر قوائم التشغيل المعدلة",
"Next page": "الصفحة الثانية",
"Previous page": "الصفحة السابقة",
@@ -18,7 +19,7 @@
"New passwords must match": "الأرقام السرية يجب ان تكون متطابقة",
"Cannot change password for Google accounts": "لا يستطيع تغيير الرقم السرى لحساب جوجل",
"Authorize token?": "رمز الإذن ؟",
"Authorize token for `x`?": "رمز الإذن لـ `x` ?",
"Authorize token for `x`?": "تصريح الرمز لـ `x` ؟",
"Yes": "نعم",
"No": "لا",
"Import and Export Data": "استخراج و إضافة البيانات",
@@ -53,10 +54,10 @@
"Player preferences": "التفضيلات المشغل",
"Always loop: ": "كرر الفيديو دائما: ",
"Autoplay: ": "تشغيل تلقائى: ",
"Play next by default: ": "شغل الفيديو التالى تلقائيا",
"Autoplay next video: ": " شغل الفيديو التالى تلقائيا (فى قوائم التشغيل)",
"Play next by default: ": "شغل الفيديو التالي تلقائيا: ",
"Autoplay next video: ": "شغل الفيديو التالي تلقائيا (في قوائم التشغيل) ",
"Listen by default: ": "تشغيل النسخة السمعية تلقائى: ",
"Proxy videos? ": "عرض الفيديوهات عن طريق الوكيل(proxy) ؟",
"Proxy videos: ": "عرض الفيديوهات عن طريق البروكسي؟ ",
"Default speed: ": "السرعة الإفتراضية: ",
"Preferred video quality: ": "الجودة المفضلة للفيديوهات: ",
"Player volume: ": "صوت المشغل: ",
@@ -65,13 +66,17 @@
"reddit": "Reddit",
"Default captions: ": "الترجمات الإفتراضية: ",
"Fallback captions: ": "الترجمات المصاحبة: ",
"Show related videos? ": "عرض مقاطع الفيديو ذات الصلة؟",
"Show annotations by default? ": "عرض الملاحظات فى الفيديو تلقائيا ؟",
"Show related videos: ": "اعرض الفيديوهات ذات الصلة: ",
"Show annotations by default: ": "اعرض الملاحظات في الفيديو تلقائيا: ",
"Visual preferences": "التفضيلات المرئية",
"Player style: ": "شكل مشغل الفيديوهات: ",
"Dark mode: ": "الوضع الليلى: ",
"Theme: ": "المظهر: ",
"dark": "غامق (اسود)",
"light": "فاتح (ابيض)",
"Thin mode: ": "الوضع الخفيف: ",
"Subscription preferences": "تفضيلات الإشتراك",
"Show annotations by default for subscribed channels? ": "عرض الملاحظات فى الفيديوهات تلقائيا فى القنوات المشترك بها فقط ؟",
"Show annotations by default for subscribed channels: ": "عرض الملاحظات في الفيديوهات تلقائيا في القنوات المشترك بها فقط: ",
"Redirect homepage to feed: ": "إعادة التوجية من الصفحة الرئيسية لصفحة المشتركين (لرؤية اخر فيديوهات المشتركين): ",
"Number of videos shown in feed: ": "عدد الفيديوهات التى ستظهر فى صفحة المشتركين: ",
"Sort videos by: ": "ترتيب الفيديو بـ: ",
@@ -85,9 +90,9 @@
"Only show latest unwatched video from channel: ": "فقط اظهر اخر فيديو لم يتم رؤيتة من القناة: ",
"Only show unwatched: ": "فقط اظهر الذى لم يتم رؤيتة: ",
"Only show notifications (if there are any): ": "إظهار الإشعارات فقط (إذا كان هناك أي): ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "تفعيل إشعارات المتصفح",
"`x` uploaded a video": "`x` رفع فيديو",
"`x` is live": "`x` فى بث مباشر",
"Data preferences": "إعدادات التفضيلات",
"Clear watch history": "حذف سجل المشاهدة",
"Import/export data": "إضافة\\إستخراج البيانات",
@@ -98,12 +103,12 @@
"Delete account": "حذف الحساب",
"Administrator preferences": "إعدادات المدير",
"Default homepage: ": "الصفحة الرئيسية الافتراضية ",
"Feed menu: ": "قائمة التغذية",
"Top enabled? ": "تفعيل 'الأفضل' ؟ ",
"CAPTCHA enabled? ": "تفعيل الكابتشا ؟",
"Login enabled? ": "تفعيل تسجيل الدخول ؟",
"Registration enabled? ": "تفعيل التسجيل ؟",
"Report statistics? ": "إبلاغ الإحصائيات",
"Feed menu: ": "قائمة التدفقات: ",
"Top enabled: ": "تفعيل 'الأفضل' ؟ ",
"CAPTCHA enabled: ": "تفعيل الكابتشا: ",
"Login enabled: ": "تفعيل الولوج: ",
"Registration enabled: ": "تفعيل التسجيل: ",
"Report statistics: ": "الإبلاغ عن الإحصائيات: ",
"Save preferences": "حفظ التفضيلات",
"Subscription manager": "مدير الإشتراكات",
"Token manager": "إداره الرمز",
@@ -114,15 +119,25 @@
"unsubscribe": "إلغاء الإشتراك",
"revoke": "مسح",
"Subscriptions": "الإشتراكات",
"`x` unseen notifications": "`x` إشعارات لم تشاهدها بعد ",
"`x` unseen notifications": "`x` إشعارات لم تشاهدها بعد",
"search": "بحث",
"Log out": "تسجيل الخروج",
"Released under the AGPLv3 by Omar Roth.": "تم الإنشاء تحت AGPLv3 بواسطة عمر روث.",
"Source available here.": "الأكواد متوفرة هنا.",
"View JavaScript license information.": "مشاهدة معلومات حول تراخيص الجافاسكريبت.",
"View privacy policy.": "عرض سياسة الخصوصية",
"View privacy policy.": "عرض سياسة الخصوصية.",
"Trending": "الشائع",
"Public": "عام",
"Unlisted": "غير مصنف",
"Private": "خاص",
"View all playlists": "عرض جميع قوائم التشغيل",
"Updated `x` ago": "تم تحديثه منذ `x`",
"Delete playlist `x`?": "حذف قائمه التشغيل `x` ?",
"Delete playlist": "حذف قائمه التغشيل",
"Create playlist": "إنشاء قائمه تشغيل",
"Title": "العنوان",
"Playlist privacy": "إعدادات الخصوصيه",
"Editing playlist `x`": "تعديل قائمه التشفيل `x`",
"Watch on YouTube": "مشاهدة الفيديو على اليوتيوب",
"Hide annotations": "إخفاء الملاحظات فى الفيديو",
"Show annotations": "عرض الملاحظات فى الفيديو",
@@ -134,8 +149,9 @@
"Whitelisted regions: ": "الدول المسموح فيها هذا الفيديو: ",
"Blacklisted regions: ": "الدول الحظور فيها هذا الفيديو: ",
"Shared `x`": "شارك منذ `x`",
"`x` views": "`x` مشاهدون",
"`x` views": "`x` مشاهدات",
"Premieres in `x`": "يعرض فى `x`",
"Premieres `x`": "يعرض `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "اهلا! يبدو ان الجافاسكريبت معطلة. اضغط هنا لعرض التعليقات, ضع فى إعتبارك انها ستأخذ وقت اطول للعرض.",
"View YouTube comments": "عرض تعليقات اليوتيوب",
"View more comments on Reddit": "عرض المزيد من التعليقات على\\من موقع Reddit",
@@ -292,27 +308,29 @@
"`x` hours": "`x` ساعات",
"`x` minutes": "`x` دقائق",
"`x` seconds": "`x` ثوانى",
"Fallback comments: ": "التعليقات المصاحبة",
"Popular": "لاكثر شعبية",
"Fallback comments: ": "التعليقات البديلة: ",
"Popular": "الأكثر شعبية",
"Top": "الأفضل",
"About": "حول",
"Rating: ": "التقييم",
"Language: ": "اللغة",
"Rating: ": "التقييم: ",
"Language: ": "اللغة: ",
"View as playlist": "عرض كا قائمة التشغيل",
"Default": "الكل",
"Music": "الاغانى",
"Gaming": "الألعاب",
"News": "الأخبار",
"Movies": "الأفلام",
"Download": "تحميل كـ",
"Download as: ": "تحميل",
"%A %B %-d, %Y": "",
"Download": "نزّل",
"Download as: ": "نزّله كـ: ",
"%A %B %-d, %Y": "%A %-d %B %Y",
"(edited)": "(تم تعديلة)",
"YouTube comment permalink": "رابط التعليق على اليوتيوب",
"permalink": "الرابط",
"`x` marked it with a ❤": "`x` اعجب بهذا",
"Audio mode": "الوضع الصوتى",
"Video mode": "وضع الفيديو",
"Videos": "الفيديوهات",
"Playlists": "قوائم التشغيل",
"Current version: ": "الإصدار الحالى"
}
"Community": "المجتمع",
"Current version: ": "الإصدار الحالي: "
}

View File

@@ -1,6 +1,7 @@
{
"`x` subscribers": "`x` Abonnenten",
"`x` videos": "`x` Videos",
"`x` playlists": "",
"LIVE": "LIVE",
"Shared `x` ago": "Vor `x` geteilt",
"Unsubscribe": "Abbestellen",
@@ -15,13 +16,13 @@
"Previous page": "Vorherige Seite",
"Clear watch history?": "Verlauf löschen?",
"New password": "Neues Passwort",
"New passwords must match": "Neue Passwörter müssen übereinstimmen",
"Cannot change password for Google accounts": "Das Passwort für Google -Konten kann nicht geändert werden",
"New passwords must match": "Neue Passwörter müssen gleich sein",
"Cannot change password for Google accounts": "Ich kann das Passwort deines Google Kontos nicht ändern",
"Authorize token?": "Token autorisieren?",
"Authorize token for `x`?": "Token für `x` autorisieren?",
"Yes": "Ja",
"No": "Nein",
"Import and Export Data": "Import und Export Daten",
"Import and Export Data": "Daten importieren und exportieren",
"Import": "Importieren",
"Import Invidious data": "Invidious Daten importieren",
"Import YouTube subscriptions": "YouTube Abonnements importieren",
@@ -39,39 +40,43 @@
"source": "Quelle",
"Log in": "Einloggen",
"Log in/register": "Einloggen/Registrieren",
"Log in with Google": "In Google einloggen",
"Log in with Google": "Mit Google einloggen",
"User ID": "Benutzer ID",
"Password": "Passwort",
"Time (h:mm:ss):": "Zeit (h:mm:ss):",
"Text CAPTCHA": "Text CAPTCHA",
"Image CAPTCHA": "Image CAPTCHA",
"Sign In": "Einloggen",
"Image CAPTCHA": "Bild CAPTCHA",
"Sign In": "Anmelden",
"Register": "Registrieren",
"E-mail": "Email",
"Google verification code": "Google Bestätigungscode",
"E-mail": "E-Mail",
"Google verification code": "Google-Bestätigungscode",
"Preferences": "Einstellungen",
"Player preferences": "Playereinstellungen",
"Player preferences": "Wiedergabeeinstellungen",
"Always loop: ": "Immer wiederholen: ",
"Autoplay: ": "Automatisch abspielen: ",
"Play next by default: ": "Standardmäßig als nächstes abspielen: ",
"Play next by default: ": "Immer automatisch nächstes Video spielen: ",
"Autoplay next video: ": "nächstes Video automatisch abspielen: ",
"Listen by default: ": "Nur Ton als Standard: ",
"Proxy videos? ": "Proxy-Videos? ",
"Proxy videos: ": "Proxy-Videos: ",
"Default speed: ": "Standardgeschwindigkeit: ",
"Preferred video quality: ": "Bevorzugte Videoqualität: ",
"Player volume: ": "Playerlautstärke: ",
"Player volume: ": "Wiedergabelautstärke: ",
"Default comments: ": "Standardkommentare: ",
"youtube": "youtube",
"reddit": "reddit",
"Default captions: ": "Standarduntertitel: ",
"Fallback captions: ": "Ersatzuntertitel: ",
"Show related videos? ": "Ähnliche Videos anzeigen? ",
"Show annotations by default? ": "Standardmäßig Anmerkungen anzeigen? ",
"Show related videos: ": "Ähnliche Videos anzeigen? ",
"Show annotations by default: ": "Standardmäßig Anmerkungen anzeigen? ",
"Visual preferences": "Anzeigeeinstellungen",
"Player style: ": "Abspielgeräterstil: ",
"Dark mode: ": "Nachtmodus: ",
"Theme: ": "Modus: ",
"dark": "Nachtmodus",
"light": "klarer Modus",
"Thin mode: ": "Schlanker Modus: ",
"Subscription preferences": "Abonnementeinstellungen",
"Show annotations by default for subscribed channels? ": "Anmerkungen für abonnierte Kanäle standardmäßig anzeigen? ",
"Show annotations by default for subscribed channels: ": "Anmerkungen für abonnierte Kanäle standardmäßig anzeigen? ",
"Redirect homepage to feed: ": "Startseite zu Feed umleiten: ",
"Number of videos shown in feed: ": "Anzahl von Videos die im Feed angezeigt werden: ",
"Sort videos by: ": "Videos sortieren nach: ",
@@ -85,28 +90,28 @@
"Only show latest unwatched video from channel: ": "Nur neueste ungesehene Videos des Kanals anzeigen: ",
"Only show unwatched: ": "Nur ungesehene anzeigen: ",
"Only show notifications (if there are any): ": "Nur Benachrichtigungen anzeigen (wenn es welche gibt): ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "Webbenachrichtigungen aktivieren",
"`x` uploaded a video": "`x` hat ein Video hochgeladen",
"`x` is live": "`x` ist live",
"Data preferences": "Dateneinstellungen",
"Clear watch history": "Verlauf löschen",
"Import/export data": "Daten im- exportieren",
"Import/export data": "Daten im-/exportieren",
"Change password": "Passwort ändern",
"Manage subscriptions": "Abonnements verwalten",
"Manage tokens": "Token verwalten",
"Manage tokens": "Tokens verwalten",
"Watch history": "Verlauf",
"Delete account": "Account löschen",
"Administrator preferences": "Administratoreinstellungen",
"Default homepage: ": "Standard-Homepage: ",
"Administrator preferences": "Administrator-Einstellungen",
"Default homepage: ": "Standard-Startseite: ",
"Feed menu: ": "Feed-Menü: ",
"Top enabled? ": "Top aktiviert? ",
"CAPTCHA enabled? ": "CAPTCHA aktiviert? ",
"Login enabled? ": "Login aktiviert? ",
"Registration enabled? ": "Registrierung aktiviert? ",
"Report statistics? ": "Statistiken berichten? ",
"Top enabled: ": "Top aktiviert? ",
"CAPTCHA enabled: ": "CAPTCHA aktiviert? ",
"Login enabled: ": "Login aktiviert? ",
"Registration enabled: ": "Registrierung aktiviert? ",
"Report statistics: ": "Statistiken berichten? ",
"Save preferences": "Einstellungen speichern",
"Subscription manager": "Abonnementverwaltung",
"Token manager": "Token-Manager",
"Token manager": "Tokenverwalter",
"Token": "Token",
"`x` subscriptions": "`x` Abonnements",
"`x` tokens": "`x` Tokens",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Javascript Lizenzinformationen anzeigen.",
"View privacy policy.": "Datenschutzerklärung einsehen.",
"Trending": "Trending",
"Public": "",
"Unlisted": "Nicht aufgeführt",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Video auf YouTube ansehen",
"Hide annotations": "Anmerkungen ausblenden",
"Show annotations": "Anmerkungen anzeigen",
@@ -134,8 +149,9 @@
"Whitelisted regions: ": "Erlaubte Regionen: ",
"Blacklisted regions: ": "Unerlaubte Regionen: ",
"Shared `x`": "Geteilt `x`",
"`x` views": "`x` Ansichten",
"Premieres in `x`": "Premieren in `x`",
"`x` views": "`x` Aufrufe",
"Premieres in `x`": "Zuerst gesehen in `x`",
"Premieres `x`": "Erster Start `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Hallo! Anscheinend haben Sie JavaScript deaktiviert. Klicken Sie hier um Kommentare anzuzeigen, beachten sie dass es etwas länger dauern kann um sie zu laden.",
"View YouTube comments": "YouTube Kommentare anzeigen",
"View more comments on Reddit": "Mehr Kommentare auf Reddit anzeigen",
@@ -176,9 +192,9 @@
"Hidden field \"challenge\" is a required field": "Verstecktes Feld \"challenge\" ist eine erforderliche Eingabe",
"Hidden field \"token\" is a required field": "Verstecktes Feld \"token\" ist eine erforderliche Eingabe",
"Erroneous challenge": "Ungültiger Test",
"Erroneous token": "Ungöltige Marke",
"Erroneous token": "Ungültiger Token",
"No such user": "Ungültiger Benutzer",
"Token is expired, please try again": "Marke ist abgelaufen, bitte erneut versuchen",
"Token is expired, please try again": "Token ist abgelaufen, bitte erneut versuchen",
"English": "Englisch",
"English (auto-generated)": "Englisch (automatisch erzeugt)",
"Afrikaans": "Afrikaans",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(editiert)",
"YouTube comment permalink": "YouTube-Kommentar Permalink",
"permalink": "Permalink",
"`x` marked it with a ❤": "`x` markierte es mit einem ❤",
"Audio mode": "Audiomodus",
"Video mode": "Videomodus",
"Videos": "Videos",
"Playlists": "Wiedergabelisten",
"Community": "Gemeinschaft",
"Current version: ": "Aktuelle Version: "
}
}

View File

@@ -1,12 +1,13 @@
{
"`x` subscribers": {
"(\\D|^)1(\\D|$)": "`x` συνδρομητής",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` συνδρομητής",
"": "`x` συνδρομητές"
},
"`x` videos": {
"(\\D|^)1(\\D|$)": "`x` βίντεο",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` βίντεο",
"": "`x` βίντεο"
},
"`x` playlists": "",
"LIVE": "ΖΩΝΤΑΝΑ",
"Shared `x` ago": "Μοιράστηκε πριν `x`",
"Unsubscribe": "Απεγγραφή",
@@ -62,7 +63,7 @@
"Play next by default: ": "Αναπαραγωγή επόμενου: ",
"Autoplay next video: ": "Αυτόματη αναπαραγωγή επόμενου: ",
"Listen by default: ": "Φόρτωση μόνο ήχου: ",
"Proxy videos? ": "Αναπαραγωγή με διακομιστή μεσολάβησης (proxy): ",
"Proxy videos: ": "Αναπαραγωγή με διακομιστή μεσολάβησης (proxy): ",
"Default speed: ": "Προεπιλεγμένη ταχύτητα: ",
"Preferred video quality: ": "Προτιμώμενη ανάλυση: ",
"Player volume: ": "Ένταση αναπαραγωγής: ",
@@ -71,13 +72,17 @@
"reddit": "reddit",
"Default captions: ": "Προεπιλεγμένοι υπότιτλοι: ",
"Fallback captions: ": "Εναλλακτικοί υπότιτλοι: ",
"Show related videos? ": "Προβολή σχετικών βίντεο; ",
"Show annotations by default? ": "Αυτόματη προβολή σημειώσεων; :",
"Show related videos: ": "Προβολή σχετικών βίντεο; ",
"Show annotations by default: ": "Αυτόματη προβολή σημειώσεων; :",
"Visual preferences": "Προτιμήσεις εμφάνισης",
"Player style: ": "",
"Dark mode: ": "Σκοτεινή λειτουργία: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Ελαφριά λειτουργία: ",
"Subscription preferences": "Προτιμήσεις συνδρομών",
"Show annotations by default for subscribed channels? ": "Προβολή σημειώσεων μόνο για κανάλια στα οποία είστε συνδρομητής; ",
"Show annotations by default for subscribed channels: ": "Προβολή σημειώσεων μόνο για κανάλια στα οποία είστε συνδρομητής; ",
"Redirect homepage to feed: ": "Ανακατεύθυνση αρχικής στη ροή συνδρομών: ",
"Number of videos shown in feed: ": "Αριθμός βίντεο ανά σελίδα ροής συνδρομών: ",
"Sort videos by: ": "Ταξινόμηση ανά: ",
@@ -105,21 +110,21 @@
"Administrator preferences": "Προτιμήσεις διαχειριστή",
"Default homepage: ": "Προεπιλεγμένη αρχική: ",
"Feed menu: ": "Μενού ροής συνδρομών: ",
"Top enabled? ": "Ενεργοποίηση κορυφαίων; ",
"CAPTCHA enabled? ": "Ενεργοποίηση CAPTCHA; ",
"Login enabled? ": "Ενεργοποίηση σύνδεσης; ",
"Registration enabled? ": "Ενεργοποίηση εγγραφής; ",
"Report statistics? ": "Αναφορά στατιστικών; ",
"Top enabled: ": "Ενεργοποίηση κορυφαίων; ",
"CAPTCHA enabled: ": "Ενεργοποίηση CAPTCHA; ",
"Login enabled: ": "Ενεργοποίηση σύνδεσης; ",
"Registration enabled: ": "Ενεργοποίηση εγγραφής; ",
"Report statistics: ": "Αναφορά στατιστικών; ",
"Save preferences": "Αποθήκευση προτιμήσεων",
"Subscription manager": "Διαχειριστής συνδρομών",
"Token manager": "Διαχειριστής διασυνδέσεων",
"Token": "Διασύνδεση",
"`x` subscriptions": {
"(\\D|^)1(\\D|$)": "`x` συνδρομή",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` συνδρομή",
"": "`x` συνδρομές"
},
"`x` tokens": {
"(\\D|^)1(\\D|$)": "`x` διασύνδεση",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` διασύνδεση",
"": "`x` διασυνδέσεις"
},
"Import/export": "Εισαγωγή/εξαγωγή",
@@ -127,7 +132,7 @@
"revoke": "ανάκληση",
"Subscriptions": "Συνδρομές",
"`x` unseen notifications": {
"(\\D|^)1(\\D|$)": "`x` καινούρια ειδοποίηση",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` καινούρια ειδοποίηση",
"": "`x` καινούριες ειδοποιήσεις"
},
"search": "αναζήτηση",
@@ -137,7 +142,17 @@
"View JavaScript license information.": "Προβολή πληροφοριών άδειας JavaScript.",
"View privacy policy.": "Προβολή πολιτικής απορρήτου.",
"Trending": "Τάσεις",
"Public": "",
"Unlisted": "Κρυφό",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Προβολή στο YouTube",
"Hide annotations": "Απόκρυψη σημειώσεων",
"Show annotations": "Προβολή σημειώσεων",
@@ -150,10 +165,11 @@
"Blacklisted regions: ": "Μη-επιτρεπτές περιοχές: ",
"Shared `x`": "Μοιράστηκε το `x`",
"`x` views": {
"(\\D|^)1(\\D|$)": "`x` προβολή",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` προβολή",
"": "`x` προβολές"
},
"Premieres in `x`": "Πρώτη προβολή σε `x`",
"Premieres `x`": "",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Γεια! Φαίνεται πως έχετε απενεργοποιήσει το JavaScript. Πατήστε εδώ για προβολή σχολίων, αλλά έχετε υπ'όψιν σας πως ίσως φορτώσουν πιο αργά. ",
"View YouTube comments": "Προβολή σχολίων από το YouTube",
"View more comments on Reddit": "Προβολή περισσότερων σχολίων στο Reddit",
@@ -183,13 +199,13 @@
"Could not get channel info.": "Αδύναμια εύρεσης πληροφοριών καναλιού.",
"Could not fetch comments": "Αδυναμία λήψης σχολίων",
"View `x` replies": {
"(\\D|^)1(\\D|$)": "Προβολή `x` απάντησης",
"([^.,0-9]|^)1([^.,0-9]|$)": "Προβολή `x` απάντησης",
"": "Προβολή `x` απαντήσεων"
},
"`x` ago": "Πριν `x`",
"Load more": "Φόρτωση περισσότερων",
"`x` points": {
"(\\D|^)1(\\D|$)": "`x` βαθμός",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` βαθμός",
"": "`x` βαθμοί"
},
"Could not create mix.": "Αδυναμία δημιουργίας μίξης.",
@@ -310,31 +326,31 @@
"Yoruba": "Γιορούμπα",
"Zulu": "Ζουλού",
"`x` years": {
"(\\D|^)1(\\D|$)": "`x` χρόνο",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` χρόνο",
"": "`x` χρόνια"
},
"`x` months": {
"(\\D|^)1(\\D|$)": "`x` μήνα",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` μήνα",
"": "`x` μήνες"
},
"`x` weeks": {
"(\\D|^)1(\\D|$)": "`x` εβδομάδα",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` εβδομάδα",
"": "`x` εβδομάδες"
},
"`x` days": {
"(\\D|^)1(\\D|$)": "`x` ημέρα",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` ημέρα",
"": "`x` ημέρες"
},
"`x` hours": {
"(\\D|^)1(\\D|$)": "`x` ώρα",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` ώρα",
"": "`x` ώρες"
},
"`x` minutes": {
"(\\D|^)1(\\D|$)": "`x` λεπτό",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` λεπτό",
"": "`x` λεπτά"
},
"`x` seconds": {
"(\\D|^)1(\\D|$)": "`x` δευτερόλεπτο",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` δευτερόλεπτο",
"": "`x` δευτερόλεπτα"
},
"Fallback comments: ": "Εναλλακτικά σχόλια: ",
@@ -354,10 +370,12 @@
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(τροποποιημένο)",
"YouTube comment permalink": "Σύνδεσμος YouTube σχολίου",
"permalink": "",
"`x` marked it with a ❤": "Ο χρηστης `x` έβαλε ❤",
"Audio mode": "Λειτουργία ήχου",
"Video mode": "Λειτουργία βίντεο",
"Videos": "Βίντεο",
"Playlists": "Λίστες Αναπαραγωγής",
"Community": "",
"Current version: ": "Τρέχουσα έκδοση: "
}

View File

@@ -1,12 +1,16 @@
{
"`x` subscribers": {
"(\\D|^)1(\\D|$)": "`x` subscriber",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` subscriber",
"": "`x` subscribers"
},
"`x` videos": {
"(\\D|^)1(\\D|$)": "`x` video",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` video",
"": "`x` videos"
},
"`x` playlists": {
"(\\D|^)1(\\D|$)": "`x` playlist",
"": "`x` playlists"
},
"LIVE": "LIVE",
"Shared `x` ago": "Shared `x` ago",
"Unsubscribe": "Unsubscribe",
@@ -62,7 +66,7 @@
"Play next by default: ": "Play next by default: ",
"Autoplay next video: ": "Autoplay next video: ",
"Listen by default: ": "Listen by default: ",
"Proxy videos? ": "Proxy videos? ",
"Proxy videos: ": "Proxy videos: ",
"Default speed: ": "Default speed: ",
"Preferred video quality: ": "Preferred video quality: ",
"Player volume: ": "Player volume: ",
@@ -71,13 +75,17 @@
"reddit": "reddit",
"Default captions: ": "Default captions: ",
"Fallback captions: ": "Fallback captions: ",
"Show related videos? ": "Show related videos? ",
"Show annotations by default? ": "Show annotations by default? ",
"Show related videos: ": "Show related videos: ",
"Show annotations by default: ": "Show annotations by default: ",
"Visual preferences": "Visual preferences",
"Player style: ": "Player style: ",
"Dark mode: ": "Dark mode: ",
"Theme: ": "Theme: ",
"dark": "dark",
"light": "light",
"Thin mode: ": "Thin mode: ",
"Subscription preferences": "Subscription preferences",
"Show annotations by default for subscribed channels? ": "Show annotations by default for subscribed channels? ",
"Show annotations by default for subscribed channels: ": "Show annotations by default for subscribed channels? ",
"Redirect homepage to feed: ": "Redirect homepage to feed: ",
"Number of videos shown in feed: ": "Number of videos shown in feed: ",
"Sort videos by: ": "Sort videos by: ",
@@ -105,21 +113,21 @@
"Administrator preferences": "Administrator preferences",
"Default homepage: ": "Default homepage: ",
"Feed menu: ": "Feed menu: ",
"Top enabled? ": "Top enabled? ",
"CAPTCHA enabled? ": "CAPTCHA enabled? ",
"Login enabled? ": "Login enabled? ",
"Registration enabled? ": "Registration enabled? ",
"Report statistics? ": "Report statistics? ",
"Top enabled: ": "Top enabled: ",
"CAPTCHA enabled: ": "CAPTCHA enabled: ",
"Login enabled: ": "Login enabled: ",
"Registration enabled: ": "Registration enabled: ",
"Report statistics: ": "Report statistics: ",
"Save preferences": "Save preferences",
"Subscription manager": "Subscription manager",
"Token manager": "Token manager",
"Token": "Token",
"`x` subscriptions": {
"(\\D|^)1(\\D|$)": "`x` subscription",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` subscription",
"": "`x` subscriptions"
},
"`x` tokens": {
"(\\D|^)1(\\D|$)": "`x` token",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` token",
"": "`x` tokens"
},
"Import/export": "Import/export",
@@ -127,7 +135,7 @@
"revoke": "revoke",
"Subscriptions": "Subscriptions",
"`x` unseen notifications": {
"(\\D|^)1(\\D|$)": "`x` unseen notification",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` unseen notification",
"": "`x` unseen notifications"
},
"search": "search",
@@ -137,7 +145,17 @@
"View JavaScript license information.": "View JavaScript license information.",
"View privacy policy.": "View privacy policy.",
"Trending": "Trending",
"Public": "Public",
"Unlisted": "Unlisted",
"Private": "Private",
"View all playlists": "View all playlists",
"Updated `x` ago": "Updated `x` ago",
"Delete playlist `x`?": "Delete playlist `x`?",
"Delete playlist": "Delete playlist",
"Create playlist": "Create playlist",
"Title": "Title",
"Playlist privacy": "Playlist privacy",
"Editing playlist `x`": "Editing playlist `x`",
"Watch on YouTube": "Watch on YouTube",
"Hide annotations": "Hide annotations",
"Show annotations": "Show annotations",
@@ -150,14 +168,18 @@
"Blacklisted regions: ": "Blacklisted regions: ",
"Shared `x`": "Shared `x`",
"`x` views": {
"(\\D|^)1(\\D|$)": "`x` views",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` view",
"": "`x` views"
},
"Premieres in `x`": "Premieres in `x`",
"Premieres `x`": "Premieres `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.",
"View YouTube comments": "View YouTube comments",
"View more comments on Reddit": "View more comments on Reddit",
"View `x` comments": "View `x` comments",
"View `x` comments": {
"(\\D|^)1(\\D|$)": "View `x` comment",
"": "View `x` comments"
},
"View Reddit comments": "View Reddit comments",
"Hide replies": "Hide replies",
"Show replies": "Show replies",
@@ -183,13 +205,13 @@
"Could not get channel info.": "Could not get channel info.",
"Could not fetch comments": "Could not fetch comments",
"View `x` replies": {
"(\\D|^)1(\\D|$)": "View `x` reply",
"([^.,0-9]|^)1([^.,0-9]|$)": "View `x` reply",
"": "View `x` replies"
},
"`x` ago": "`x` ago",
"Load more": "Load more",
"`x` points": {
"(\\D|^)1(\\D|$)": "`x` point",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` point",
"": "`x` points"
},
"Could not create mix.": "Could not create mix.",
@@ -310,31 +332,31 @@
"Yoruba": "Yoruba",
"Zulu": "Zulu",
"`x` years": {
"(\\D|^)1(\\D|$)": "`x` year",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` year",
"": "`x` years"
},
"`x` months": {
"(\\D|^)1(\\D|$)": "`x` month",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` month",
"": "`x` months"
},
"`x` weeks": {
"(\\D|^)1(\\D|$)": "`x` week",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` week",
"": "`x` weeks"
},
"`x` days": {
"(\\D|^)1(\\D|$)": "`x` day",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` day",
"": "`x` days"
},
"`x` hours": {
"(\\D|^)1(\\D|$)": "`x` hour",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` hour",
"": "`x` hours"
},
"`x` minutes": {
"(\\D|^)1(\\D|$)": "`x` minute",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` minute",
"": "`x` minutes"
},
"`x` seconds": {
"(\\D|^)1(\\D|$)": "`x` second",
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` second",
"": "`x` seconds"
},
"Fallback comments: ": "Fallback comments: ",
@@ -354,10 +376,12 @@
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(edited)",
"YouTube comment permalink": "YouTube comment permalink",
"permalink": "permalink",
"`x` marked it with a ❤": "`x` marked it with a ❤",
"Audio mode": "Audio mode",
"Video mode": "Video mode",
"Videos": "Videos",
"Playlists": "Playlists",
"Community": "Community",
"Current version: ": "Current version: "
}

View File

@@ -1,6 +1,7 @@
{
"`x` subscribers": "`x` abonantoj",
"`x` videos": "`x` videoj",
"`x` playlists": "",
"LIVE": "NUNA",
"Shared `x` ago": "Konigita antaŭ `x`",
"Unsubscribe": "Malaboni",
@@ -56,7 +57,7 @@
"Play next by default: ": "Ludi sekvan defaŭlte: ",
"Autoplay next video: ": "Aŭtomate ludi sekvan videon: ",
"Listen by default: ": "Aŭskulti defaŭlte: ",
"Proxy videos? ": "Ĉu uzi prokuran servilon por videoj? ",
"Proxy videos: ": "Ĉu uzi prokuran servilon por videoj? ",
"Default speed: ": "Defaŭlta rapido: ",
"Preferred video quality: ": "Preferita videkvalito: ",
"Player volume: ": "Ludila sonforteco: ",
@@ -65,13 +66,17 @@
"reddit": "reddit",
"Default captions: ": "Defaŭltaj subtekstoj: ",
"Fallback captions: ": "Retrodefaŭltaj subtekstoj: ",
"Show related videos? ": "Ĉu montri rilatajn videojn? ",
"Show annotations by default? ": "Ĉu montri prinotojn defaŭlte? ",
"Show related videos: ": "Ĉu montri rilatajn videojn? ",
"Show annotations by default: ": "Ĉu montri prinotojn defaŭlte? ",
"Visual preferences": "Vidaj preferoj",
"Player style: ": "Ludila stilo: ",
"Dark mode: ": "Malhela reĝimo: ",
"Theme: ": "Etoso: ",
"dark": "malhela",
"light": "hela",
"Thin mode: ": "Maldika reĝimo: ",
"Subscription preferences": "Abonaj agordoj",
"Show annotations by default for subscribed channels? ": "Ĉu montri prinotojn defaŭlte por abonitaj kanaloj? ",
"Show annotations by default for subscribed channels: ": "Ĉu montri prinotojn defaŭlte por abonitaj kanaloj? ",
"Redirect homepage to feed: ": "Alidirekti hejmpâgon al fluo: ",
"Number of videos shown in feed: ": "Nombro da videoj montritaj en fluo: ",
"Sort videos by: ": "Ordi videojn laŭ: ",
@@ -99,11 +104,11 @@
"Administrator preferences": "Agordoj de administranto",
"Default homepage: ": "Defaŭlta hejmpaĝo: ",
"Feed menu: ": "Flua menuo: ",
"Top enabled? ": "Ĉu pli bonaj ŝaltitaj? ",
"CAPTCHA enabled? ": "Ĉu CAPTCHA ŝaltita? ",
"Login enabled? ": "Ĉu ensaluto aktivita? ",
"Registration enabled? ": "Ĉu registriĝo aktivita? ",
"Report statistics? ": "Ĉu raporti statistikojn? ",
"Top enabled: ": "Ĉu pli bonaj ŝaltitaj? ",
"CAPTCHA enabled: ": "Ĉu CAPTCHA ŝaltita? ",
"Login enabled: ": "Ĉu ensaluto aktivita? ",
"Registration enabled: ": "Ĉu registriĝo aktivita? ",
"Report statistics: ": "Ĉu raporti statistikojn? ",
"Save preferences": "Konservi agordojn",
"Subscription manager": "Administrilo de abonoj",
"Token manager": "Ĵetona administrilo",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Vidi Ĝavoskriptan licencan informon.",
"View privacy policy.": "Vidi regularon pri privateco.",
"Trending": "Tendencoj",
"Public": "",
"Unlisted": "Ne listigita",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Vidi videon en Youtube",
"Hide annotations": "Kaŝi prinotojn",
"Show annotations": "Montri prinotojn",
@@ -136,6 +151,7 @@
"Shared `x`": "Konigita `x`",
"`x` views": "`x` spektaĵoj",
"Premieres in `x`": "Premieras en `x`",
"Premieres `x`": "Premieras `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Saluton! Ŝajnas, ke vi havas Ĝavoskripton malebligitan. Klaku ĉi tie por vidi komentojn, memoru, ke la ŝargado povus daŭri iom pli.",
"View YouTube comments": "Vidi komentojn de YouTube",
"View more comments on Reddit": "Vidi pli komentoj en Reddit",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "%A %-d de %B %Y",
"(edited)": "(redaktita)",
"YouTube comment permalink": "Fiksligilo de la komento en YouTube",
"permalink": "konstanta ligilo",
"`x` marked it with a ❤": "`x` markis ĝin per ❤",
"Audio mode": "Aŭda reĝimo",
"Video mode": "Videa reĝimo",
"Videos": "Videoj",
"Playlists": "Ludlistoj",
"Community": "Komunumo",
"Current version: ": "Nuna versio: "
}
}

View File

@@ -1,12 +1,13 @@
{
"`x` subscribers": "`x` suscriptores",
"`x` videos": "`x` vídeos",
"`x` playlists": "",
"LIVE": "DIRECTO",
"Shared `x` ago": "Compartido hace `x`",
"Unsubscribe": "Desuscribirse",
"Subscribe": "Suscribirse",
"View channel on YouTube": "Ver el canal en YouTube",
"View playlist on YouTube": "",
"View playlist on YouTube": "Ver lista de reproducción en YouTube",
"newest": "más nuevos",
"oldest": "más viejos",
"popular": "populares",
@@ -56,7 +57,7 @@
"Play next by default: ": "Reproducir siguiente por defecto: ",
"Autoplay next video: ": "Reproducir automáticamente el vídeo siguiente: ",
"Listen by default: ": "Activar el sonido por defecto: ",
"Proxy videos? ": "¿Usar un proxy para los vídeos? ",
"Proxy videos: ": "¿Usar un proxy para los vídeos? ",
"Default speed: ": "Velocidad por defecto: ",
"Preferred video quality: ": "Calidad de vídeo preferida: ",
"Player volume: ": "Volumen del reproductor: ",
@@ -65,13 +66,17 @@
"reddit": "Reddit",
"Default captions: ": "Subtítulos por defecto: ",
"Fallback captions: ": "Subtítulos alternativos: ",
"Show related videos? ": "¿Mostrar vídeos relacionados? ",
"Show annotations by default? ": "¿Mostrar anotaciones por defecto? ",
"Show related videos: ": "¿Mostrar vídeos relacionados? ",
"Show annotations by default: ": "¿Mostrar anotaciones por defecto? ",
"Visual preferences": "Preferencias visuales",
"Player style: ": "",
"Dark mode: ": "Modo oscuro: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Modo compacto: ",
"Subscription preferences": "Preferencias de la suscripción",
"Show annotations by default for subscribed channels? ": "¿Mostrar anotaciones por defecto para los canales suscritos? ",
"Show annotations by default for subscribed channels: ": "¿Mostrar anotaciones por defecto para los canales suscritos? ",
"Redirect homepage to feed: ": "Redirigir la página de inicio a la fuente: ",
"Number of videos shown in feed: ": "Número de vídeos mostrados en la fuente: ",
"Sort videos by: ": "Ordenar los vídeos por: ",
@@ -99,11 +104,11 @@
"Administrator preferences": "Preferencias de administrador",
"Default homepage: ": "Página de inicio por defecto: ",
"Feed menu: ": "Menú de fuentes: ",
"Top enabled? ": "¿Habilitar los destacados? ",
"CAPTCHA enabled? ": "¿Habilitar los CAPTCHA? ",
"Login enabled? ": "¿Habilitar el inicio de sesión? ",
"Registration enabled? ": "¿Habilitar el registro? ",
"Report statistics? ": "¿Enviar estadísticas? ",
"Top enabled: ": "¿Habilitar los destacados? ",
"CAPTCHA enabled: ": "¿Habilitar los CAPTCHA? ",
"Login enabled: ": "¿Habilitar el inicio de sesión? ",
"Registration enabled: ": "¿Habilitar el registro? ",
"Report statistics: ": "¿Enviar estadísticas? ",
"Save preferences": "Guardar las preferencias",
"Subscription manager": "Gestor de suscripciones",
"Token manager": "Gestor de tokens",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Ver información de licencia de JavaScript.",
"View privacy policy.": "Ver la política de privacidad.",
"Trending": "Tendencias",
"Public": "",
"Unlisted": "No listado",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Ver el vídeo en Youtube",
"Hide annotations": "Ocultar anotaciones",
"Show annotations": "Mostrar anotaciones",
@@ -136,6 +151,7 @@
"Shared `x`": "Compartido `x`",
"`x` views": "`x` visualizaciones",
"Premieres in `x`": "Se estrena en `x`",
"Premieres `x`": "",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "¡Hola! Parece que tiene JavaScript desactivado. Haga clic aquí para ver los comentarios, pero tenga en cuenta que pueden tardar un poco más en cargarse.",
"View YouTube comments": "Ver los comentarios de YouTube",
"View more comments on Reddit": "Ver más comentarios en Reddit",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(editado)",
"YouTube comment permalink": "Enlace permanente de YouTube del comentario",
"permalink": "",
"`x` marked it with a ❤": "`x` lo ha marcado con un ❤",
"Audio mode": "Modo de audio",
"Video mode": "Modo de vídeo",
"Videos": "Vídeos",
"Playlists": "Listas de reproducción",
"Community": "",
"Current version: ": "Versión actual: "
}

View File

@@ -1,6 +1,7 @@
{
"`x` subscribers": "`x` harpidedun",
"`x` videos": "`x` bideo",
"`x` playlists": "",
"LIVE": "ZUZENEAN",
"Shared `x` ago": "Duela `x` partekatua",
"Unsubscribe": "Harpidetza kendu",
@@ -56,7 +57,7 @@
"Play next by default: ": "",
"Autoplay next video: ": "",
"Listen by default: ": "",
"Proxy videos? ": "",
"Proxy videos: ": "",
"Default speed: ": "",
"Preferred video quality: ": "",
"Player volume: ": "",
@@ -65,13 +66,17 @@
"reddit": "",
"Default captions: ": "",
"Fallback captions: ": "",
"Show related videos? ": "",
"Show annotations by default? ": "",
"Show related videos: ": "",
"Show annotations by default: ": "",
"Visual preferences": "",
"Player style: ": "",
"Dark mode: ": "",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "",
"Subscription preferences": "",
"Show annotations by default for subscribed channels? ": "",
"Show annotations by default for subscribed channels: ": "",
"Redirect homepage to feed: ": "",
"Number of videos shown in feed: ": "",
"Sort videos by: ": "",
@@ -99,11 +104,11 @@
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Top enabled: ": "",
"CAPTCHA enabled: ": "",
"Login enabled: ": "",
"Registration enabled: ": "",
"Report statistics: ": "",
"Save preferences": "",
"Subscription manager": "",
"Token manager": "",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "",
"View privacy policy.": "",
"Trending": "",
"Public": "",
"Unlisted": "",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "",
"Hide annotations": "",
"Show annotations": "",
@@ -136,6 +151,7 @@
"Shared `x`": "",
"`x` views": "",
"Premieres in `x`": "",
"Premieres `x`": "",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "",
"View YouTube comments": "",
"View more comments on Reddit": "",
@@ -309,8 +325,12 @@
"%A %B %-d, %Y": "",
"(edited)": "",
"YouTube comment permalink": "",
"permalink": "",
"`x` marked it with a ❤": "",
"Audio mode": "",
"Video mode": "",
"Videos": ""
"Videos": "",
"Playlists": "",
"Community": "",
"Current version: ": ""
}

View File

@@ -1,12 +1,13 @@
{
"`x` subscribers": "`x` abonnés",
"`x` videos": "`x` vidéos",
"`x` playlists": "`x` listes de lecture",
"LIVE": "EN DIRECT",
"Shared `x` ago": "Ajoutée il y a `x`",
"Unsubscribe": "Se désabonner",
"Subscribe": "S'abonner",
"View channel on YouTube": "Voir la chaîne sur YouTube",
"View playlist on YouTube": "",
"View playlist on YouTube": "Voir la liste de lecture sur YouTube",
"newest": "Date d'ajout (la plus récente)",
"oldest": "Date d'ajout (la plus ancienne)",
"popular": "Les plus populaires",
@@ -15,8 +16,8 @@
"Previous page": "Page précédente",
"Clear watch history?": "Êtes-vous sûr de vouloir supprimer l'historique des vidéos regardées ?",
"New password": "Nouveau mot de passe",
"New passwords must match": "Les nouveaux mots de passe doivent être identiques",
"Cannot change password for Google accounts": "Le mot de passe d'un compte Google ne peut pas être changé",
"New passwords must match": "Les champs \"Nouveau mot de passe\" doivent être identiques",
"Cannot change password for Google accounts": "Le mot de passe d'un compte Google ne peut pas être changé depuis Invidious",
"Authorize token?": "Autoriser le token ?",
"Authorize token for `x`?": "Autoriser le token pour `x` ?",
"Yes": "Oui",
@@ -29,8 +30,8 @@
"Import NewPipe subscriptions (.json)": "Importer des abonnements NewPipe (.json)",
"Import NewPipe data (.zip)": "Importer des données NewPipe (.zip)",
"Export": "Exporter",
"Export subscriptions as OPML": "Exporter les abonnements en OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Exporter les abonnements en OPML (pour NewPipe & FreeTube)",
"Export subscriptions as OPML": "Exporter les abonnements au format OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Exporter les abonnements au format OPML (pour NewPipe & FreeTube)",
"Export data as JSON": "Exporter les données au format JSON",
"Delete account?": "Êtes-vous sûr de vouloir supprimer votre compte ?",
"History": "Historique",
@@ -52,11 +53,11 @@
"Preferences": "Préférences",
"Player preferences": "Préférences du lecteur",
"Always loop: ": "Lire en boucle : ",
"Autoplay: ": "Lire automatiquement : ",
"Play next by default: ": "Jouer suirvante par défaut : ",
"Autoplay next video: ": "Lire automatiquement la vidéo suivante : ",
"Autoplay: ": "Lancer la lecture automatiquement : ",
"Play next by default: ": "Lire les vidéos suivantes par défaut : ",
"Autoplay next video: ": "Lancer la lecture automatiquement pour la vidéo suivant la vidéo regardée : ",
"Listen by default: ": "Audio uniquement : ",
"Proxy videos? ": "Charger les vidéos à travers un proxy ? ",
"Proxy videos: ": "Charger les vidéos à travers un proxy : ",
"Default speed: ": "Vitesse par défaut : ",
"Preferred video quality: ": "Qualité vidéo souhaitée : ",
"Player volume: ": "Volume du lecteur : ",
@@ -64,16 +65,20 @@
"youtube": "YouTube",
"reddit": "Reddit",
"Default captions: ": "Sous-titres par défaut : ",
"Fallback captions: ": "Sous-titres de repli : ",
"Show related videos? ": "Voir les vidéos liées ? ",
"Show annotations by default? ": "Voir les annotations par défaut ? ",
"Fallback captions: ": "Sous-titres alternatifs : ",
"Show related videos: ": "Voir les vidéos liées : ",
"Show annotations by default: ": "Afficher les annotations par défaut : ",
"Visual preferences": "Préférences du site",
"Dark mode: ": "Mode Sombre : ",
"Thin mode: ": "Mode Simplifié : ",
"Player style: ": "Style du lecteur : ",
"Dark mode: ": "Mode sombre : ",
"Theme: ": "Thème : ",
"dark": "sombre",
"light": "clair",
"Thin mode: ": "Mode léger : ",
"Subscription preferences": "Préférences de la page d'abonnements",
"Show annotations by default for subscribed channels? ": "Voir les annotations par défaut sur les chaînes suivies ? ",
"Show annotations by default for subscribed channels: ": "Afficher les annotations par défaut sur les chaînes auxquelles vous êtes abonnés : ",
"Redirect homepage to feed: ": "Rediriger la page d'accueil vers la page d'abonnements : ",
"Number of videos shown in feed: ": "Nombre de vidéos montrées dans la page d'abonnements : ",
"Number of videos shown in feed: ": "Nombre de vidéos affichées dans la page d'abonnements : ",
"Sort videos by: ": "Trier les vidéos par : ",
"published": "date de publication",
"published - reverse": "date de publication - inversé",
@@ -81,13 +86,13 @@
"alphabetically - reverse": "alphabétiquement - inversé",
"channel name": "nom de la chaîne",
"channel name - reverse": "nom de la chaîne - inversé",
"Only show latest video from channel: ": "Afficher uniquement la dernière vidéo de la chaîne : ",
"Only show latest unwatched video from channel: ": "Afficher uniquement la dernière vidéo de la chaîne non regardée : ",
"Only show unwatched: ": "Afficher uniquement les vidéos non regardées : ",
"Only show latest video from channel: ": "Afficher uniquement la dernière vidéo des chaînes auxquelles vous êtes abonnés : ",
"Only show latest unwatched video from channel: ": "Afficher uniquement la dernière vidéo des chaînes auxquelles vous êtes abonnés qui n'a pas était regardée : ",
"Only show unwatched: ": "Afficher uniquement les vidéos qui n'ont pas étaient regardées : ",
"Only show notifications (if there are any): ": "Afficher uniquement les notifications (s'il y en a) : ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "Activer les notifications web",
"`x` uploaded a video": "`x` a partagé(e) une vidéo",
"`x` is live": "`x` est en direct",
"Data preferences": "Préférences liées aux données",
"Clear watch history": "Supprimer l'historique des vidéos regardées",
"Import/export data": "Importer/exporter les données",
@@ -96,14 +101,14 @@
"Manage tokens": "Gérer les tokens",
"Watch history": "Historique de visionnage",
"Delete account": "Supprimer votre compte",
"Administrator preferences": "Préferences d'Administrateur",
"Administrator preferences": "Préferences d'Administration",
"Default homepage: ": "Page d'accueil par défaut : ",
"Feed menu: ": "Menu des Flux : ",
"Top enabled? ": "Top activé ? ",
"CAPTCHA enabled? ": "CAPTCHA activé ? ",
"Login enabled? ": "Connexion activé ? ",
"Registration enabled? ": "Inscription activée ? ",
"Report statistics? ": "Télémétrie activé ? ",
"Feed menu: ": "Préferences des abonnements : ",
"Top enabled: ": "Top activé : ",
"CAPTCHA enabled: ": "CAPTCHA activé : ",
"Login enabled: ": "Connexion activé : ",
"Registration enabled: ": "Inscription activée : ",
"Report statistics: ": "Télémétrie activé : ",
"Save preferences": "Enregistrer les préférences",
"Subscription manager": "Gestionnaire d'abonnement",
"Token manager": "Gestionnaire de tokens",
@@ -112,30 +117,41 @@
"`x` tokens": "`x` tokens",
"Import/export": "Importer/Exporter",
"unsubscribe": "se désabonner",
"revoke": "annuler",
"revoke": "révoquer",
"Subscriptions": "Abonnements",
"`x` unseen notifications": "`x` notifications non vues",
"search": "Rechercher",
"search": "rechercher",
"Log out": "Déconnexion",
"Released under the AGPLv3 by Omar Roth.": "Publié sous licence AGPLv3 par Omar Roth.",
"Source available here.": "Code Source.",
"View JavaScript license information.": "Voir les informations des licences JavaScript.",
"View privacy policy.": "Voir la politique de confidentialité.",
"Source available here.": "Code source disponible ici.",
"View JavaScript license information.": "Informations des licences JavaScript.",
"View privacy policy.": "Politique de confidentialité.",
"Trending": "Tendances",
"Public": "Publique",
"Unlisted": "Non répertoriée",
"Private": "Privée",
"View all playlists": "Voir toutes vos playlists",
"Updated `x` ago": "Dernière mise à jour il y a `x`",
"Delete playlist `x`?": "Êtes-vous sûr de vouloir supprimer la liste de lecture ?",
"Delete playlist": "Supprimer la liste de lecture",
"Create playlist": "Créer une liste de lecture",
"Title": "Titre",
"Playlist privacy": "Paramètres de confidentialité de la liste de lecture",
"Editing playlist `x`": "Liste de lecture modifier le `x`",
"Watch on YouTube": "Voir la vidéo sur Youtube",
"Hide annotations": "Masquer les annotations",
"Show annotations": "Afficher les annotations",
"Genre: ": "Genre : ",
"License: ": "Licence : ",
"Family friendly? ": "Tout Public ? ",
"Family friendly? ": "Vidéo tout public ? ",
"Wilson score: ": "Score de Wilson : ",
"Engagement: ": "Poucentage de spectateur aillant aimé Like ou Dislike la vidéo : ",
"Whitelisted regions: ": "Régions en liste blanche : ",
"Engagement: ": "Pourcentage de spectateur aillant appuyé sur \"J'aime\" ou \"J'aime Pas\" : ",
"Whitelisted regions: ": "Régions sur liste blanche : ",
"Blacklisted regions: ": "Régions sur liste noire : ",
"Shared `x`": "Ajoutée le `x`",
"`x` views": "`x` vues",
"Premieres in `x`": "Première dans `x`",
"Premieres `x`": "Première le `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Il semblerait que JavaScript soit désactivé. Cliquez ici pour voir les commentaires sans. Gardez à l'esprit que le chargement peut prendre plus de temps.",
"View YouTube comments": "Voir les commentaires YouTube",
"View more comments on Reddit": "Voir plus de commentaires sur Reddit",
@@ -144,8 +160,8 @@
"Hide replies": "Masquer les réponses",
"Show replies": "Afficher les réponses",
"Incorrect password": "Mot de passe incorrect",
"Quota exceeded, try again in a few hours": "Nombre de tentative de connexion dépassé, réessayez dans quelques heures",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "Si vous ne parvenez pas à vous connecter, assurez-vous que l'authentification à deux facteurs (Authenticator ou SMS) est activée.",
"Quota exceeded, try again in a few hours": "Nombre de tentative de connexion dépassée, réessayez dans quelques heures",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "Impossible de se connecter, si après plusieurs tentative vous ne parvenez toujours pas à vous connecter, assurez-vous que l'authentification à deux facteurs (Authenticator ou SMS) est activée.",
"Invalid TFA code": "Code d'authentification à deux facteurs invalide",
"Login failed. This may be because two-factor authentication is not turned on for your account.": "La connexion a échoué. Cela peut être dû au fait que l'authentification à deux facteurs n'est pas activée sur votre compte.",
"Wrong answer": "Réponse invalide",
@@ -166,19 +182,19 @@
"Could not fetch comments": "Impossible de charger les commentaires",
"View `x` replies": "Voir `x` réponses",
"`x` ago": "il y a `x`",
"Load more": "Charger plus",
"Load more": "Voir plus",
"`x` points": "`x` points",
"Could not create mix.": "Impossible de charger cette liste de lecture.",
"Empty playlist": "La liste de lecture est vide",
"Not a playlist.": "Liste de lecture invalide.",
"Not a playlist.": "La liste de lecture est invalide.",
"Playlist does not exist.": "La liste de lecture n'existe pas.",
"Could not pull trending pages.": "Impossible de charger les pages de tendances.",
"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",
"Erroneous token": "Erroneous token",
"No such user": "No such user",
"Token is expired, please try again": "Token is expired, please try again",
"Hidden field \"challenge\" is a required field": "Le champ masqué \"challenge\" est un champ obligatoire",
"Hidden field \"token\" is a required field": "Le champ caché \"token\" est requis",
"Erroneous challenge": "Challenge invalide",
"Erroneous token": "Token invalide",
"No such user": "Cet utilisateur n'existe pas",
"Token is expired, please try again": "Le token est expiré, veuillez réessayer",
"English": "Anglais",
"English (auto-generated)": "Anglais (générés automatiquement)",
"Afrikaans": "Afrikaans",
@@ -292,7 +308,7 @@
"`x` hours": "`x` heures",
"`x` minutes": "`x` minutes",
"`x` seconds": "`x` secondes",
"Fallback comments: ": "Fallback comments: ",
"Fallback comments: ": "Commentaires alternatifs : ",
"Popular": "Populaire",
"Top": "Top",
"About": "À propos",
@@ -308,11 +324,13 @@
"Download as: ": "Télécharger en : ",
"%A %B %-d, %Y": "%A %-d %B %Y",
"(edited)": "(modifié)",
"YouTube comment permalink": "Lien YouTube permanent vers le commentaire",
"YouTube comment permalink": "Lien permanent vers le commentaire sur YouTube",
"permalink": "Lien permanent",
"`x` marked it with a ❤": "`x` l'a marqué d'un ❤",
"Audio mode": "Mode Audio",
"Video mode": "Mode Vidéo",
"Audio mode": "Mode audio",
"Video mode": "Mode vidéo",
"Videos": "Vidéos",
"Playlists": "Liste de lecture",
"Playlists": "Listes de lecture",
"Community": "Communauté",
"Current version: ": "Version actuelle : "
}
}

351
locales/is.json Normal file
View File

@@ -0,0 +1,351 @@
{
"`x` subscribers": "",
"`x` videos": "",
"`x` playlists": "",
"`x` subscribers.": "`x` áskrifandar.",
"`x` videos.": "`x` myndbönd.",
"LIVE": "BEINT",
"Shared `x` ago": "Deilt `x` síðan",
"Unsubscribe": "Afskrá",
"Subscribe": "Áskrifa",
"View channel on YouTube": "Skoða rás á YouTube",
"View playlist on YouTube": "Skoða spilunarlisti á YouTube",
"newest": "nýjasta",
"oldest": "elsta",
"popular": "vinsælt",
"last": "síðast",
"Next page": "Næsta síða",
"Previous page": "Fyrri síða",
"Clear watch history?": "Hreinsa áhorfssögu?",
"New password": "Nýtt lykilorð",
"New passwords must match": "Nýtt lykilorð verður að passa",
"Cannot change password for Google accounts": "Ekki er hægt að breyta lykilorði fyrir Google reikninga",
"Authorize token?": "Leyfa tákn?",
"Authorize token for `x`?": "Leyfa tákn fyrir `x`?",
"Yes": "Já",
"No": "Nei",
"Import and Export Data": "Innflutningur og Útflutningur Gagna",
"Import": "Flytja inn",
"Import Invidious data": "Flytja inn Invidious gögn",
"Import YouTube subscriptions": "Flytja inn YouTube áskriftir",
"Import FreeTube subscriptions (.db)": "Flytja inn FreeTube áskriftir (.db)",
"Import NewPipe subscriptions (.json)": "Flytja inn NewPipe áskriftir (.json)",
"Import NewPipe data (.zip)": "Flytja inn NewPipe gögn (.zip)",
"Export": "Flytja út",
"Export subscriptions as OPML": "Flytja út áskriftir sem OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Flytja út áskriftir sem OPML (fyrir NewPipe & FreeTube)",
"Export data as JSON": "Flytja út gögn sem JSON",
"Delete account?": "Eyða reikningi?",
"History": "Saga",
"An alternative front-end to YouTube": "Önnur framhlið fyrir YouTube",
"JavaScript license information": "JavaScript leyfi upplýsingar",
"source": "uppspretta",
"Log in": "Skrá inn",
"Log in/register": "Innskráning/nýskráning",
"Log in with Google": "Skrá inn með Google",
"User ID": "Notandakenni",
"Password": "Lykilorð",
"Time (h:mm:ss):": "Tími (h:mm: ss):",
"Text CAPTCHA": "Texta CAPTCHA",
"Image CAPTCHA": "Mynd CAPTCHA",
"Sign In": "Skrá inn",
"Register": "Nýskrá",
"E-mail": "Tölvupóstur",
"Google verification code": "Google staðfestingarkóði",
"Preferences": "Kjörstillingar",
"Player preferences": "Kjörstillingar spilara",
"Always loop: ": "Alltaf lykkja: ",
"Autoplay: ": "Spila sjálfkrafa: ",
"Play next by default: ": "Spila næst sjálfgefið: ",
"Autoplay next video: ": "Spila næst sjálfkrafa: ",
"Listen by default: ": "Hlusta sjálfgefið: ",
"Proxy videos: ": "Proxy myndbönd? ",
"Default speed: ": "Sjálfgefinn hraði: ",
"Preferred video quality: ": "Æskilegt myndbands gæði: ",
"Player volume: ": "Spilara hljóðstyrkur: ",
"Default comments: ": "Sjálfgefin ummæli: ",
"youtube": "youtube",
"reddit": "reddit",
"Default captions: ": "Sjálfgefin texti: ",
"Fallback captions: ": "Varatextar: ",
"Show related videos: ": "Sýna tengd myndbönd? ",
"Show annotations by default: ": "Á að sýna glósur sjálfgefið? ",
"Visual preferences": "Sjónrænar stillingar",
"Player style: ": "",
"Dark mode: ": "Myrkur ham: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Þunnt ham: ",
"Subscription preferences": "Áskriftarstillingar",
"Show annotations by default for subscribed channels: ": "Á að sýna glósur sjálfgefið fyrir áskriftarrásir? ",
"Redirect homepage to feed: ": "Endurbeina heimasíðu að straumi: ",
"Number of videos shown in feed: ": "Fjöldi myndbanda sem sýndir eru í straumi: ",
"Sort videos by: ": "Raða myndbönd eftir: ",
"published": "birt",
"published - reverse": "birt - afturábak",
"alphabetically": "í stafrófsröð",
"alphabetically - reverse": "stafrófsröð - afturábak",
"channel name": "heiti rásar",
"channel name - reverse": "heiti rásar - afturábak",
"Only show latest video from channel: ": "Sýna aðeins nýjasta myndband frá rás: ",
"Only show latest unwatched video from channel: ": "Sýna aðeins nýjasta óséð myndband frá rás: ",
"Only show unwatched: ": "Sýna aðeins óséð: ",
"Only show notifications (if there are any): ": "Sýna aðeins tilkynningar (ef einhverjar eru): ",
"Enable web notifications": "Virkja veftilkynningar",
"`x` uploaded a video": "`x` hlóð upp myndband",
"`x` is live": "`x` er í beinni",
"Data preferences": "Gagnastillingar",
"Clear watch history": "Hreinsa áhorfssögu",
"Import/export data": "Flytja inn/út gögn",
"Change password": "Breyta lykilorði",
"Manage subscriptions": "Stjórna áskriftum",
"Manage tokens": "Stjórna tákn",
"Watch history": "Áhorfssögu",
"Delete account": "Eyða reikningi",
"Administrator preferences": "Kjörstillingar stjórnanda",
"Default homepage: ": "Sjálfgefin heimasíða: ",
"Feed menu: ": "Straum valmynd: ",
"Top enabled: ": "Toppur virkur? ",
"CAPTCHA enabled: ": "CAPTCHA virk? ",
"Login enabled: ": "Innskráning virk? ",
"Registration enabled: ": "Nýskráning virkjuð? ",
"Report statistics: ": "Skrá talnagögn? ",
"Save preferences": "Vista stillingar",
"Subscription manager": "Áskriftarstjóri",
"`x` subscriptions": "",
"`x` tokens": "",
"Token manager": "Táknstjóri",
"Token": "Tákn",
"`x` subscriptions.": "`x` áskriftir.",
"`x` tokens.": "`x` tákn.",
"`x` unseen notifications": "",
"Import/export": "Flytja inn/út",
"unsubscribe": "afskrá",
"revoke": "afturkalla",
"Subscriptions": "Áskriftir",
"`x` unseen notifications.": "`x` óséðar tilkynningar.",
"search": "leita",
"Log out": "Útskrá",
"Released under the AGPLv3 by Omar Roth.": "Útgefið undir AGPLv3 eftir Omar Roth.",
"Source available here.": "Frumkóði aðgengilegur hér.",
"View JavaScript license information.": "Skoða JavaScript leyfisupplýsingar.",
"View privacy policy.": "Skoða meðferð persónuupplýsinga.",
"Trending": "Vinsælt",
"Public": "",
"Unlisted": "Óskráð",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Horfa á YouTube",
"Hide annotations": "Fela glósur",
"Show annotations": "Sýna glósur",
"Genre: ": "Tegund: ",
"License: ": "Notkunarleyfi: ",
"Family friendly? ": "Fjölskylduvænt? ",
"`x` views": "",
"Wilson score: ": "Wilson stig: ",
"Engagement: ": "Þátttöku: ",
"Whitelisted regions: ": "Svæði á hvítum lista: ",
"Blacklisted regions: ": "Svæði á svörtum lista: ",
"Shared `x`": "Deilt `x`",
"`x` views.": "`x` áhorf.",
"Premieres in `x`": "Frumflutt eftir `x`",
"Premieres `x`": "Frumflutt `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Hæ! Lítur út eins og þú hafir slökkt á JavaScript. Smelltu hér til að skoða ummæli, hafðu í huga að þær geta tekið aðeins lengri tíma að hlaða.",
"View YouTube comments": "Skoða YouTube ummæli",
"View more comments on Reddit": "Skoða fleiri ummæli á Reddit",
"View `x` comments": "Skoða `x` ummæli",
"View Reddit comments": "Skoða Reddit ummæli",
"Hide replies": "Fela svör",
"Show replies": "Sýna svör",
"Incorrect password": "Rangt lykilorð",
"Quota exceeded, try again in a few hours": "Kvóti fór yfir, reyndu aftur eftir nokkrar klukkustundir",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "Ekki er hægt að skrá þig inn, vertu viss um að tvíþætt staðfesting (Authenticator eða SMS) sé kveikt á.",
"Invalid TFA code": "Ógildur TFA kóði",
"Login failed. This may be because two-factor authentication is not turned on for your account.": "Innskráning mistókst. Þetta gæti verið vegna þess að tvíþátta staðfesting er ekki kveikt á reikningnum þínum.",
"Wrong answer": "Rangt svar",
"Erroneous CAPTCHA": "Rangt CAPTCHA",
"CAPTCHA is a required field": "CAPTCHA er nauðsynlegur reitur",
"User ID is a required field": "Notandakenni er nauðsynlegur reitur",
"Password is a required field": "Lykilorð er nauðsynlegur reitur",
"Wrong username or password": "Rangt notandanafn eða lykilorð",
"Please sign in using 'Log in with Google'": "Vinsamlegast skráðu þig inn með því að nota 'Innskráning með Google'",
"Password cannot be empty": "Lykilorð má ekki vera autt",
"Password cannot be longer than 55 characters": "Lykilorð má ekki vera lengra en 55 stafir",
"Please log in": "Vinsamlegast skráðu þig inn",
"View `x` replies": "",
"Invidious Private Feed for `x`": "Invidious Persónulegur Straumur fyrir `x`",
"channel:`x`": "rás:`x`",
"`x` points": "",
"Deleted or invalid channel": "Eytt eða ógild rás",
"This channel does not exist.": "Þessi rás er ekki til.",
"Could not get channel info.": "Ekki tókst að fá rásarupplýsingar.",
"Could not fetch comments": "Ekki tókst að sækja ummæli",
"View `x` replies.": "Skoða `x` svör.",
"`x` ago": "`x` síðan",
"Load more": "Hlaða meira",
"`x` points.": "`x` stig.",
"Could not create mix.": "Ekki tókst að búa til blöndu.",
"Empty playlist": "Tómur spilunarlisti",
"Not a playlist.": "Ekki spilunarlisti.",
"Playlist does not exist.": "Spilunarlisti er ekki til.",
"Could not pull trending pages.": "Ekki tókst að draga vinsælar síður.",
"Hidden field \"challenge\" is a required field": "Falinn reitur \"áskorun\" er nauðsynlegur reitur",
"Hidden field \"token\" is a required field": "Falinn reitur \"tákn\" er nauðsynlegur reitur",
"Erroneous challenge": "Röng áskorun",
"Erroneous token": "Rangt tákn",
"No such user": "Enginn slíkur notandi",
"Token is expired, please try again": "Tákn er útrunnið, vinsamlegast reyndu aftur",
"English": "Enska",
"English (auto-generated)": "Enska (sjálfkrafa)",
"Afrikaans": "Afríkanska",
"Albanian": "Albanska",
"Amharic": "Amharíska",
"Arabic": "Arabíska",
"Armenian": "Armenska",
"Azerbaijani": "Aserbaídsjanska",
"Bangla": "Bangla",
"Basque": "Baskneska",
"Belarusian": "Hvítrússneska",
"Bosnian": "Bosníska",
"Bulgarian": "Búlgarska",
"Burmese": "Búrmíska",
"Catalan": "Katalónska",
"Cebuano": "Cebúanó",
"Chinese (Simplified)": "Kínverska (Einfölduð)",
"Chinese (Traditional)": "Kínverska (Hefðbundin)",
"Corsican": "Korsíska",
"Croatian": "Króatíska",
"Czech": "Tékkneska",
"Danish": "Danska",
"Dutch": "Hollenska",
"Esperanto": "Esperantó",
"Estonian": "Eistneska",
"Filipino": "Filippínska",
"Finnish": "Finnska",
"French": "Franska",
"Galician": "Galisíska",
"Georgian": "Georgíska",
"German": "Þýska",
"Greek": "Gríska",
"Gujarati": "Gújaratí",
"Haitian Creole": "Haítískt Kreólamál",
"Hausa": "Hausa",
"Hawaiian": "Havaíska",
"Hebrew": "Hebreska",
"Hindi": "Hindí",
"Hmong": "Hmong",
"Hungarian": "Ungverska",
"Icelandic": "Íslenska",
"Igbo": "Igbo",
"Indonesian": "Indónesíska",
"Irish": "Írska",
"Italian": "Ítalska",
"Japanese": "Japanska",
"Javanese": "Javanska",
"Kannada": "Kanaríska",
"Kazakh": "Kasakíska",
"Khmer": "Khmeríska",
"Korean": "Kóreska",
"Kurdish": "Kúrdíska",
"Kyrgyz": "Kirgisíska",
"Lao": "Laó",
"Latin": "Latína",
"Latvian": "Lettneska",
"Lithuanian": "Litháíska",
"Luxembourgish": "Lúxemborgíska",
"Macedonian": "Makedóníska",
"Malagasy": "Malagasíska",
"Malay": "Malaíska",
"Malayalam": "Malaíalam",
"Maltese": "Maltneska",
"Maori": "Maórí",
"Marathi": "Marathi",
"Mongolian": "Mongólska",
"Nepali": "Nepalska",
"Norwegian Bokmål": "Norskt bókmál",
"Nyanja": "Nyanja",
"Pashto": "Pashto",
"Persian": "Persneska",
"Polish": "Pólska",
"Portuguese": "Portúgalska",
"Punjabi": "Punjabi",
"Romanian": "Rúmenska",
"Russian": "Rússneska",
"Samoan": "Samóíska",
"Scottish Gaelic": "Skosk Gelíska",
"Serbian": "Serbneska",
"Shona": "Shona",
"Sindhi": "Sindí",
"Sinhala": "Sinhala",
"Slovak": "Slóvakíska",
"Slovenian": "Slóvenska",
"Somali": "Sómalska",
"Southern Sotho": "Suður Sótó",
"Spanish": "Spænska",
"Spanish (Latin America)": "Spænska (Rómönsku Ameríka)",
"Sundanese": "Sundaneska",
"Swahili": "Svahílí",
"Swedish": "Sænska",
"Tajik": "Tadsikíska",
"Tamil": "Tamílska",
"Telugu": "Telúgú",
"Thai": "Taílenska",
"Turkish": "Tyrkneska",
"Ukrainian": "Úkraníska",
"Urdu": "Úrdú",
"`x` years": "",
"`x` months": "",
"`x` weeks": "",
"`x` days": "",
"`x` hours": "",
"`x` minutes": "",
"`x` seconds": "",
"Uzbek": "Úsbekíska",
"Vietnamese": "Víetnamska",
"Welsh": "Velska",
"Western Frisian": "Vestur Frísneska",
"Xhosa": "Xhosa",
"Yiddish": "Jiddíska",
"Yoruba": "Jórúba",
"Zulu": "Zúlú",
"`x` years.": "`x` ár.",
"`x` months.": "`x` mánuði.",
"`x` weeks.": "`x` vikur.",
"`x` days.": "`x` dagar.",
"`x` hours.": "`x` klukkustundir.",
"`x` minutes.": "`x` mínútur.",
"`x` seconds.": "`x` sekúndur.",
"Fallback comments: ": "Vara ummæli: ",
"Popular": "Vinsælt",
"permalink": "",
"Top": "Topp",
"About": "Um",
"Rating: ": "Einkunn: ",
"Language: ": "Tungumál: ",
"View as playlist": "Skoða sem spilunarlista",
"Community": "",
"Default": "Sjálfgefið",
"Music": "Tónlist",
"Gaming": "Tólvuleikja",
"News": "Fréttir",
"Movies": "Kvikmyndir",
"Download": "Niðurhal",
"Download as: ": "Niðurhala sem: ",
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(breytt)",
"YouTube comment permalink": "YouTube ummæli varanlegur tengill",
"`x` marked it with a ❤": "`x` merkti það með ❤",
"Audio mode": "Hljóð ham",
"Video mode": "Myndband ham",
"Videos": "Myndbönd",
"Playlists": "Spilunarlistar",
"Current version: ": "Núverandi útgáfa: "
}

View File

@@ -1,25 +1,32 @@
{
"`x` subscribers": "`x` iscritti",
"`x` videos": "`x` video",
"`x` subscribers": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` iscritto",
"": "`x` iscritti"
},
"`x` videos": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` video",
"": "`x` video"
},
"`x` playlists": "",
"LIVE": "IN DIRETTA",
"Shared `x` ago": "Condiviso `x` fa",
"Unsubscribe": "Disiscriviti",
"Subscribe": "Iscriviti",
"View channel on YouTube": "Vedi canale su YouTube",
"View playlist on YouTube": "",
"newest": "Data di aggiunta (più recente)",
"oldest": "Data di aggiunta (più vecchia)",
"View playlist on YouTube": "Vedi playlist su YouTube",
"newest": "più recente",
"oldest": "più vecchio",
"popular": "Tendenze",
"last": "durare",
"Next page": "Pagina successiva",
"Previous page": "Pagina precedente",
"Clear watch history?": "Sei sicuro di voler cancellare la cronologia dei video guardati?",
"Clear watch history?": "Eliminare la cronologia dei video guardati?",
"New password": "Nuova password",
"New passwords must match": "Le nuove password devono corrispondere",
"Cannot change password for Google accounts": "Non è possibile modificare la password per gli account Google",
"Authorize token?": "Autorizzare gettone?",
"Authorize token for `x`?": "",
"Yes": "Si",
"Authorize token for `x`?": "Autorizzare gettone per `x`?",
"Yes": "Sì",
"No": "No",
"Import and Export Data": "Importazione ed esportazione dati",
"Import": "Importa",
@@ -32,20 +39,20 @@
"Export subscriptions as OPML": "Esporta gli abbonamenti come OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Esporta gli abbonamenti come OPML (per NewPipe e FreeTube)",
"Export data as JSON": "Esporta i dati in formato JSON",
"Delete account?": "Sei sicuro di voler cancellare l'account?",
"Delete account?": "Eliminare l'account?",
"History": "Cronologia",
"An alternative front-end to YouTube": "Un'interfaccia alternativa per YouTube",
"JavaScript license information": "Info licenze JavaScript",
"source": "sorgente",
"Log in": "Entra",
"Log in/register": "Entra/Registrati",
"Log in with Google": "Entra con Google",
"Log in": "Accedi",
"Log in/register": "Accedi/Registrati",
"Log in with Google": "Accedi con Google",
"User ID": "ID utente",
"Password": "Password",
"Time (h:mm:ss):": "Orario (h:mm:ss):",
"Text CAPTCHA": "Testo del CAPTCHA",
"Image CAPTCHA": "Immagine CAPTCHA",
"Sign In": "Entra",
"Sign In": "Accedi",
"Register": "Registrati",
"E-mail": "Email",
"Google verification code": "Codice di verifica Google",
@@ -53,28 +60,32 @@
"Player preferences": "Preferenze del riproduttore",
"Always loop: ": "Ripeti sempre: ",
"Autoplay: ": "Riproduzione automatica: ",
"Play next by default: ": "Riproduzione successiva per impostazione predefinita: ",
"Autoplay next video: ": "Riproduci automaticamente il prossimo video: ",
"Listen by default: ": "Modalità solo audio come predefinita: ",
"Proxy videos? ": "",
"Default speed: ": "Velocità di riproduzione predefinita: ",
"Preferred video quality: ": "Preferenza sulla qualità video: ",
"Play next by default: ": "Riproduzione successiva predefinita: ",
"Autoplay next video: ": "Riproduci automaticamente il video successivo: ",
"Listen by default: ": "Modalità solo audio predefinita: ",
"Proxy videos: ": "Proxy per i video: ",
"Default speed: ": "Velocità predefinita: ",
"Preferred video quality: ": "Qualità video preferita: ",
"Player volume: ": "Volume di riproduzione: ",
"Default comments: ": "Origine dei commenti: ",
"youtube": "",
"reddit": "",
"youtube": "YouTube",
"reddit": "Reddit",
"Default captions: ": "Sottotitoli predefiniti: ",
"Fallback captions: ": "Sottotitoli alternativi: ",
"Show related videos? ": "Mostra video correlati? ",
"Show annotations by default? ": "Mostra le annotazioni per impostazione predefinita? ",
"Show related videos: ": "Mostra video correlati: ",
"Show annotations by default: ": "Mostra le annotazioni in modo predefinito: ",
"Visual preferences": "Preferenze grafiche",
"Player style: ": "Stile riproduttore",
"Dark mode: ": "Tema scuro: ",
"Theme: ": "Tema",
"dark": "scuro",
"light": "chiaro",
"Thin mode: ": "Modalità per connessioni lente: ",
"Subscription preferences": "Preferenze iscrizioni",
"Show annotations by default for subscribed channels? ": "",
"Show annotations by default for subscribed channels: ": "Mostrare annotazioni in modo predefinito per i canali sottoscritti: ",
"Redirect homepage to feed: ": "Reindirizza la pagina principale a quella delle iscrizioni: ",
"Number of videos shown in feed: ": "Numero di video da mostrare nelle iscrizioni: ",
"Sort videos by: ": "Ordinare i video per: ",
"Sort videos by: ": "Ordina i video per: ",
"published": "data di pubblicazione",
"published - reverse": "data di pubblicazione - decrescente",
"alphabetically": "ordine alfabetico",
@@ -85,57 +96,80 @@
"Only show latest unwatched video from channel: ": "Mostra solo il video più recente non guardato del canale: ",
"Only show unwatched: ": "Mostra solo i video non guardati: ",
"Only show notifications (if there are any): ": "Mostra solo le notifiche (se presenti): ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "Attiva le notifiche web",
"`x` uploaded a video": "`x` ha caricato un video",
"`x` is live": "`x` è in diretta",
"Data preferences": "Preferenze dati",
"Clear watch history": "Cancella la cronologia dei video guardati",
"Import/export data": "Importazione/esportazione dati",
"Change password": "",
"Change password": "Modifica password",
"Manage subscriptions": "Gestisci le iscrizioni",
"Manage tokens": "",
"Manage tokens": "Gestisci i gettoni",
"Watch history": "Cronologia dei video",
"Delete account": "Elimina l'account",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Administrator preferences": "Preferenze amministratore",
"Default homepage: ": "Pagina principale predefinita: ",
"Feed menu: ": "Menu iscrizioni: ",
"Top enabled: ": "",
"CAPTCHA enabled: ": "CAPTCHA attivati: ",
"Login enabled: ": "Accesso attivato: ",
"Registration enabled: ": "Registrazione attivata: ",
"Report statistics: ": "Resoconto delle statistiche: ",
"Save preferences": "Salva le preferenze",
"Subscription manager": "Gestisci le iscrizioni",
"Token manager": "",
"Token": "",
"`x` subscriptions": "`x` iscrizioni",
"`x` tokens": "",
"Subscription manager": "Gestione delle iscrizioni",
"Token manager": "Gestione dei gettoni",
"Token": "Gettone",
"`x` subscriptions": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` iscrizione",
"": "`x` iscrizioni"
},
"`x` tokens": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` gettone",
"": "`x` gettoni"
},
"Import/export": "Importa/esporta",
"unsubscribe": "disiscriviti",
"revoke": "",
"revoke": "revoca",
"Subscriptions": "Iscrizioni",
"`x` unseen notifications": "`x` notifiche non visualizzate",
"`x` unseen notifications": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` notifica non visualizzata",
"": "`x` notifiche non visualizzate"
},
"search": "Cerca",
"Log out": "Esci",
"Released under the AGPLv3 by Omar Roth.": "Pubblicato con licenza AGPLv3 da Omar Roth.",
"Source available here.": "Codice sorgente.",
"View JavaScript license information.": "Guarda le informazioni di licenza del codice JavaScript.",
"View privacy policy.": "",
"View privacy policy.": "Vedi la politica sulla privacy",
"Trending": "Tendenze",
"Unlisted": "",
"Watch on YouTube": "Guarda il video su YouTube",
"Hide annotations": "",
"Show annotations": "",
"Public": "",
"Unlisted": "Non elencati",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Guarda su YouTube",
"Hide annotations": "Nascondi annotazioni",
"Show annotations": "Mostra annotazioni",
"Genre: ": "Genere: ",
"License: ": "Licenza: ",
"Family friendly? ": "Per tutti? ",
"Wilson score: ": "Punteggio di Wilson: ",
"Engagement: ": "Tasso di coinvolgimento: ",
"Whitelisted regions: ": "Regioni nella lista bianca: ",
"Blacklisted regions: ": "Regioni nella lista nera: ",
"Whitelisted regions: ": "Regioni in lista bianca: ",
"Blacklisted regions: ": "Regioni in lista nera: ",
"Shared `x`": "Condiviso `x`",
"`x` views": "",
"`x` views": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` visualizzazione",
"": "`x` visualizzazioni"
},
"Premieres in `x`": "",
"Premieres `x`": "",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Ciao! Sembra che tu abbia disattivato JavaScript. Clicca qui per visualizzare i commenti. Considera che potrebbe volerci più tempo.",
"View YouTube comments": "Visualizza i commenti da YouTube",
"View more comments on Reddit": "Visualizza più commenti su Reddit",
@@ -157,28 +191,34 @@
"Please sign in using 'Log in with Google'": "Per favore accedi con \"Entra con Google\"",
"Password cannot be empty": "La password non può essere vuota",
"Password cannot be longer than 55 characters": "La password non può contenere più di 55 caratteri",
"Please log in": "Per favore, entra",
"Please log in": "Per favore, accedi",
"Invidious Private Feed for `x`": "Feed privato Invidious per `x`",
"channel:`x`": "canale:`x`",
"Deleted or invalid channel": "Canale cancellato o invalido",
"This channel does not exist.": "Canale inesistente.",
"Deleted or invalid channel": "Canale eliminato o non valido",
"This channel does not exist.": "Questo canale non esiste.",
"Could not get channel info.": "Impossibile ottenere le informazioni del canale.",
"Could not fetch comments": "Impossibile recuperare i commenti",
"View `x` replies": "Visualizza `x` risposte",
"View `x` replies": {
"([^.,0-9]|^)1([^.,0-9]|$)": "Visualizza `x` risposta",
"": "Visualizza `x` risposte"
},
"`x` ago": "`x` fa",
"Load more": "Carica altro",
"`x` points": "`x` punti",
"`x` points": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` punto",
"": "`x` punti"
},
"Could not create mix.": "Impossibile creare il mix.",
"Empty playlist": "Playlist vuota",
"Not a playlist.": "Playlist invalida.",
"Playlist does not exist.": "Playlist inesistente.",
"Not a playlist.": "Non è una playlist.",
"Playlist does not exist.": "La playlist non esiste.",
"Could not pull trending pages.": "Impossibile recuperare le tendenze.",
"Hidden field \"challenge\" is a required field": "Il campo nascosto \"challenge\" è obbligatorio",
"Hidden field \"token\" is a required field": "Il campo nascosto \"token\" è obbligatorio",
"Erroneous challenge": "Campo \"challenge\" invalido",
"Erroneous token": "Campo \"token\" invalido",
"No such user": "Utente invalido",
"Token is expired, please try again": "Token scaduto, riprova",
"Erroneous challenge": "Campo \"challenge\" non valido",
"Erroneous token": "Campo \"token\" non valido",
"No such user": "Utente non valido",
"Token is expired, please try again": "Gettone scaduto, riprova",
"English": "Inglese",
"English (auto-generated)": "Inglese (generati automaticamente)",
"Afrikaans": "Afrikaans",
@@ -285,20 +325,41 @@
"Yiddish": "Yiddish",
"Yoruba": "Yoruba",
"Zulu": "Zulu",
"`x` years": "`x` anni",
"`x` months": "`x` mesi",
"`x` weeks": "`x` settimane",
"`x` days": "`x` giorni",
"`x` hours": "`x` ore",
"`x` minutes": "`x` minuti",
"`x` seconds": "`x` secondi",
"`x` years": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` anno",
"": "`x` anni"
},
"`x` months": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` mese",
"": "`x` mesi"
},
"`x` weeks": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` settimana",
"": "`x` settimane"
},
"`x` days": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` giorno",
"": "`x` giorni"
},
"`x` hours": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` ora",
"": "`x` ore"
},
"`x` minutes": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` minuto",
"": "`x` minuti"
},
"`x` seconds": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` secondo",
"": "`x` secondi"
},
"Fallback comments: ": "Commenti alternativi: ",
"Popular": "Popolare",
"Top": "Top",
"About": "A proposito",
"About": "Al riguardo",
"Rating: ": "Punteggio: ",
"Language: ": "Lingua: ",
"View as playlist": "",
"View as playlist": "Vedi come playlist",
"Default": "Predefinito",
"Music": "Musica",
"Gaming": "Videogiochi",
@@ -309,10 +370,12 @@
"%A %B %-d, %Y": "%A %-d %B %Y",
"(edited)": "(modificato)",
"YouTube comment permalink": "Link permanente al commento di YouTube",
"permalink": "",
"`x` marked it with a ❤": "`x` l'ha contrassegnato con un ❤",
"Audio mode": "Modalità audio",
"Video mode": "Modalità video",
"Videos": "",
"Playlists": "",
"Current version: ": ""
"Videos": "Video",
"Playlists": "Playlist",
"Community": "Comunità",
"Current version: ": "Versione attuale: "
}

387
locales/ja.json Normal file
View File

@@ -0,0 +1,387 @@
{
"`x` subscribers": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 人の登録者",
"": "`x` 人の登録者"
},
"`x` videos": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個の動画",
"": "`x` 個の動画"
},
"`x` playlists": {
"(\\D|^)1(\\D|$)": "`x` 個の再生リスト",
"": "`x` 個の再生リスト"
},
"LIVE": "ライブ",
"Shared `x` ago": "`x`前に共有",
"Unsubscribe": "登録解除",
"Subscribe": "登録",
"View channel on YouTube": "YouTube でチャンネルを見る",
"View playlist on YouTube": "YouTube で再生リストを見る",
"newest": "新しい順",
"oldest": "古い順",
"popular": "人気順",
"last": "追加順",
"Next page": "次のページ",
"Previous page": "前のページ",
"Clear watch history?": "再生履歴を削除しますか?",
"New password": "新しいパスワード",
"New passwords must match": "新しいパスワードが一致していません",
"Cannot change password for Google accounts": "Google アカウントのパスワードは変更できません",
"Authorize token?": "トークンを認証しますか?",
"Authorize token for `x`?": "トークン `x` を認証しますか?",
"Yes": "はい",
"No": "いいえ",
"Import and Export Data": "データのインポートとエクスポート",
"Import": "インポート",
"Import Invidious data": "Invidious データをインポート",
"Import YouTube subscriptions": "YouTube 登録チャンネルをインポート",
"Import FreeTube subscriptions (.db)": "FreeTube 登録チャンネルをインポート (.db)",
"Import NewPipe subscriptions (.json)": "NewPipe 登録チャンネルをインポート (.json)",
"Import NewPipe data (.zip)": "NewPipe データをインポート (.zip)",
"Export": "エクスポート",
"Export subscriptions as OPML": "登録チャンネルを OPML でエクスポート",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "登録チャンネルを OPML でエクスポート (NewPipe & FreeTube 用)",
"Export data as JSON": "データを JSON でエクスポート",
"Delete account?": "アカウントを削除しますか?",
"History": "履歴",
"An alternative front-end to YouTube": "YouTube の代わりとなる新しいフロントエンド",
"JavaScript license information": "JavaScript ライセンス情報",
"source": "ソース",
"Log in": "ログイン",
"Log in/register": "ログイン/登録",
"Log in with Google": "Google でログイン",
"User ID": "ユーザー ID",
"Password": "パスワード",
"Time (h:mm:ss):": "時間 (時:分分:秒秒):",
"Text CAPTCHA": "テキスト CAPTCHA",
"Image CAPTCHA": "画像 CAPTCHA",
"Sign In": "サインイン",
"Register": "登録",
"E-mail": "メールアドレス",
"Google verification code": "Google 認証コード",
"Preferences": "設定",
"Player preferences": "プレイヤー設定",
"Always loop: ": "常にループ: ",
"Autoplay: ": "自動再生: ",
"Play next by default: ": "デフォルトで次を再生: ",
"Autoplay next video: ": "次の動画を自動再生: ",
"Listen by default: ": "デフォルトでオーディオモードを使用: ",
"Proxy videos: ": "動画をプロキシーに通す: ",
"Default speed: ": "デフォルトの再生速度: ",
"Preferred video quality: ": "優先する画質: ",
"Player volume: ": "プレイヤーの音量: ",
"Default comments: ": "デフォルトのコメント: ",
"youtube": "youtube",
"reddit": "reddit",
"Default captions: ": "デフォルトの字幕: ",
"Fallback captions: ": "フォールバック時の字幕: ",
"Show related videos: ": "関連動画を表示: ",
"Show annotations by default: ": "デフォルトでアノテーションを表示: ",
"Visual preferences": "外観設定",
"Player style: ": "プレイヤースタイル: ",
"Dark mode: ": "ダークモード: ",
"Theme: ": "テーマ: ",
"dark": "ダーク",
"light": "ライト",
"Thin mode: ": "最小モード: ",
"Subscription preferences": "登録チャンネル設定",
"Show annotations by default for subscribed channels: ": "デフォルトで登録チャンネルのアノテーションを表示しますか? ",
"Redirect homepage to feed: ": "ホームからフィードにリダイレクト: ",
"Number of videos shown in feed: ": "フィードに表示する動画の量: ",
"Sort videos by: ": "動画を並び替え: ",
"published": "投稿日",
"published - reverse": "投稿日 - 逆順",
"alphabetically": "アルファベット",
"alphabetically - reverse": "アルファベット - 逆順",
"channel name": "チャンネル名",
"channel name - reverse": "チャンネル名 - 逆順",
"Only show latest video from channel: ": "チャンネルの最新動画のみを表示: ",
"Only show latest unwatched video from channel: ": "チャンネルの最新未視聴動画のみを表示: ",
"Only show unwatched: ": "未視聴のみを表示: ",
"Only show notifications (if there are any): ": "通知のみを表示 (ある場合): ",
"Enable web notifications": "ウェブ通知を有効化",
"`x` uploaded a video": "`x` が動画を投稿しました",
"`x` is live": "`x` がライブ中です",
"Data preferences": "データ設定",
"Clear watch history": "再生履歴の削除",
"Import/export data": "データのインポート/エクスポート",
"Change password": "パスワードを変更",
"Manage subscriptions": "登録チャンネルを管理",
"Manage tokens": "トークンを管理",
"Watch history": "再生履歴",
"Delete account": "アカウントを削除",
"Administrator preferences": "管理者設定",
"Default homepage: ": "デフォルトのホーム: ",
"Feed menu: ": "フィードメニュー: ",
"Top enabled: ": "Top enabled: ",
"CAPTCHA enabled: ": "CAPTCHA を有効化: ",
"Login enabled: ": "ログインを有効化: ",
"Registration enabled: ": "登録を有効化: ",
"Report statistics: ": "統計を報告: ",
"Save preferences": "設定を保存",
"Subscription manager": "登録チャンネルマネージャー",
"Token manager": "トークンマネージャー",
"Token": "トークン",
"`x` subscriptions": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個の登録チャンネル",
"": "`x` 個の登録チャンネル"
},
"`x` tokens": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個のトークン",
"": "`x` 個のトークン"
},
"Import/export": "インポート/エクスポート",
"unsubscribe": "登録解除",
"revoke": "revoke",
"Subscriptions": "登録チャンネル",
"`x` unseen notifications": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個の未読通知",
"": "`x` 個の未読通知"
},
"search": "検索",
"Log out": "ログアウト",
"Released under the AGPLv3 by Omar Roth.": "Omar Roth によって AGPLv3 でリリースされています。",
"Source available here.": "ソースはここで閲覧可能です。",
"View JavaScript license information.": "JavaScript ライセンス情報を見る。",
"View privacy policy.": "プライバシーポリシーを見る。",
"Trending": "急上昇",
"Public": "公開",
"Unlisted": "限定公開",
"Private": "非公開",
"View all playlists": "再生リストをすべて見る",
"Updated `x` ago": "`x`前に更新",
"Delete playlist `x`?": "再生リスト `x` を削除しますか?",
"Delete playlist": "再生リストを削除",
"Create playlist": "再生リストを作成",
"Title": "タイトル",
"Playlist privacy": "再生リストのプライバシー",
"Editing playlist `x`": "再生リスト `x` を編集中",
"Watch on YouTube": "YouTube で視聴",
"Hide annotations": "アノテーションを隠す",
"Show annotations": "アノテーションを表示",
"Genre: ": "ジャンル: ",
"License: ": "ライセンス: ",
"Family friendly? ": "家族向け? ",
"Wilson score: ": "ウィルソンスコア: ",
"Engagement: ": "エンゲージメント: ",
"Whitelisted regions: ": "ホワイトリストの地域: ",
"Blacklisted regions: ": "ブラックリストの地域: ",
"Shared `x`": "`x`に共有",
"`x` views": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 回視聴",
"": "`x` 回視聴"
},
"Premieres in `x`": "Premieres in `x`",
"Premieres `x`": "Premieres `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "やあ!君は JavaScript を無効にしているのかな?ここをクリックしてコメントを見れるけど、読み込みには少し時間がかかることがあるのを覚えておいてね。",
"View YouTube comments": "YouTube のコメントを見る",
"View more comments on Reddit": "Reddit でコメントをもっと見る",
"View `x` comments": {
"(\\D|^)1(\\D|$)": "`x` 件のコメントを見る",
"": "`x` 件のコメントを見る"
},
"View Reddit comments": "Reddit のコメントを見る",
"Hide replies": "返信を非表示",
"Show replies": "返信を表示",
"Incorrect password": "パスワードが間違っています",
"Quota exceeded, try again in a few hours": "試行を制限中です。数時間後にやり直してください",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "ログインできませんでした。2段階認証 (認証アプリまたは SMS) が有効になっていることを確認してください。",
"Invalid TFA code": "TFA (2段階認証) コードが無効です",
"Login failed. This may be because two-factor authentication is not turned on for your account.": "ログインに失敗しました。あなたのアカウントで2段階認証が有効になっていない可能性があります。",
"Wrong answer": "回答が間違っています",
"Erroneous CAPTCHA": "CAPTCHA が間違っています",
"CAPTCHA is a required field": "CAPTCHA は必須項目です",
"User ID is a required field": "ユーザー ID は必須項目です",
"Password is a required field": "パスワードは必須項目です",
"Wrong username or password": "ユーザー名またはパスワードが間違っています",
"Please sign in using 'Log in with Google'": "'Google でログイン' を使用してログインしてください",
"Password cannot be empty": "パスワードを空にすることはできません",
"Password cannot be longer than 55 characters": "パスワードは55文字より長くできません",
"Please log in": "ログインをしてください",
"Invidious Private Feed for `x`": "`x` の Invidious プライベートフィード",
"channel:`x`": "チャンネル:`x`",
"Deleted or invalid channel": "削除済みまたは無効なチャンネルです",
"This channel does not exist.": "このチャンネルは存在していません",
"Could not get channel info.": "チャンネル情報を取得できませんでした。",
"Could not fetch comments": "コメントを取得できませんでした",
"View `x` replies": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 件の返信を見る",
"": "`x` 件の返信を見る"
},
"`x` ago": "`x`前",
"Load more": "もっと読み込む",
"`x` points": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` ポイント",
"": "`x` ポイント"
},
"Could not create mix.": "ミックスを作成できませんでした。",
"Empty playlist": "空の再生リスト",
"Not a playlist.": "再生リストではありません。",
"Playlist does not exist.": "再生リストが存在していません・",
"Could not pull trending pages.": "急上昇ページを取得できませんでした。",
"Hidden field \"challenge\" is a required field": "非表示項目 \"challenge\" は必須項目です",
"Hidden field \"token\" is a required field": "非表示項目 \"token\" は必須項目です",
"Erroneous challenge": "チャレンジが間違っています",
"Erroneous token": "トークンが間違っています",
"No such user": "ユーザーが存在しません",
"Token is expired, please try again": "トークンが期限切れです。再度試してください",
"English": "英語",
"English (auto-generated)": "英語 (自動生成)",
"Afrikaans": "アフリカーンス語",
"Albanian": "アルバニア語",
"Amharic": "アムハラ語",
"Arabic": "アラビア語",
"Armenian": "アルメニア語",
"Azerbaijani": "アゼルバイジャン語",
"Bangla": "ベンガル語",
"Basque": "バスク語",
"Belarusian": "ベラルーシ語",
"Bosnian": "ボスニア語",
"Bulgarian": "ブルガリア語",
"Burmese": "ビルマ語",
"Catalan": "カタルーニャ語",
"Cebuano": "セブアノ語",
"Chinese (Simplified)": "中国語 (簡体字)",
"Chinese (Traditional)": "中国語 (繁体字)",
"Corsican": "コルシカ語",
"Croatian": "クロアチア語",
"Czech": "チェコ語",
"Danish": "デンマーク語",
"Dutch": "オランダ語",
"Esperanto": "エスペラント語",
"Estonian": "エストニア語",
"Filipino": "フィリピン語",
"Finnish": "フィンランド語",
"French": "フランス語",
"Galician": "ガルシア語",
"Georgian": "グルジア語",
"German": "ドイツ語",
"Greek": "ギリシャ語",
"Gujarati": "グジャラート語",
"Haitian Creole": "ハイチ語",
"Hausa": "ハウサ語",
"Hawaiian": "ハワイ語",
"Hebrew": "ヘブライ語",
"Hindi": "ヒンディー語",
"Hmong": "ミャオ語",
"Hungarian": "ハンガリー語",
"Icelandic": "アイスランド語",
"Igbo": "イボ語",
"Indonesian": "インドネシア語",
"Irish": "アイルランド語",
"Italian": "イタリア語",
"Japanese": "日本語",
"Javanese": "ジャワ語",
"Kannada": "カンナダ語",
"Kazakh": "カザフ語",
"Khmer": "クメール語",
"Korean": "韓国語",
"Kurdish": "クルド語",
"Kyrgyz": "キルギス語",
"Lao": "ラーオ語",
"Latin": "ラテン語",
"Latvian": "ラトビア語",
"Lithuanian": "リトアニア語",
"Luxembourgish": "ルクセンブルク語",
"Macedonian": "マケドニア語",
"Malagasy": "マダガスカル語",
"Malay": "マレー語",
"Malayalam": "マラヤーラム語",
"Maltese": "マルタ語",
"Maori": "マオリ語",
"Marathi": "マラーティー語",
"Mongolian": "モンゴル語",
"Nepali": "ネパール語",
"Norwegian Bokmål": "ノルウェー語",
"Nyanja": "チェワ語",
"Pashto": "パシュトー語",
"Persian": "ペルシア語",
"Polish": "ポーランド語",
"Portuguese": "ポルトガル語",
"Punjabi": "パンジャーブ語",
"Romanian": "ルーマニア語",
"Russian": "ロシア語",
"Samoan": "サモア語",
"Scottish Gaelic": "スコットランド・ゲール語",
"Serbian": "セルビア語",
"Shona": "ショナ語",
"Sindhi": "シンド語",
"Sinhala": "シンハラ語",
"Slovak": "スロバキア語",
"Slovenian": "スロベニア語",
"Somali": "ソマリ語",
"Southern Sotho": "南ソト語",
"Spanish": "スペイン語",
"Spanish (Latin America)": "スペイン語 (ラテンアメリカ)",
"Sundanese": "スンダ語",
"Swahili": "スワヒリ語",
"Swedish": "スウェーデン語",
"Tajik": "タジク語",
"Tamil": "タミル語",
"Telugu": "テルグ語",
"Thai": "タイ語",
"Turkish": "トルコ語",
"Ukrainian": "ウクライナ語",
"Urdu": "ウルドゥー語",
"Uzbek": "ウズベク語",
"Vietnamese": "ベトナム語",
"Welsh": "ウェールズ語",
"Western Frisian": "西フリジア語",
"Xhosa": "コサ語",
"Yiddish": "イディッシュ語",
"Yoruba": "ヨルバ語",
"Zulu": "ズール語",
"`x` years": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`年",
"": "`x`年"
},
"`x` months": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`月",
"": "`x`月"
},
"`x` weeks": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`週",
"": "`x`週"
},
"`x` days": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`日",
"": "`x`日"
},
"`x` hours": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`時間",
"": "`x`時間"
},
"`x` minutes": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`分",
"": "`x`分"
},
"`x` seconds": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x`秒",
"": "`x`秒"
},
"Fallback comments: ": "フォールバック時のコメント: ",
"Popular": "人気",
"Top": "トップ",
"About": "このサービスについて",
"Rating: ": "評価: ",
"Language: ": "言語: ",
"View as playlist": "再生リストで見る",
"Default": "デフォルト",
"Music": "音楽",
"Gaming": "ゲーム",
"News": "ニュース",
"Movies": "映画",
"Download": "ダウンロード",
"Download as: ": "ダウンロード: ",
"%A %B %-d, %Y": "%Y %B %-d %A",
"(edited)": "(編集済み)",
"YouTube comment permalink": "YouTube コメントのパーマリンク",
"permalink": "パーマリンク",
"`x` marked it with a ❤": "`x` が❤を込めてマークしました",
"Audio mode": "オーディオモード",
"Video mode": "ビデオモード",
"Videos": "動画",
"Playlists": "プレイリスト",
"Community": "コミュニティ",
"Current version: ": "現在のバージョン: "
}

View File

@@ -1,6 +1,7 @@
{
"`x` subscribers": "`x` abonnenter",
"`x` videos": "`x` videoer",
"`x` playlists": "",
"LIVE": "SANNTIDSVISNING",
"Shared `x` ago": "Delt for `x` siden",
"Unsubscribe": "Opphev abonnement",
@@ -56,7 +57,7 @@
"Play next by default: ": "Spill neste som forvalg: ",
"Autoplay next video: ": "Autospill neste video: ",
"Listen by default: ": "Lytt som forvalg: ",
"Proxy videos? ": "Mellomtjen videoer? ",
"Proxy videos: ": "Mellomtjen videoer? ",
"Default speed: ": "Forvalgt hastighet: ",
"Preferred video quality: ": "Foretrukket videokvalitet: ",
"Player volume: ": "Avspillerlydstyrke: ",
@@ -65,13 +66,17 @@
"reddit": "Reddit",
"Default captions: ": "Forvalgte undertitler: ",
"Fallback captions: ": "Tilbakefallsundertitler: ",
"Show related videos? ": "Vis relaterte videoer? ",
"Show annotations by default? ": "Vis merknader som forvalg? ",
"Show related videos: ": "Vis relaterte videoer? ",
"Show annotations by default: ": "Vis merknader som forvalg? ",
"Visual preferences": "Visuelle innstillinger",
"Player style: ": "Avspillerstil: ",
"Dark mode: ": "Mørk drakt: ",
"Theme: ": "Drakt: ",
"dark": "Mørk",
"light": "Lys",
"Thin mode: ": "Tynt modus: ",
"Subscription preferences": "Abonnementsinnstillinger",
"Show annotations by default for subscribed channels? ": "Vis merknader som forvalg for kanaler det abonneres på? ",
"Show annotations by default for subscribed channels: ": "Vis merknader som forvalg for kanaler det abonneres på? ",
"Redirect homepage to feed: ": "Videresend hjemmeside til flyt: ",
"Number of videos shown in feed: ": "Antall videoer å vise i flyt: ",
"Sort videos by: ": "Sorter videoer etter: ",
@@ -99,11 +104,11 @@
"Administrator preferences": "Administratorinnstillinger",
"Default homepage: ": "Forvalgt hjemmeside: ",
"Feed menu: ": "Flyt-meny: ",
"Top enabled? ": "Topp påskrudd? ",
"CAPTCHA enabled? ": "CAPTCHA påskrudd? ",
"Login enabled? ": "Innlogging påskrudd? ",
"Registration enabled? ": "Registrering påskrudd? ",
"Report statistics? ": "Innrapporter statistikk? ",
"Top enabled: ": "Topp påskrudd? ",
"CAPTCHA enabled: ": "CAPTCHA påskrudd? ",
"Login enabled: ": "Innlogging påskrudd? ",
"Registration enabled: ": "Registrering påskrudd? ",
"Report statistics: ": "Innrapporter statistikk? ",
"Save preferences": "Lagre innstillinger",
"Subscription manager": "Abonnementsbehandler",
"Token manager": "Symbolbehandler",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Vis JavaScript-lisensinfo.",
"View privacy policy.": "Vis personvernspraksis.",
"Trending": "Trendsettende",
"Public": "",
"Unlisted": "Ulistet",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Vis video på YouTube",
"Hide annotations": "Skjul merknader",
"Show annotations": "Vis merknader",
@@ -136,6 +151,7 @@
"Shared `x`": "Delt `x`",
"`x` views": "`x` visninger",
"Premieres in `x`": "Premiere om `x`",
"Premieres `x`": "Première `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Hei. Det ser ut til at du har JavaScript avslått. Klikk her for å vise kommentarer, ha i minnet at innlasting tar lengre tid.",
"View YouTube comments": "Vis YouTube-kommentarer",
"View more comments on Reddit": "Vis flere kommenterer på Reddit",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "",
"(edited)": "(redigert)",
"YouTube comment permalink": "Permanent YouTube-lenke til innholdet",
"permalink": "permanent lenke",
"`x` marked it with a ❤": "`x` levnet et ❤",
"Audio mode": "Lydmodus",
"Video mode": "Video-modus",
"Videos": "Videoer",
"Playlists": "Spillelister",
"Community": "Gemenskap",
"Current version: ": "Nåværende versjon: "
}
}

View File

@@ -1,6 +1,7 @@
{
"`x` subscribers": "`x` abonnees",
"`x` videos": "`x` video's",
"`x` playlists": "",
"LIVE": "LIVE",
"Shared `x` ago": "Gedeeld: `x` geleden",
"Unsubscribe": "Deabonneren",
@@ -56,7 +57,7 @@
"Play next by default: ": "Standaard volgende video afspelen: ",
"Autoplay next video: ": "Volgende video automatisch afspelen: ",
"Listen by default: ": "Standaard luisteren: ",
"Proxy videos? ": "Video's afspelen via proxy? ",
"Proxy videos: ": "Video's afspelen via proxy? ",
"Default speed: ": "Standaard afspeelsnelheid: ",
"Preferred video quality: ": "Voorkeurskwaliteit: ",
"Player volume: ": "Spelervolume: ",
@@ -65,13 +66,17 @@
"reddit": "Reddit",
"Default captions: ": "Standaard ondertiteling: ",
"Fallback captions: ": "Alternatieve ondertiteling: ",
"Show related videos? ": "Gerelateerde video's tonen? ",
"Show annotations by default? ": "Standaard annotaties tonen? ",
"Show related videos: ": "Gerelateerde video's tonen? ",
"Show annotations by default: ": "Standaard annotaties tonen? ",
"Visual preferences": "Visuele instellingen",
"Player style: ": "",
"Dark mode: ": "Donkere modus: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Smalle modus: ",
"Subscription preferences": "Abonnementsinstellingen",
"Show annotations by default for subscribed channels? ": "Standaard annotaties tonen voor geabonneerde kanalen? ",
"Show annotations by default for subscribed channels: ": "Standaard annotaties tonen voor geabonneerde kanalen? ",
"Redirect homepage to feed: ": "Startpagina omleiden naar feed: ",
"Number of videos shown in feed: ": "Aantal te tonen video's in feed: ",
"Sort videos by: ": "Video's sorteren op: ",
@@ -85,9 +90,9 @@
"Only show latest unwatched video from channel: ": "Alleen nieuwste niet-bekeken video van kanaal tonen: ",
"Only show unwatched: ": "Alleen niet-bekeken videos tonen: ",
"Only show notifications (if there are any): ": "Alleen meldingen tonen (als die er zijn): ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "Systemmeldingen inschakelen",
"`x` uploaded a video": "`x` heeft een video geüpload",
"`x` is live": "`x` zendt nu live uit",
"Data preferences": "Gegevensinstellingen",
"Clear watch history": "Kijkgeschiedenis wissen",
"Import/export data": "Gegevens im-/exporteren",
@@ -99,11 +104,11 @@
"Administrator preferences": "Beheerdersinstellingen",
"Default homepage: ": "Standaard startpagina: ",
"Feed menu: ": "Feedmenu:",
"Top enabled? ": "Bovenkant inschakelen? ",
"CAPTCHA enabled? ": "CAPTCHA gebruiken? ",
"Login enabled? ": "Inloggen toestaan? ",
"Registration enabled? ": "Registratie toestaan? ",
"Report statistics? ": "Statistieken bijhouden? ",
"Top enabled: ": "Bovenkant inschakelen? ",
"CAPTCHA enabled: ": "CAPTCHA gebruiken? ",
"Login enabled: ": "Inloggen toestaan? ",
"Registration enabled: ": "Registratie toestaan? ",
"Report statistics: ": "Statistieken bijhouden? ",
"Save preferences": "Instellingen opslaan",
"Subscription manager": "Abonnementen beheren",
"Token manager": "Toegangssleutels beheren",
@@ -117,13 +122,23 @@
"`x` unseen notifications": "`x` ongelezen meldingen",
"search": "zoeken",
"Log out": "Uitloggen",
"Released under the AGPLv3 by Omar Roth.": "Uitgegeven onder de AGPLv3-licentie door Omar Roth.",
"Released under the AGPLv3 by Omar Roth.": "Uitgebracht onder de AGPLv3-licentie, door Omar Roth.",
"Source available here.": "De broncode is hier beschikbaar.",
"View JavaScript license information.": "JavaScript-licentieinformatie tonen.",
"View privacy policy.": "Privacybeleid tonen",
"Trending": "Uitgelicht",
"Public": "",
"Unlisted": "Verborgen",
"Watch on YouTube": "Bekijk video op YouTube",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Video bekijken op YouTube",
"Hide annotations": "Annotaties verbergen",
"Show annotations": "Annotaties tonen",
"Genre: ": "Genre: ",
@@ -136,6 +151,7 @@
"Shared `x`": "`x` gedeeld",
"`x` views": "`x` weergaven",
"Premieres in `x`": "Verschijnt over `x`",
"Premieres `x`": "",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Hoi! Het lijkt erop dat je JavaScript hebt uitgeschakeld. Klik hier om de reacties te bekijken. Let op: het laden duurt wat langer.",
"View YouTube comments": "YouTube-reacties tonen",
"View more comments on Reddit": "Meer reacties bekijken op Reddit",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(bewerkt)",
"YouTube comment permalink": "Link naar YouTube-reactie",
"permalink": "",
"`x` marked it with a ❤": "`x` heeft dit gemarkeerd met ❤",
"Audio mode": "Audiomodus",
"Video mode": "Videomodus",
"Videos": "Video's",
"Playlists": "Afspeellijsten",
"Community": "",
"Current version: ": "Huidige versie: "
}

View File

@@ -1,6 +1,7 @@
{
"`x` subscribers": "`x` subskrybcji",
"`x` videos": "`x` filmów",
"`x` playlists": "",
"LIVE": "NA ŻYWO",
"Shared `x` ago": "Udostępniono `x` temu",
"Unsubscribe": "Odsubskrybuj",
@@ -56,7 +57,7 @@
"Play next by default: ": "",
"Autoplay next video: ": "Odtwórz następny film: ",
"Listen by default: ": "Tryb dźwiękowy: ",
"Proxy videos? ": "Filmy przez proxy? ",
"Proxy videos: ": "Filmy przez proxy? ",
"Default speed: ": "Domyślna prędkość: ",
"Preferred video quality: ": "Preferowana jakość filmów: ",
"Player volume: ": "Głośność odtwarzacza: ",
@@ -65,13 +66,17 @@
"reddit": "",
"Default captions: ": "Domyślne napisy: ",
"Fallback captions: ": "Zastępcze napisy: ",
"Show related videos? ": "Pokaż powiązane filmy? ",
"Show annotations by default? ": "",
"Show related videos: ": "Pokaż powiązane filmy? ",
"Show annotations by default: ": "",
"Visual preferences": "Preferencje Wizualne",
"Player style: ": "",
"Dark mode: ": "Ciemny motyw: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Tryb minimalny: ",
"Subscription preferences": "Preferencje subskrybcji",
"Show annotations by default for subscribed channels? ": "",
"Show annotations by default for subscribed channels: ": "",
"Redirect homepage to feed: ": "Przekieruj stronę główną do subskrybcji: ",
"Number of videos shown in feed: ": "Liczba filmów widoczna na stronie subskrybcji: ",
"Sort videos by: ": "Sortuj filmy: ",
@@ -99,11 +104,11 @@
"Administrator preferences": "Preferencje administratora",
"Default homepage: ": "Domyślna strona główna: ",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "CAPTCHA aktywna? ",
"Login enabled? ": "Logowanie włączone? ",
"Registration enabled? ": "Rejestracja włączona? ",
"Report statistics? ": "Raportować statystyki? ",
"Top enabled: ": "",
"CAPTCHA enabled: ": "CAPTCHA aktywna? ",
"Login enabled: ": "Logowanie włączone? ",
"Registration enabled: ": "Rejestracja włączona? ",
"Report statistics: ": "Raportować statystyki? ",
"Save preferences": "Zapisz preferencje",
"Subscription manager": "Manager subskrybcji",
"Token manager": "",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Wyświetl informację o licencji JavaScript.",
"View privacy policy.": "Polityka prywatności.",
"Trending": "Na czasie",
"Public": "",
"Unlisted": "",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Zobacz film na YouTube",
"Hide annotations": "",
"Show annotations": "",
@@ -136,6 +151,7 @@
"Shared `x`": "Udostępniono `x`",
"`x` views": "`x` wyświetleń",
"Premieres in `x`": "Publikacja za `x`",
"Premieres `x`": "",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Cześć! Wygląda na to, że masz wyłączoną obsługę JavaScriptu. Kliknij tutaj, żeby zobaczyć komentarze. Pamiętaj, że wczytywanie może potrwać dłużej.",
"View YouTube comments": "Wyświetl komentarze z YouTube",
"View more comments on Reddit": "Wyświetl więcej komentarzy na Reddicie",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "",
"(edited)": "(edytowany)",
"YouTube comment permalink": "Odnośnik bezpośredni do komentarza na YouTube",
"permalink": "",
"`x` marked it with a ❤": "`x` oznaczonych ❤",
"Audio mode": "Tryb audio",
"Video mode": "Tryb wideo",
"Videos": "Filmy",
"Playlists": "Playlisty",
"Community": "",
"Current version: ": "Aktualna wersja: "
}

View File

@@ -1,12 +1,13 @@
{
"`x` subscribers": "`x` подписчиков",
"`x` videos": "`x` видео",
"`x` playlists": "",
"LIVE": "ПРЯМОЙ ЭФИР",
"Shared `x` ago": "Опубликовано `x` назад",
"Unsubscribe": "Отписаться",
"Subscribe": "Подписаться",
"View channel on YouTube": "Смотреть канал на YouTube",
"View playlist on YouTube": "",
"View playlist on YouTube": "Посмотреть плейлист на YouTube",
"newest": "самые свежие",
"oldest": "самые старые",
"popular": "популярные",
@@ -56,7 +57,7 @@
"Play next by default: ": "Всегда включать следующее видео? ",
"Autoplay next video: ": "Автопроигрывание следующего видео: ",
"Listen by default: ": "Режим «только аудио» по умолчанию: ",
"Proxy videos? ": "Проигрывать видео через прокси? ",
"Proxy videos: ": "Проигрывать видео через прокси? ",
"Default speed: ": "Скорость видео по умолчанию: ",
"Preferred video quality: ": "Предпочтительное качество видео: ",
"Player volume: ": "Громкость видео: ",
@@ -65,13 +66,17 @@
"reddit": "Reddit",
"Default captions: ": "Основной язык субтитров: ",
"Fallback captions: ": "Дополнительный язык субтитров: ",
"Show related videos? ": "Показывать похожие видео? ",
"Show annotations by default? ": "Всегда показывать аннотации? ",
"Show related videos: ": "Показывать похожие видео? ",
"Show annotations by default: ": "Всегда показывать аннотации? ",
"Visual preferences": "Настройки сайта",
"Player style: ": "",
"Dark mode: ": "Тёмное оформление: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Облегчённое оформление: ",
"Subscription preferences": "Настройки подписок",
"Show annotations by default for subscribed channels? ": "Всегда показывать аннотации в видео каналов, на которые вы подписаны? ",
"Show annotations by default for subscribed channels: ": "Всегда показывать аннотации в видео каналов, на которые вы подписаны? ",
"Redirect homepage to feed: ": "Отображать видео с каналов, на которые вы подписаны, как главную страницу: ",
"Number of videos shown in feed: ": "Число видео, на которые вы подписаны, в ленте: ",
"Sort videos by: ": "Сортировать видео: ",
@@ -85,9 +90,9 @@
"Only show latest unwatched video from channel: ": "Показывать только непросмотренные видео с каналов: ",
"Only show unwatched: ": "Показывать только непросмотренные видео: ",
"Only show notifications (if there are any): ": "Показывать только оповещения, если они есть: ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "Включить уведомления в браузере",
"`x` uploaded a video": "`x` разместил видео",
"`x` is live": "`x` в прямом эфире",
"Data preferences": "Настройки данных",
"Clear watch history": "Очистить историю просмотров",
"Import/export data": "Импорт/Экспорт данных",
@@ -99,11 +104,11 @@
"Administrator preferences": "Администраторские настройки",
"Default homepage: ": "Главная страница по умолчанию: ",
"Feed menu: ": "Меню ленты видео: ",
"Top enabled? ": "Включить топ видео? ",
"CAPTCHA enabled? ": "Включить капчу? ",
"Login enabled? ": "Включить авторизацию? ",
"Registration enabled? ": "Включить регистрацию? ",
"Report statistics? ": "Сообщать статистику? ",
"Top enabled: ": "Включить топ видео? ",
"CAPTCHA enabled: ": "Включить капчу? ",
"Login enabled: ": "Включить авторизацию? ",
"Registration enabled: ": "Включить регистрацию? ",
"Report statistics: ": "Сообщать статистику? ",
"Save preferences": "Сохранить настройки",
"Subscription manager": "Менеджер подписок",
"Token manager": "Менеджер токенов",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Посмотреть информацию по лицензии JavaScript.",
"View privacy policy.": "Посмотреть политику конфиденциальности.",
"Trending": "В тренде",
"Public": "",
"Unlisted": "Нет в списке",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Смотреть на YouTube",
"Hide annotations": "Скрыть аннотации",
"Show annotations": "Показать аннотации",
@@ -136,6 +151,7 @@
"Shared `x`": "Опубликовано `x`",
"`x` views": "`x` просмотров",
"Premieres in `x`": "Премьера через `x`",
"Premieres `x`": "Премьера `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Похоже, у вас отключён JavaScript. Чтобы увидить комментарии, нажмите сюда, но учтите: они могут загружаться немного медленнее.",
"View YouTube comments": "Смотреть комментарии с YouTube",
"View more comments on Reddit": "Посмотреть больше комментариев на Reddit",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "%-d %B %Y, %A",
"(edited)": "(изменено)",
"YouTube comment permalink": "Прямая ссылка на YouTube",
"permalink": "",
"`x` marked it with a ❤": "❤ от автора канала \"`x`\"",
"Audio mode": "Аудио режим",
"Video mode": "Видео режим",
"Videos": "Видео",
"Playlists": "Плейлисты",
"Community": "",
"Current version: ": "Текущая версия: "
}

344
locales/tr.json Normal file
View File

@@ -0,0 +1,344 @@
{
"`x` subscribers": "",
"`x` videos": "",
"`x` playlists": "",
"`x` subscribers.": "`x` abone.",
"`x` videos.": "`x` video.",
"LIVE": "CANLI",
"Shared `x` ago": "`x` önce paylaşıldı",
"Unsubscribe": "Abonelikten çık",
"Subscribe": "Abone ol",
"View channel on YouTube": "Kanalı YouTube'da görüntüle",
"View playlist on YouTube": "Çalma listesini YouTube'da görüntüle",
"newest": "en yeni",
"oldest": "en eski",
"popular": "popüler",
"last": "son",
"Next page": "Sonraki sayfa",
"Previous page": "Önceki sayfa",
"Clear watch history?": "İzleme geçmisini temizle?",
"New password": "Yeni parola",
"New passwords must match": "Yeni parolalar eşleşmek zorunda",
"Cannot change password for Google accounts": "Google hesapları için parola değiştirilemez",
"Authorize token?": "Jetonu yetkilendir?",
"Authorize token for `x`?": "`x` için jetonu yetkilendir?",
"Yes": "Evet",
"No": "Hayır",
"Import and Export Data": "Verileri İçe ve Dışa Aktar",
"Import": "İçe aktar",
"Import Invidious data": "İnvidious verilerini içe aktar",
"Import YouTube subscriptions": "YouTube aboneliklerini içe aktar",
"Import FreeTube subscriptions (.db)": "FreeTube aboneliklerini içe aktar (.db)",
"Import NewPipe subscriptions (.json)": "NewPipe aboneliklerini içe aktar (.json)",
"Import NewPipe data (.zip)": "NewPipe verilerini içe aktar (.zip)",
"Export": "Dışa aktar",
"Export subscriptions as OPML": "Abonelikleri OPML olarak dışa aktar",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Abonelikleri OPML olarak dışa aktar (NewPipe ve FreeTube için)",
"Export data as JSON": "Verileri JSON olarak dışa aktar",
"Delete account?": "Hesabı sil?",
"History": "Geçmiş",
"An alternative front-end to YouTube": "YouTube için alternatif bir ön-yüz",
"JavaScript license information": "JavaScript lisans bilgileri",
"source": "kaynak",
"Log in": "Oturum aç",
"Log in/register": "Oturum aç/kayıt ol",
"Log in with Google": "Google ile oturum aç",
"User ID": "Kullanıcı kimliği",
"Password": "Parola",
"Time (h:mm:ss):": "Zaman (h:mm:ss):",
"Text CAPTCHA": "Metin CAPTCHA",
"Image CAPTCHA": "Resim CAPTCHA",
"Sign In": "Oturum Aç",
"Register": "Kayıt Ol",
"E-mail": "E-posta",
"Google verification code": "Google doğrulama kodu",
"Preferences": "Tercihler",
"Player preferences": "Oynatıcı tercihleri",
"Always loop: ": "Sürekli döngü: ",
"Autoplay: ": "Otomatik oynat: ",
"Play next by default: ": "Varsayılan olarak sonrakini oynat: ",
"Autoplay next video: ": "Sonraki videoyu otomatik oynat: ",
"Listen by default: ": "Varsayılan olarak dinle: ",
"Proxy videos: ": "Videoları proxy'le: ",
"Default speed: ": "Varsayılan hız: ",
"Preferred video quality: ": "Tercih edilen video kalitesi: ",
"Player volume: ": "Oynatıcı ses seviyesi: ",
"Default comments: ": "Varsayılan yorumlar: ",
"youtube": "youtube",
"reddit": "reddit",
"Default captions: ": "Varsayılan altyazılar: ",
"Fallback captions: ": "Yedek altyazılar: ",
"Show related videos: ": "İlgili videoları göster: ",
"Show annotations by default: ": "Varsayılan olarak ek açıklamaları göster: ",
"Visual preferences": "Görsel tercihler",
"Player style: ": "Oynatıcı biçimi: ",
"Dark mode: ": "Karanlık mod: ",
"Theme: ": "Tema: ",
"dark": "karanlık",
"light": "aydınlık",
"Thin mode: ": "İnce mod: ",
"Subscription preferences": "Abonelik tercihleri",
"Show annotations by default for subscribed channels: ": "Abone olunan kanallar için ek açıklamaları varsayılan olarak göster: ",
"Redirect homepage to feed: ": "Ana sayfayı akışa yönlendir: ",
"Number of videos shown in feed: ": "Akışta gösterilen video sayısı: ",
"Sort videos by: ": "Videoları sıralama kriteri: ",
"published": "yayınlandı",
"published - reverse": "yayınlandı - ters",
"alphabetically": "alfabetik olarak",
"alphabetically - reverse": "alfabetik olarak - ters",
"channel name": "kanal adı",
"channel name - reverse": "kanal adı - ters",
"Only show latest video from channel: ": "Sadece kanaldaki en son videoyu göster: ",
"Only show latest unwatched video from channel: ": "Sadece kanaldaki en son izlenmemiş videoyu göster: ",
"Only show unwatched: ": "Sadece izlenmemişleri göster: ",
"Only show notifications (if there are any): ": "Sadece bildirimleri göster (eğer varsa): ",
"Enable web notifications": "Ağ bildirimlerini etkinleştir",
"`x` uploaded a video": "`x` bir video yükledi",
"`x` is live": "`x` canlı yayında",
"Data preferences": "Veri tercihleri",
"Clear watch history": "İzleme geçmişini temizle",
"Import/export data": "Verileri içe/dışa aktar",
"Change password": "Parolayı değiştir",
"Manage subscriptions": "Abonelikleri yönet",
"Manage tokens": "Jetonları yönet",
"Watch history": "İzleme geçmişi",
"Delete account": "Hesap silme",
"Administrator preferences": "Yönetici tercihleri",
"Default homepage: ": "Varsayılan ana sayfa: ",
"Feed menu: ": "Akış menüsü: ",
"Top enabled: ": "Top etkin: ",
"CAPTCHA enabled: ": "CAPTCHA etkin: ",
"Login enabled: ": "Oturum açma etkin: ",
"Registration enabled: ": "Kayıt olma etkin: ",
"Report statistics: ": "Rapor istatistikleri: ",
"Save preferences": "Tercihleri kaydet",
"Subscription manager": "Abonelik yöneticisi",
"`x` subscriptions": "",
"`x` tokens": "",
"Token manager": "Jeton yöneticisi",
"Token": "Jeton",
"`x` subscriptions.": "`x` abonelik.",
"`x` tokens.": "`x` jeton.",
"`x` unseen notifications": "",
"Import/export": "İçe/dışa aktar",
"unsubscribe": "abonelikten çık",
"revoke": "geri al",
"Subscriptions": "Abonelikler",
"`x` unseen notifications.": "`x` okunmamış bildirim.",
"search": "ara",
"Log out": ıkış yap",
"Public": "",
"Released under the AGPLv3 by Omar Roth.": "Omar Roth tarafından AGPLv3 altında yayımlandı.",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Source available here.": "Kaynak kodu burada mevcut.",
"View JavaScript license information.": "JavaScript lisans bilgilerini görüntüle.",
"View privacy policy.": "Gizlilik politikasını görüntüle.",
"Trending": "Trendler",
"Unlisted": "Listelenmemiş",
"Watch on YouTube": "YouTube'da izle",
"Hide annotations": "Ek açıklamaları gizle",
"Show annotations": "Ek açıklamaları göster",
"Genre: ": "Tür: ",
"License: ": "Lisans: ",
"Family friendly? ": "Aile için uygun? ",
"`x` views": "",
"Wilson score: ": "Wilson puanı: ",
"Engagement: ": "İzleyenlerin oy verme oranı: ",
"Whitelisted regions: ": "Beyaz listeye alınan bölgeler: ",
"Blacklisted regions: ": "Kara listeye alınan bölgeler: ",
"Shared `x`": "`x` paylaşıldı",
"`x` views.": "`x` izlenme.",
"Premieres in `x`": "`x`içinde ilk gösterim",
"Premieres `x`": "`x` ilk gösterim",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Merhaba! JavaScript'i kapatmış gibi görünüyorsun. Yorumları görüntülemek için buraya tıkla, yüklenmelerinin biraz uzun sürebileceğini unutma.",
"View YouTube comments": "YouTube yorumlarını görüntüle",
"View more comments on Reddit": "Reddit'te daha fazla yorum görüntüle",
"View `x` comments": "`x` yorum görüntüle",
"View Reddit comments": "Reddit yorumlarını görüntüle",
"Hide replies": "Cevapları gizle",
"Show replies": "Cevapları göster",
"Incorrect password": "Yanlış parola",
"Quota exceeded, try again in a few hours": "Kota aşıldı, birkaç saat içinde tekrar deneyin",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "Oturum açılamadı, iki faktörlü kimlik doğrulamanın (Authenticator ya da SMS) açık olduğundan emin olun.",
"Invalid TFA code": "Geçersiz TFA kodu",
"Login failed. This may be because two-factor authentication is not turned on for your account.": "Giriş başarısız. Bunun nedeni, hesabınız için iki faktörlü kimlik doğrulamanın açık olmaması olabilir.",
"Wrong answer": "Yanlış cevap",
"Erroneous CAPTCHA": "Hatalı CAPTCHA",
"CAPTCHA is a required field": "CAPTCHA zorunlu bir alandır",
"User ID is a required field": "Kullanıcı kimliği zorunlu bir alandır",
"Password is a required field": "Parola zorunlu bir alandır",
"Wrong username or password": "Yanlış kullanıcı adı ya da parola",
"Please sign in using 'Log in with Google'": "Lütfen 'Google ile giriş yap' seçeneğini kullanarak oturum açın",
"Password cannot be empty": "Parola boş olamaz",
"Password cannot be longer than 55 characters": "Parola 55 karakterden uzun olamaz",
"Please log in": "Lütfen oturum açın",
"View `x` replies": "",
"Invidious Private Feed for `x`": "`x` için İnvidious Özel Akışı",
"channel:`x`": "kanal:`x`",
"`x` points": "",
"Deleted or invalid channel": "Silinmiş ya da geçersiz kanal",
"This channel does not exist.": "Bu kanal mevcut değil.",
"Could not get channel info.": "Kanal bilgisi alınamadı.",
"Could not fetch comments": "Yorumlar alınamadı",
"View `x` replies.": "`x` yanıtı görüntüle.",
"`x` ago": "`x` önce",
"Load more": "Daha fazla yükle",
"`x` points.": "`x` puan.",
"Could not create mix.": "Mix oluşturulamadı.",
"Empty playlist": "Boş oynatma listesi",
"Not a playlist.": "Oynatma listesi değil.",
"Playlist does not exist.": "Oynatma listesi mevcut değil.",
"Could not pull trending pages.": "Trend sayfaları alınamıyor.",
"Hidden field \"challenge\" is a required field": "Gizli alan \"challenge\" zorunlu bir alandır",
"Hidden field \"token\" is a required field": "Gizli alan \"jeton\" zorunlu bir alandır",
"Erroneous challenge": "Hatalı challenge",
"Erroneous token": "Hatalı jeton",
"No such user": "Böyle bir kullanıcı yok",
"Token is expired, please try again": "Jetonun süresi doldu, lütfen tekrar deneyin",
"English": "İngilizce",
"English (auto-generated)": "İngilizce (otomatik oluşturuldu)",
"Afrikaans": "Afrikanca",
"Albanian": "Arnavutça",
"Amharic": "Amharca",
"Arabic": "Arapça",
"Armenian": "Ermenice",
"Azerbaijani": "Azerice",
"Bangla": "Bengalce",
"Basque": "Baskça",
"Belarusian": "Belarusça",
"Bosnian": "Boşnakça",
"Bulgarian": "Bulgarca",
"Burmese": "Birmanca",
"Catalan": "Katalanca",
"Cebuano": "Sebuanca",
"Chinese (Simplified)": "Çince (Basitleştirilmiş)",
"Chinese (Traditional)": "Çince (Geleneksel)",
"Corsican": "Korsikaca",
"Croatian": "Hırvatça",
"Czech": "Çekçe",
"Danish": "Danca",
"Dutch": "Flemenkçe",
"Esperanto": "Esperanto",
"Estonian": "Estonca",
"Filipino": "Filipince",
"Finnish": "Fince",
"French": "Fransızca",
"Galician": "Galiçyaca",
"Georgian": "Gürcüce",
"German": "Almanca",
"Greek": "Yunanca",
"Gujarati": "Guceratça",
"Haitian Creole": "Haiti Creole dili",
"Hausa": "Hausaca",
"Hawaiian": "Hawaii dili",
"Hebrew": "İbranice",
"Hindi": "Hintçe",
"Hmong": "Hmong",
"Hungarian": "Macarca",
"Icelandic": "İzlandaca",
"Igbo": "İgbo",
"Indonesian": "Endonezce",
"Irish": "İrlandaca",
"Italian": "İtalyanca",
"Japanese": "Japonca",
"Javanese": "Cava dili",
"Kannada": "Kannada dili",
"Kazakh": "Kazakça",
"Khmer": "Kmerce",
"Korean": "Korece",
"Kurdish": "Kürtçe",
"Kyrgyz": "Kırgızca",
"Lao": "Laoca",
"Latin": "Latince",
"Latvian": "Letonca",
"Lithuanian": "Litvanyaca",
"Luxembourgish": "Lüksemburgca",
"Macedonian": "Makedonca",
"Malagasy": "Malgaşça",
"Malay": "Malayca",
"Malayalam": "Malayalam dili",
"Maltese": "Maltaca",
"Maori": "Maori dili",
"Marathi": "Marati dili",
"Mongolian": "Moğolca",
"Nepali": "Nepalce",
"Norwegian Bokmål": "Norveççe Bokmål",
"Nyanja": "Çevaca",
"Pashto": "Peştuca",
"Persian": "Farsça",
"Polish": "Lehçe",
"Portuguese": "Portekizce",
"Punjabi": "Pencap dili",
"Romanian": "Rumence",
"Russian": "Rusça",
"Samoan": "Samoa dili",
"Scottish Gaelic": "İskoç Galcesi",
"Serbian": "Sırpça",
"Shona": "Şona dili",
"Sindhi": "Sintçe",
"Sinhala": "Seylanca",
"Slovak": "Slovakça",
"Slovenian": "Slovence",
"Somali": "Somalice",
"Southern Sotho": "Güney Sotho dili",
"Spanish": "İspanyolca",
"Spanish (Latin America)": "İspanyolca (Latin Amerika)",
"Sundanese": "Sundaca",
"Swahili": "Svahili dili",
"Swedish": "İsveççe",
"Tajik": "Tacikçe",
"Tamil": "Tamilce",
"Telugu": "Telugu dili",
"Thai": "Tayca",
"Turkish": "Türkçe",
"Ukrainian": "Ukraynaca",
"Urdu": "Urduca",
"Uzbek": "Özbekçe",
"Vietnamese": "Vietnamca",
"Welsh": "Galce",
"Western Frisian": "Batı Frizcesi",
"Xhosa": "Xhosa dili",
"Yiddish": "Yiddiş",
"Yoruba": "Yoruba dili",
"Zulu": "Zuluca",
"`x` years": "`x` yıl",
"`x` months": "`x` ay",
"`x` weeks": "`x` hafta",
"`x` days": "`x` gün",
"`x` hours": "`x` saat",
"`x` minutes": "`x` dakika",
"`x` seconds": "`x` saniye",
"Fallback comments: ": "Yedek yorumlar: ",
"Popular": "Popüler",
"Top": "Enler",
"About": "Hakkında",
"Rating: ": "Değerlendirme: ",
"Language: ": "Dil: ",
"View as playlist": "Oynatma listesi olarak görüntüle",
"Default": "Varsayılan",
"Music": "Müzik",
"Gaming": "Oyun",
"News": "Haberler",
"Movies": "Filmler",
"Download": "İndir",
"Download as: ": "Şu şekilde indir: ",
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(düzenlendi)",
"YouTube comment permalink": "YouTube yorumu kalıcı linki",
"permalink": "kalıcı link",
"`x` marked it with a ❤": "`x` ❤ ile işaretlendi",
"Audio mode": "Ses modu",
"Video mode": "Video modu",
"Videos": "Videolar",
"Playlists": "Oynatma listeleri",
"Community": "Topluluk",
"Current version: ": "Şu anki versiyon: "
}

View File

@@ -1,12 +1,13 @@
{
"`x` subscribers": "`x` підписників",
"`x` videos": "`x` відео",
"`x` playlists": "",
"LIVE": "ПРЯМИЙ ЕФІР",
"Shared `x` ago": "Розміщено `x` назад",
"Unsubscribe": "Відписатися",
"Subscribe": "Підписатися",
"View channel on YouTube": "Подивитися канал на YouTube",
"View playlist on YouTube": "",
"View playlist on YouTube": "Подивитися плейлист на YouTube",
"newest": "найновіше",
"oldest": "найстаріше",
"popular": "популярне",
@@ -56,7 +57,7 @@
"Play next by default: ": "Завжди вмикати наступне відео: ",
"Autoplay next video: ": "Автовідтворення наступного відео: ",
"Listen by default: ": "Режим «тільки звук» як усталений: ",
"Proxy videos? ": "Програвати відео через проксі? ",
"Proxy videos: ": "Програвати відео через проксі? ",
"Default speed: ": "Усталена швидкість відео: ",
"Preferred video quality: ": "Пріорітетна якість відео: ",
"Player volume: ": "Гучність відео: ",
@@ -65,13 +66,17 @@
"reddit": "Reddit",
"Default captions: ": "Основна мова субтитрів: ",
"Fallback captions: ": "Запасна мова субтитрів: ",
"Show related videos? ": "Показувати схожі відео? ",
"Show annotations by default? ": "Завжди показувати анотації? ",
"Show related videos: ": "Показувати схожі відео? ",
"Show annotations by default: ": "Завжди показувати анотації? ",
"Visual preferences": "Налаштування сайту",
"Player style: ": "",
"Dark mode: ": "Темне оформлення: ",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "Полегшене оформлення: ",
"Subscription preferences": "Налаштування підписок",
"Show annotations by default for subscribed channels? ": "Завжди показувати анотації у відео каналів, на які ви підписані? ",
"Show annotations by default for subscribed channels: ": "Завжди показувати анотації у відео каналів, на які ви підписані? ",
"Redirect homepage to feed: ": "Показувати відео з каналів, на які підписані, як головну сторінку: ",
"Number of videos shown in feed: ": "Кількість відео з каналів, на які підписані, у потоці: ",
"Sort videos by: ": "Сортувати відео: ",
@@ -85,9 +90,9 @@
"Only show latest unwatched video from channel: ": "Показувати тільки непереглянуті відео з каналів: ",
"Only show unwatched: ": "Показувати тільки непереглянуті відео: ",
"Only show notifications (if there are any): ": "Показувати лише сповіщення, якщо вони є: ",
"Enable web notifications": "",
"`x` uploaded a video": "",
"`x` is live": "",
"Enable web notifications": "Ввімкнути сповіщення в браузері",
"`x` uploaded a video": "`x` розмістив відео",
"`x` is live": "`x` у прямому ефірі",
"Data preferences": "Налаштування даних",
"Clear watch history": "Очистити історію переглядів",
"Import/export data": "Імпорт і експорт даних",
@@ -99,11 +104,11 @@
"Administrator preferences": "Адміністраторські налаштування",
"Default homepage: ": "Усталена домашня сторінка: ",
"Feed menu: ": "Меню потоку з відео: ",
"Top enabled? ": "Увімкнути топ відео? ",
"CAPTCHA enabled? ": "Увімкнути капчу? ",
"Login enabled? ": "Увімкнути авторизацію? ",
"Registration enabled? ": "Увімкнути реєстрацію? ",
"Report statistics? ": "Повідомляти статистику? ",
"Top enabled: ": "Увімкнути топ відео? ",
"CAPTCHA enabled: ": "Увімкнути капчу? ",
"Login enabled: ": "Увімкнути авторизацію? ",
"Registration enabled: ": "Увімкнути реєстрацію? ",
"Report statistics: ": "Повідомляти статистику? ",
"Save preferences": "Зберегти налаштування",
"Subscription manager": "Менеджер підписок",
"Token manager": "Менеджер токенів",
@@ -122,7 +127,17 @@
"View JavaScript license information.": "Переглянути інформацію щодо ліцензії JavaScript.",
"View privacy policy.": "Переглянути політику приватності.",
"Trending": "У тренді",
"Public": "",
"Unlisted": "Немає в списку",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "Дивитися на YouTube",
"Hide annotations": "Приховати анотації",
"Show annotations": "Показати анотації",
@@ -136,6 +151,7 @@
"Shared `x`": "Розміщено `x`",
"`x` views": "`x` переглядів",
"Premieres in `x`": "Прем’єра через `x`",
"Premieres `x`": "Прем’єра `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "Схоже, у вас відключений JavaScript. Щоб побачити коментарі, натисніть сюда, але майте на увазі, що вони можуть завантажуватися трохи довше.",
"View YouTube comments": "Переглянути коментарі з YouTube",
"View more comments on Reddit": "Переглянути більше коментарів на Reddit",
@@ -309,10 +325,12 @@
"%A %B %-d, %Y": "%-d %B %Y, %A",
"(edited)": "(змінено)",
"YouTube comment permalink": "Пряме посилання на коментар в YouTube",
"permalink": "",
"`x` marked it with a ❤": "❤ цьому від каналу `x`",
"Audio mode": "Аудіорежим",
"Video mode": "Відеорежим",
"Videos": "Відео",
"Playlists": "Плейлисти",
"Community": "",
"Current version: ": "Поточна версія: "
}

336
locales/zh-CN.json Normal file
View File

@@ -0,0 +1,336 @@
{
"`x` subscribers": "`x` 订阅者",
"`x` videos": "`x` 视频",
"`x` playlists": "",
"LIVE": "直播",
"Shared `x` ago": "`x` 前分享",
"Unsubscribe": "取消订阅",
"Subscribe": "订阅",
"View channel on YouTube": "在 YouTube 查看频道",
"View playlist on YouTube": "在 YouTube 查看播放列表",
"newest": "最新",
"oldest": "最老",
"popular": "时下流行",
"last": "last",
"Next page": "下一页",
"Previous page": "上一页",
"Clear watch history?": "清除观看历史?",
"New password": "新密码",
"New passwords must match": "新密码必须匹配",
"Cannot change password for Google accounts": "无法为 Google 账户更改密码",
"Authorize token?": "授权令牌?",
"Authorize token for `x`?": "`x` 的授权令牌?",
"Yes": "是",
"No": "否",
"Import and Export Data": "导入与导出数据",
"Import": "导入",
"Import Invidious data": "导入 Invidious 数据",
"Import YouTube subscriptions": "导入 YouTube 订阅",
"Import FreeTube subscriptions (.db)": "导入 FreeTube 订阅 (.db)",
"Import NewPipe subscriptions (.json)": "导入 NewPipe 订阅 (.json)",
"Import NewPipe data (.zip)": "导入 NewPipe 数据 (.zip)",
"Export": "导出",
"Export subscriptions as OPML": "导出订阅到 OPML 格式",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "导出订阅到 OPML 格式(用于 NewPipe 及 FreeTube",
"Export data as JSON": "导出数据为 JSON 格式",
"Delete account?": "删除账户?",
"History": "历史",
"An alternative front-end to YouTube": "另一个 YouTube 前端",
"JavaScript license information": "JavaScript 授权信息",
"source": "source",
"Log in": "登录",
"Log in/register": "登录/注册",
"Log in with Google": "使用 Google 账户登录",
"User ID": "用户 ID",
"Password": "密码",
"Time (h:mm:ss):": "时间 (h:mm:ss):",
"Text CAPTCHA": "文本验证码",
"Image CAPTCHA": "图片验证码",
"Sign In": "登录",
"Register": "注册",
"E-mail": "E-mail",
"Google verification code": "Google 验证代码",
"Preferences": "偏好设置",
"Player preferences": "播放器偏好设置",
"Always loop: ": "循环:",
"Autoplay: ": "自动播放:",
"Play next by default: ": "默认自动播放下一个视频:",
"Autoplay next video: ": "自动播放下一个视频:",
"Listen by default: ": "默认只聆听声音:",
"Proxy videos: ": "代理视频?",
"Default speed: ": "默认速度:",
"Preferred video quality: ": "视频质量偏好:",
"Player volume: ": "播放器音量:",
"Default comments: ": "默认评论源:",
"youtube": "YouTube",
"reddit": "Reddit",
"Default captions: ": "默认字幕语言:",
"Fallback captions: ": "后备字幕语言:",
"Show related videos: ": "显示相关视频?",
"Show annotations by default: ": "默认显示视频注释?",
"Visual preferences": "视觉选项",
"Player style: ": "",
"Dark mode: ": "暗色模式:",
"Theme: ": "",
"dark": "",
"light": "",
"Thin mode: ": "窄页模式:",
"Subscription preferences": "订阅设置",
"Show annotations by default for subscribed channels: ": "在订阅频道的视频默认显示注释?",
"Redirect homepage to feed: ": "跳转主页到 feed: ",
"Number of videos shown in feed: ": "Feed 中显示的视频数量:",
"Sort videos by: ": "视频排序方式:",
"published": "发布时间",
"published - reverse": "发布时间(反向)",
"alphabetically": "字母序",
"alphabetically - reverse": "字母序(反向)",
"channel name": "频道名称",
"channel name - reverse": "频道名称(反向)",
"Only show latest video from channel: ": "只显示订阅频道的最新一条视频:",
"Only show latest unwatched video from channel: ": "只显示订阅频道的最新未看过视频:",
"Only show unwatched: ": "只显示未看过的视频:",
"Only show notifications (if there are any): ": "只显示通知(如有):",
"Enable web notifications": "启用浏览器通知",
"`x` uploaded a video": "`x` 上传了视频",
"`x` is live": "`x` 正在直播",
"Data preferences": "数据选项",
"Clear watch history": "清除观看历史",
"Import/export data": "导入/导出数据",
"Change password": "更改密码",
"Manage subscriptions": "管理订阅",
"Manage tokens": "管理令牌",
"Watch history": "观看历史",
"Delete account": "删除账户",
"Administrator preferences": "管理员选项",
"Default homepage: ": "默认主页:",
"Feed menu: ": "Feed 菜单:",
"Top enabled: ": "启用“热门视频”页?",
"CAPTCHA enabled: ": "启用验证码?",
"Login enabled: ": "启用登录?",
"Registration enabled: ": "启用注册?",
"Report statistics: ": "报告统计信息?",
"Save preferences": "保存选项",
"Subscription manager": "订阅管理器",
"Token manager": "令牌管理器",
"Token": "令牌",
"`x` subscriptions": "`x` 个订阅",
"`x` tokens": "`x` 个令牌",
"Import/export": "导入/导出",
"unsubscribe": "取消订阅",
"revoke": "吊销",
"Subscriptions": "订阅",
"`x` unseen notifications": "`x` 条未读通知",
"search": "搜索",
"Log out": "登出",
"Released under the AGPLv3 by Omar Roth.": "由 Omar Roth 开发,以 AGPLv3 授权。",
"Source available here.": "源码可在此查看。",
"View JavaScript license information.": "查看 JavaScript 协议信息。",
"View privacy policy.": "查看隐私政策。",
"Trending": "时下流行",
"Public": "",
"Unlisted": "不公开",
"Private": "",
"View all playlists": "",
"Updated `x` ago": "",
"Delete playlist `x`?": "",
"Delete playlist": "",
"Create playlist": "",
"Title": "",
"Playlist privacy": "",
"Editing playlist `x`": "",
"Watch on YouTube": "在 YouTube 观看",
"Hide annotations": "隐藏注释",
"Show annotations": "显示注释",
"Genre: ": "风格:",
"License: ": "协议:",
"Family friendly? ": "家庭友好?",
"Wilson score: ": "威尔逊得分:",
"Engagement: ": "参与度:",
"Whitelisted regions: ": "白名单区域:",
"Blacklisted regions: ": "黑名单区域:",
"Shared `x`": "`x`发布",
"`x` views": "`x` 播放",
"Premieres in `x`": "首映于 `x` 后",
"Premieres `x`": "首映于 `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "你好!看起来你关闭了 JavaScript。点击这里阅读评论。注意它们加载的时间可能会稍长。",
"View YouTube comments": "查看 YouTube 评论",
"View more comments on Reddit": "在 Reddit 查看更多评论",
"View `x` comments": "查看 `x` 条评论",
"View Reddit comments": "查看 Reddit 评论",
"Hide replies": "隐藏回复",
"Show replies": "显示回复",
"Incorrect password": "密码错误",
"Quota exceeded, try again in a few hours": "已超出限额,请于几小时后重试",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "无法登录。请确认你的短信或验证器的二步验证已打开。",
"Invalid TFA code": "无效的二步验证码",
"Login failed. This may be because two-factor authentication is not turned on for your account.": "登录失败。可能是因为二步验证未打开。",
"Wrong answer": "错误的回复",
"Erroneous CAPTCHA": "验证码错误",
"CAPTCHA is a required field": "验证码必填",
"User ID is a required field": "用户名必填",
"Password is a required field": "密码必填",
"Wrong username or password": "用户名或密码错误",
"Please sign in using 'Log in with Google'": "请通过谷歌账户登录",
"Password cannot be empty": "密码不能为空",
"Password cannot be longer than 55 characters": "密码长度不能大于 55",
"Please log in": "请登录",
"Invidious Private Feed for `x`": "`x` 的 Invidious 私人 feed",
"channel:`x`": "频道:`x`",
"Deleted or invalid channel": "已删除或无效频道",
"This channel does not exist.": "频道不存在。",
"Could not get channel info.": "无法获取频道信息。",
"Could not fetch comments": "无法获取评论",
"View `x` replies": "查看 `x` 条回复",
"`x` ago": "`x` 前",
"Load more": "加载更多",
"`x` points": "`x` 分",
"Could not create mix.": "无法创建合集。",
"Empty playlist": "空播放列表",
"Not a playlist.": "非播放列表。",
"Playlist does not exist.": "播放列表不存在。",
"Could not pull trending pages.": "无法获取“时下流行”页面。",
"Hidden field \"challenge\" is a required field": "隐藏表单项 \"challenge\" 为必填",
"Hidden field \"token\" is a required field": "隐藏表单项 \"token\" 为必填",
"Erroneous challenge": "错误的验证回复(challenge)",
"Erroneous token": "错误的令牌",
"No such user": "用户不存在",
"Token is expired, please try again": "令牌过期,请重试",
"English": "英语",
"English (auto-generated)": "英语(自动生成)",
"Afrikaans": "南非荷兰语",
"Albanian": "阿尔巴尼亚语",
"Amharic": "阿姆哈拉语",
"Arabic": "阿拉伯语",
"Armenian": "亚美尼亚语",
"Azerbaijani": "阿塞拜疆语",
"Bangla": "孟加拉语",
"Basque": "巴斯克语",
"Belarusian": "白俄罗斯语",
"Bosnian": "波黑语",
"Bulgarian": "保加利亚语",
"Burmese": "缅甸语",
"Catalan": "加泰罗尼亚语",
"Cebuano": "宿雾语",
"Chinese (Simplified)": "中文(简体)",
"Chinese (Traditional)": "中文(繁体)",
"Corsican": "科西嘉语",
"Croatian": "克罗地亚语",
"Czech": "捷克语",
"Danish": "丹麦语",
"Dutch": "荷兰语",
"Esperanto": "世界语",
"Estonian": "爱沙尼亚语",
"Filipino": "菲律宾语",
"Finnish": "芬兰语",
"French": "法语",
"Galician": "加利西亚语",
"Georgian": "格鲁吉亚语",
"German": "德语",
"Greek": "希腊语",
"Gujarati": "古吉拉特语",
"Haitian Creole": "海地克里奥尔语",
"Hausa": "豪萨语",
"Hawaiian": "夏威夷语",
"Hebrew": "希伯来语",
"Hindi": "印地语",
"Hmong": "苗语",
"Hungarian": "匈牙利语",
"Icelandic": "冰岛语",
"Igbo": "伊博语",
"Indonesian": "印度尼西亚语",
"Irish": "爱尔兰语",
"Italian": "意大利语",
"Japanese": "日语",
"Javanese": "爪哇语",
"Kannada": "卡纳达语",
"Kazakh": "哈萨克语",
"Khmer": "高棉语",
"Korean": "韩语",
"Kurdish": "库尔德语",
"Kyrgyz": "柯尔克孜语",
"Lao": "老挝语",
"Latin": "拉丁语",
"Latvian": "拉脱维亚语",
"Lithuanian": "立陶宛语",
"Luxembourgish": "卢森堡语",
"Macedonian": "马其顿语",
"Malagasy": "马尔加什语",
"Malay": "马来语",
"Malayalam": "马拉雅拉姆语",
"Maltese": "马耳他语",
"Maori": "毛利语",
"Marathi": "马拉语",
"Mongolian": "蒙古语",
"Nepali": "尼泊尔语",
"Norwegian Bokmål": "书面挪威语",
"Nyanja": "尼昂加语",
"Pashto": "普什图语",
"Persian": "波斯语",
"Polish": "抛光",
"Portuguese": "葡萄牙语",
"Punjabi": "旁遮普语",
"Romanian": "罗马尼亚语",
"Russian": "俄语",
"Samoan": "萨摩亚语",
"Scottish Gaelic": "苏格兰盖尔语",
"Serbian": "塞尔维亚语",
"Shona": "绍纳语",
"Sindhi": "信德语",
"Sinhala": "僧伽罗语",
"Slovak": "斯洛伐克语",
"Slovenian": "斯洛文尼亚语",
"Somali": "索马里语",
"Southern Sotho": "南索托语",
"Spanish": "西班牙语",
"Spanish (Latin America)": "西班牙语(拉丁美洲)",
"Sundanese": "巽丹语",
"Swahili": "斯瓦希里语",
"Swedish": "瑞典语",
"Tajik": "塔吉克语",
"Tamil": "泰米尔语",
"Telugu": "泰卢固语",
"Thai": "泰语",
"Turkish": "土耳其语",
"Ukrainian": "乌克兰语",
"Urdu": "乌尔都语",
"Uzbek": "乌兹别克",
"Vietnamese": "越南语",
"Welsh": "威尔士语",
"Western Frisian": "西弗里西亚语",
"Xhosa": "科萨语",
"Yiddish": "意第绪语",
"Yoruba": "约鲁巴语",
"Zulu": "祖鲁语",
"`x` years": "`x` 年",
"`x` months": "`x` 月",
"`x` weeks": "`x` 周",
"`x` days": "`x` 天",
"`x` hours": "`x` 小时",
"`x` minutes": "`x` 分钟",
"`x` seconds": "`x` 秒",
"Fallback comments: ": "后备评论:",
"Popular": "热门频道",
"Top": "热门视频",
"About": "关于",
"Rating: ": "评分:",
"Language: ": "语言:",
"View as playlist": "作为播放列表查看",
"Default": "默认",
"Music": "音乐",
"Gaming": "游戏",
"News": "新闻",
"Movies": "电影",
"Download": "下载",
"Download as: ": "下载为:",
"%A %B %-d, %Y": "%Y年%-m月%-d日 %a",
"(edited)": "(已编辑)",
"YouTube comment permalink": "YouTube 评论永久链接",
"permalink": "",
"`x` marked it with a ❤": "`x` 为此加 ❤",
"Audio mode": "音频模式",
"Video mode": "视频模式",
"Videos": "视频",
"Playlists": "播放列表",
"Community": "",
"Current version: ": "当前版本:"
}

381
locales/zh-TW.json Normal file
View File

@@ -0,0 +1,381 @@
{
"`x` subscribers": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個訂閱者",
"": "`x` 個訂閱者"
},
"`x` videos": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 部影片",
"": "`x` 部影片"
},
"`x` playlists": "",
"LIVE": "直播",
"Shared `x` ago": "`x` 前分享",
"Unsubscribe": "取消訂閱",
"Subscribe": "訂閱",
"View channel on YouTube": "在 YouTube 上檢視頻道",
"View playlist on YouTube": "在 YouTube 上檢視播放清單",
"newest": "最新",
"oldest": "最舊",
"popular": "流行",
"last": "上一個",
"Next page": "下一頁",
"Previous page": "上一頁",
"Clear watch history?": "清除觀看歷史?",
"New password": "新密碼",
"New passwords must match": "新密碼必須符合",
"Cannot change password for Google accounts": "無法變更 Google 帳號的密碼",
"Authorize token?": "授權 token",
"Authorize token for `x`?": "`x` 的授權 token",
"Yes": "是",
"No": "否",
"Import and Export Data": "匯入與匯出資料",
"Import": "匯入",
"Import Invidious data": "匯入 Invidious 資料",
"Import YouTube subscriptions": "匯入 YouTube 訂閱",
"Import FreeTube subscriptions (.db)": "匯入 FreeTube 訂閱 (.db)",
"Import NewPipe subscriptions (.json)": "匯入 NewPipe 訂閱 (.json)",
"Import NewPipe data (.zip)": "匯入 NewPipe 資料 (.zip)",
"Export": "匯出",
"Export subscriptions as OPML": "將訂閱匯出為 OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "將訂閱匯出為 OPML供 NewPipe 與 FreeTube 使用)",
"Export data as JSON": "將 JSON 匯出為 JSON",
"Delete account?": "刪除帳號?",
"History": "歷史",
"An alternative front-end to YouTube": "一個 YouTube 的替代前端",
"JavaScript license information": "JavaScript 授權條款資訊",
"source": "來源",
"Log in": "登入",
"Log in/register": "登入/註冊",
"Log in with Google": "使用 Google 登入",
"User ID": "使用者 ID",
"Password": "密碼",
"Time (h:mm:ss):": "時間 (h:mm:ss):",
"Text CAPTCHA": "文字 CAPTCHA",
"Image CAPTCHA": "圖片 CAPTCHA",
"Sign In": "登入",
"Register": "註冊",
"E-mail": "電子郵件",
"Google verification code": "Google 驗證碼",
"Preferences": "偏好設定",
"Player preferences": "播放器偏好設定",
"Always loop: ": "總是循環播放:",
"Autoplay: ": "自動播放:",
"Play next by default: ": "預設播放下一部:",
"Autoplay next video: ": "自動播放下一部影片:",
"Listen by default: ": "預設聆聽:",
"Proxy videos: ": "代理影片:",
"Default speed: ": "預設速度:",
"Preferred video quality: ": "偏好的影片畫質:",
"Player volume: ": "播放器音量:",
"Default comments: ": "預設留言:",
"youtube": "youtube",
"reddit": "reddit",
"Default captions: ": "預設字幕:",
"Fallback captions: ": "汰退字幕:",
"Show related videos: ": "顯示相關的影片:",
"Show annotations by default: ": "預設顯示註釋:",
"Visual preferences": "視覺偏好設定",
"Player style: ": "播放器樣式",
"Dark mode: ": "深色模式:",
"Theme: ": "佈景主題",
"dark": "深色",
"light": "淺色",
"Thin mode: ": "精簡模式:",
"Subscription preferences": "訂閱偏好設定",
"Show annotations by default for subscribed channels: ": "預設為已訂閱的頻道顯示註釋?",
"Redirect homepage to feed: ": "重新導向首頁至 feed",
"Number of videos shown in feed: ": "顯示在 feed 中的影片數量:",
"Sort videos by: ": "以此種方式排序影片:",
"published": "已發佈",
"published - reverse": "已發佈 - 反向",
"alphabetically": "字母",
"alphabetically - reverse": "字母 - 反向",
"channel name": "頻道名稱",
"channel name - reverse": "頻道名稱 - 反向",
"Only show latest video from channel: ": "僅顯示從頻道而來的最新影片:",
"Only show latest unwatched video from channel: ": "僅顯示從頻道而來的未觀看影片:",
"Only show unwatched: ": "僅顯示未觀看的:",
"Only show notifications (if there are any): ": "僅顯示通知(如果有的話):",
"Enable web notifications": "啟用網路通知",
"`x` uploaded a video": "`x` 上傳了一部影片",
"`x` is live": "`x` 正在直播",
"Data preferences": "資料偏好設定",
"Clear watch history": "清除觀看歷史",
"Import/export data": "匯入/匯出資料",
"Change password": "變更密碼",
"Manage subscriptions": "管理訂閱",
"Manage tokens": "管理 tokens",
"Watch history": "觀看歷史",
"Delete account": "刪除帳號",
"Administrator preferences": "管理員偏好設定",
"Default homepage: ": "預設首頁:",
"Feed menu: ": "Feed 選單:",
"Top enabled: ": "頂部啟用:",
"CAPTCHA enabled: ": "CAPTCHA 啟用:",
"Login enabled: ": "啟用登入?",
"Registration enabled: ": "啟用註冊?",
"Report statistics: ": "回報統計?",
"Save preferences": "儲存偏好設定",
"Subscription manager": "訂閱管理員",
"Token manager": "Token 管理員",
"Token": "Token",
"`x` subscriptions": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個訂閱",
"": "`x` 個訂閱"
},
"`x` tokens": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` token",
"": "`x` tokens"
},
"Import/export": "匯入/匯出",
"unsubscribe": "取消訂閱",
"revoke": "撤銷",
"Subscriptions": "訂閱",
"`x` unseen notifications": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個未讀的通知",
"": "`x` 個未讀的通知"
},
"search": "搜尋",
"Log out": "登出",
"Released under the AGPLv3 by Omar Roth.": "Omar Roth 以 AGPLv3 釋出。",
"Source available here.": "原始碼在此提供。",
"View JavaScript license information.": "檢視 JavaScript 授權條款資訊。",
"View privacy policy.": "檢視隱私權政策。",
"Trending": "趨勢",
"Public": "公開",
"Unlisted": "未列出",
"Private": "私人",
"View all playlists": "檢視所有播放清單",
"Updated `x` ago": "更新於 `x` 之前",
"Delete playlist `x`?": "刪除播放清單",
"Delete playlist": "刪除播放清單",
"Create playlist": "建立播放清單",
"Title": "標題",
"Playlist privacy": "播放清單隱私",
"Editing playlist `x`": "已編輯播放清單 `x`",
"Watch on YouTube": "在 YouTube 上觀看",
"Hide annotations": "隱藏註釋",
"Show annotations": "顯示註釋",
"Genre: ": "風格:",
"License: ": "授權條款:",
"Family friendly? ": "家庭友好?",
"Wilson score: ": "威爾遜分數:",
"Engagement: ": "參與度:",
"Whitelisted regions: ": "白名單區域:",
"Blacklisted regions: ": "黑名單區域:",
"Shared `x`": "`x` 發佈",
"`x` views": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 次檢視",
"": "`x` 次檢視"
},
"Premieres in `x`": "首映於 `x`",
"Premieres `x`": "首映於 `x`",
"Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.": "嗨!看來您將 JavaScript 關閉了。點擊這裡以檢視留言,請注意,它們可能需要比較長的時間載入。",
"View YouTube comments": "檢視 YouTube 留言",
"View more comments on Reddit": "在 Reddit 上檢視更多留言",
"View `x` comments": "檢視 `x` 則留言",
"View Reddit comments": "檢視 Reddit 留言",
"Hide replies": "隱藏回覆",
"Show replies": "顯示回覆",
"Incorrect password": "不正確的密碼",
"Quota exceeded, try again in a few hours": "超過限額,請在幾個小時後再試一次",
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "無法登入,請確定雙因素驗證(驗證器或簡訊)已開啟。",
"Invalid TFA code": "無效的 TFA 代碼",
"Login failed. This may be because two-factor authentication is not turned on for your account.": "登入失敗。這可能是因為您的帳號未開啟雙因素驗證的關係。",
"Wrong answer": "錯誤的答案",
"Erroneous CAPTCHA": "錯誤的 CAPTCHA",
"CAPTCHA is a required field": "CAPTCHA 為必填欄位",
"User ID is a required field": "使用者 ID 為必填欄位",
"Password is a required field": "密碼為必填欄位",
"Wrong username or password": "錯誤的使用者名稱或密碼",
"Please sign in using 'Log in with Google'": "請使用「以 Google 登入」來登入",
"Password cannot be empty": "密碼不能為空",
"Password cannot be longer than 55 characters": "密碼不能長於55個字元",
"Please log in": "請登入",
"Invidious Private Feed for `x`": "`x` 的 Invidious 私密 feed",
"channel:`x`": "頻道:`x`",
"Deleted or invalid channel": "已刪除或無效的頻道",
"This channel does not exist.": "此頻道不存在。",
"Could not get channel info.": "無法取得頻道資訊。",
"Could not fetch comments": "無法擷取留言",
"View `x` replies": {
"([^.,0-9]|^)1([^.,0-9]|$)": "檢視 `x` 則回覆",
"": "檢視 `x` 則回覆"
},
"`x` ago": "`x` 以前",
"Load more": "載入更多",
"`x` points": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 點",
"": "`x` 點"
},
"Could not create mix.": "無法建立混合。",
"Empty playlist": "空的播放清單",
"Not a playlist.": "不是播放清單。",
"Playlist does not exist.": "播放清單不存在。",
"Could not pull trending pages.": "無法拉取趨勢頁面。",
"Hidden field \"challenge\" is a required field": "隱藏的欄位 \"challenge\" 是必填欄位",
"Hidden field \"token\" is a required field": "隱藏的欄位 \"token\" 是必填欄位",
"Erroneous challenge": "錯誤的 challenge",
"Erroneous token": "錯誤的 token",
"No such user": "無此使用者",
"Token is expired, please try again": "Token 已過期,請再試一次",
"English": "英文",
"English (auto-generated)": "英文(自動生成)",
"Afrikaans": "南非語",
"Albanian": "阿爾巴尼亞語",
"Amharic": "阿姆哈拉語",
"Arabic": "阿拉伯語",
"Armenian": "亞美尼亞語",
"Azerbaijani": "亞塞拜然語",
"Bangla": "孟加拉文",
"Basque": "巴斯克語",
"Belarusian": "白俄羅斯語",
"Bosnian": "波士尼亞語",
"Bulgarian": "保加利亞語",
"Burmese": "緬甸語",
"Catalan": "加泰隆尼亞語",
"Cebuano": "宿霧語",
"Chinese (Simplified)": "簡體中文",
"Chinese (Traditional)": "繁體中文",
"Corsican": "科西嘉語",
"Croatian": "克羅埃西亞語",
"Czech": "捷克語",
"Danish": "丹麥語",
"Dutch": "荷蘭語",
"Esperanto": "世界語",
"Estonian": "愛沙尼亞語",
"Filipino": "菲律賓語",
"Finnish": "芬蘭語",
"French": "法語",
"Galician": "加利西亞語",
"Georgian": "喬治亞語",
"German": "德語",
"Greek": "希臘語",
"Gujarati": "古吉拉特語",
"Haitian Creole": "海地克里奧爾語",
"Hausa": "豪薩語",
"Hawaiian": "夏威夷語",
"Hebrew": "希伯來語",
"Hindi": "印地語",
"Hmong": "苗文",
"Hungarian": "匈牙利語",
"Icelandic": "冰島語",
"Igbo": "伊博語",
"Indonesian": "印尼語",
"Irish": "愛爾蘭語",
"Italian": "義大利語",
"Japanese": "日語",
"Javanese": "爪哇語",
"Kannada": "康納達語",
"Kazakh": "哈薩克語",
"Khmer": "高棉文",
"Korean": "韓語",
"Kurdish": "庫德語",
"Kyrgyz": "吉爾吉斯語",
"Lao": "寮語",
"Latin": "拉丁語",
"Latvian": "拉脫維亞語",
"Lithuanian": "立陶宛語",
"Luxembourgish": "盧森堡語",
"Macedonian": "馬其頓語",
"Malagasy": "馬拉加斯語",
"Malay": "馬來語",
"Malayalam": "馬拉雅拉姆語",
"Maltese": "馬爾他語",
"Maori": "毛利語",
"Marathi": "馬拉提語",
"Mongolian": "蒙古語",
"Nepali": "尼泊爾語",
"Norwegian Bokmål": "書面挪威語",
"Nyanja": "尼揚賈語",
"Pashto": "普什圖語",
"Persian": "波斯語",
"Polish": "波蘭人",
"Portuguese": "葡萄牙語",
"Punjabi": "旁遮普語",
"Romanian": "羅馬尼亞語",
"Russian": "俄語",
"Samoan": "薩摩亞語",
"Scottish Gaelic": "蘇格蘭蓋爾語",
"Serbian": "塞爾維亞語",
"Shona": "修納語",
"Sindhi": "信德語",
"Sinhala": "僧伽羅語",
"Slovak": "斯洛伐克語",
"Slovenian": "斯洛維尼亞語",
"Somali": "索馬利亞語",
"Southern Sotho": "南塞索托語",
"Spanish": "西班牙語",
"Spanish (Latin America)": "西班牙語(拉丁美洲)",
"Sundanese": "巽他語",
"Swahili": "斯瓦希里語",
"Swedish": "瑞典語",
"Tajik": "塔吉克語",
"Tamil": "坦米爾語",
"Telugu": "泰盧固語",
"Thai": "泰語",
"Turkish": "土耳其語",
"Ukrainian": "烏克蘭語",
"Urdu": "烏爾都語",
"Uzbek": "烏茲別克語",
"Vietnamese": "越南語",
"Welsh": "威爾斯語",
"Western Frisian": "西菲士蘭語",
"Xhosa": "科薩語",
"Yiddish": "意第緒語",
"Yoruba": "約魯巴語",
"Zulu": "祖魯語",
"`x` years": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 年",
"": "`x` 年"
},
"`x` months": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 月",
"": "`x` 月"
},
"`x` weeks": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 週",
"": "`x` 週"
},
"`x` days": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 天",
"": "`x` 天"
},
"`x` hours": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 小時",
"": "`x` 小時"
},
"`x` minutes": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 天",
"": "`x` 天"
},
"`x` seconds": {
"([^.,0-9]|^)1([^.,0-9]|$)": "`x` 秒",
"": "`x` 秒"
},
"Fallback comments: ": "汰退留言:",
"Popular": "熱門頻道",
"Top": "熱門影片",
"About": "關於",
"Rating: ": "評分:",
"Language: ": "語言:",
"View as playlist": "以播放清單檢視",
"Default": "預設值",
"Music": "音樂",
"Gaming": "遊戲",
"News": "新聞",
"Movies": "電影",
"Download": "下載",
"Download as: ": "下載為:",
"%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(已編輯)",
"YouTube comment permalink": "YouTube 留言永久連結",
"permalink": "",
"`x` marked it with a ❤": "`x` 為此標記 ❤",
"Audio mode": "音訊模式",
"Video mode": "視訊模式",
"Videos": "影片",
"Playlists": "播放清單",
"Community": "社群",
"Current version: ": "目前版本:"
}

View File

@@ -1,5 +1,5 @@
name: invidious
version: 0.18.0
version: 0.20.0
authors:
- Omar Roth <omarroth@protonmail.com>
@@ -9,13 +9,22 @@ targets:
main: src/invidious.cr
dependencies:
kemal:
github: kemalcr/kemal
pg:
github: will/crystal-pg
version: ~> 0.19.0
sqlite3:
github: crystal-lang/crystal-sqlite3
version: ~> 0.14.0
kemal:
github: kemalcr/kemal
version: ~> 0.26.0
pool:
github: ysbaddaden/pool
version: ~> 0.2.3
protodec:
github: omarroth/protodec
version: ~> 0.1.2
crystal: 0.28.0
crystal: 0.31.1
license: AGPLv3

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -41,6 +41,50 @@ struct ChannelVideo
end
end
def to_xml(locale, host_url, query_params, xml : XML::Builder)
query_params["v"] = self.id
xml.element("entry") do
xml.element("id") { xml.text "yt:video:#{self.id}" }
xml.element("yt:videoId") { xml.text self.id }
xml.element("yt:channelId") { xml.text self.ucid }
xml.element("title") { xml.text self.title }
xml.element("link", rel: "alternate", href: "#{host_url}/watch?#{query_params}")
xml.element("author") do
xml.element("name") { xml.text self.author }
xml.element("uri") { xml.text "#{host_url}/channel/#{self.ucid}" }
end
xml.element("content", type: "xhtml") do
xml.element("div", xmlns: "http://www.w3.org/1999/xhtml") do
xml.element("a", href: "#{host_url}/watch?#{query_params}") do
xml.element("img", src: "#{host_url}/vi/#{self.id}/mqdefault.jpg")
end
end
end
xml.element("published") { xml.text self.published.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("updated") { xml.text self.updated.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("media:group") do
xml.element("media:title") { xml.text self.title }
xml.element("media:thumbnail", url: "#{host_url}/vi/#{self.id}/mqdefault.jpg",
width: "320", height: "180")
end
end
end
def to_xml(locale, config, kemal_config, xml : XML::Builder | Nil = nil)
if xml
to_xml(locale, config, kemal_config, xml)
else
XML.build do |xml|
to_xml(locale, config, kemal_config, xml)
end
end
end
db_mapping({
id: String,
title: String,
@@ -55,6 +99,43 @@ struct ChannelVideo
})
end
struct AboutRelatedChannel
db_mapping({
ucid: String,
author: String,
author_url: String,
author_thumbnail: String,
})
end
# TODO: Refactor into either SearchChannel or InvidiousChannel
struct AboutChannel
db_mapping({
ucid: String,
author: String,
auto_generated: Bool,
author_url: String,
author_thumbnail: String,
banner: String?,
description_html: String,
paid: Bool,
total_views: Int64,
sub_count: Int32,
joined: Time,
is_family_friendly: Bool,
allowed_regions: Array(String),
related_channels: Array(AboutRelatedChannel),
tabs: Array(String),
})
end
class ChannelRedirect < Exception
property channel_id : String
def initialize(@channel_id)
end
end
def get_batch_channels(channels, db, refresh = false, pull_all_videos = true, max_threads = 10)
finished_channel = Channel(String | Nil).new
@@ -93,32 +174,28 @@ def get_batch_channels(channels, db, refresh = false, pull_all_videos = true, ma
end
def get_channel(id, db, refresh = true, pull_all_videos = true)
if db.query_one?("SELECT EXISTS (SELECT true FROM channels WHERE id = $1)", id, as: Bool)
channel = db.query_one("SELECT * FROM channels WHERE id = $1", id, as: InvidiousChannel)
if refresh && Time.now - channel.updated > 10.minutes
if channel = db.query_one?("SELECT * FROM channels WHERE id = $1", id, as: InvidiousChannel)
if refresh && Time.utc - channel.updated > 10.minutes
channel = fetch_channel(id, db, pull_all_videos: pull_all_videos)
channel_array = channel.to_a
args = arg_array(channel_array)
db.exec("INSERT INTO channels VALUES (#{args}) \
ON CONFLICT (id) DO UPDATE SET author = $2, updated = $3", channel_array)
ON CONFLICT (id) DO UPDATE SET author = $2, updated = $3", args: channel_array)
end
else
channel = fetch_channel(id, db, pull_all_videos: pull_all_videos)
channel_array = channel.to_a
args = arg_array(channel_array)
db.exec("INSERT INTO channels VALUES (#{args})", channel_array)
db.exec("INSERT INTO channels VALUES (#{args})", args: channel_array)
end
return channel
end
def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
client = make_client(YT_URL)
rss = client.get("/feeds/videos.xml?channel_id=#{ucid}").body
rss = YT_POOL.client &.get("/feeds/videos.xml?channel_id=#{ucid}").body
rss = XML.parse_html(rss)
author = rss.xpath_node(%q(//feed/title))
@@ -137,7 +214,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
page = 1
url = produce_channel_videos_url(ucid, page, auto_generated: auto_generated)
response = client.get(url)
response = YT_POOL.client &.get(url)
json = JSON.parse(response.body)
if json["content_html"]? && !json["content_html"].as_s.empty?
@@ -177,7 +254,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
id: video_id,
title: title,
published: published,
updated: Time.now,
updated: Time.utc,
ucid: ucid,
author: author,
length_seconds: length_seconds,
@@ -198,13 +275,13 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
db.exec("INSERT INTO channel_videos VALUES (#{args}) \
ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
updated = $4, ucid = $5, author = $6, length_seconds = $7, \
live_now = $8, views = $10", video_array)
live_now = $8, views = $10", args: video_array)
# Update all users affected by insert
if emails.empty?
values = "'{}'"
else
values = "VALUES #{emails.map { |id| %(('#{id}')) }.join(",")}"
values = "VALUES #{emails.map { |email| %((E'#{email.gsub({'\'' => "\\'", '\\' => "\\\\"})}')) }.join(",")}"
end
db.exec("UPDATE users SET feed_needs_update = true WHERE email = ANY(#{values})")
@@ -217,7 +294,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
loop do
url = produce_channel_videos_url(ucid, page, auto_generated: auto_generated)
response = client.get(url)
response = YT_POOL.client &.get(url)
json = JSON.parse(response.body)
if json["content_html"]? && !json["content_html"].as_s.empty?
@@ -240,7 +317,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
id: video.id,
title: video.title,
published: video.published,
updated: Time.now,
updated: Time.utc,
ucid: video.ucid,
author: video.author,
length_seconds: video.length_seconds,
@@ -254,7 +331,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
# We are notified of Red videos elsewhere (PubSub), which includes a correct published date,
# so since they don't provide a published date here we can safely ignore them.
if Time.now - video.published > 1.minute
if Time.utc - video.published > 1.minute
emails = db.query_all("UPDATE users SET notifications = notifications || $1 \
WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications) RETURNING email",
video.id, video.published, video.ucid, as: String)
@@ -266,13 +343,13 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
db.exec("INSERT INTO channel_videos VALUES (#{args}) \
ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
updated = $4, ucid = $5, author = $6, length_seconds = $7, \
live_now = $8, views = $10", video_array)
live_now = $8, views = $10", args: video_array)
# Update all users affected by insert
if emails.empty?
values = "'{}'"
else
values = "VALUES #{emails.map { |id| %(('#{id}')) }.join(",")}"
values = "VALUES #{emails.map { |email| %((E'#{email.gsub({'\'' => "\\'", '\\' => "\\\\"})}')) }.join(",")}"
end
db.exec("UPDATE users SET feed_needs_update = true WHERE email = ANY(#{values})")
@@ -290,60 +367,40 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
db.exec("DELETE FROM channel_videos * WHERE NOT id = ANY ('{#{ids.map { |id| %("#{id}") }.join(",")}}') AND ucid = $1", ucid)
end
channel = InvidiousChannel.new(ucid, author, Time.now, false, nil)
channel = InvidiousChannel.new(ucid, author, Time.utc, false, nil)
return channel
end
def subscribe_pubsub(ucid, key, config)
client = make_client(PUBSUB_URL)
time = Time.now.to_unix.to_s
nonce = Random::Secure.hex(4)
signature = "#{time}:#{nonce}"
host_url = make_host_url(config, Kemal.config)
body = {
"hub.callback" => "#{host_url}/feed/webhook/v1:#{time}:#{nonce}:#{OpenSSL::HMAC.hexdigest(:sha1, key, signature)}",
"hub.topic" => "https://www.youtube.com/xml/feeds/videos.xml?channel_id=#{ucid}",
"hub.verify" => "async",
"hub.mode" => "subscribe",
"hub.lease_seconds" => "432000",
"hub.secret" => key.to_s,
}
return client.post("/subscribe", form: body)
end
def fetch_channel_playlists(ucid, author, auto_generated, continuation, sort_by)
client = make_client(YT_URL)
if continuation
url = produce_channel_playlists_url(ucid, continuation, sort_by, auto_generated)
response = client.get(url)
response = YT_POOL.client &.get(url)
json = JSON.parse(response.body)
if json["load_more_widget_html"].as_s.empty?
return [] of SearchItem, nil
end
continuation = nil
else
continuation = XML.parse_html(json["load_more_widget_html"].as_s)
continuation = continuation.xpath_node(%q(//button[@data-uix-load-more-href]))
continuation = XML.parse_html(json["load_more_widget_html"].as_s)
continuation = continuation.xpath_node(%q(//button[@data-uix-load-more-href]))
if continuation
continuation = extract_channel_playlists_cursor(continuation["data-uix-load-more-href"], auto_generated)
if continuation
continuation = extract_channel_playlists_cursor(continuation["data-uix-load-more-href"], auto_generated)
end
end
html = XML.parse_html(json["content_html"].as_s)
nodeset = html.xpath_nodes(%q(//li[contains(@class, "feed-item-container")]))
else
url = "/channel/#{ucid}/playlists?disable_polymer=1&flow=list"
elsif auto_generated
url = "/channel/#{ucid}"
if auto_generated
url += "&view=50"
else
url += "&view=1"
end
response = YT_POOL.client &.get(url)
html = XML.parse_html(response.body)
nodeset = html.xpath_nodes(%q(//ul[@id="browse-items-primary"]/li[contains(@class, "feed-item-container")]))
else
url = "/channel/#{ucid}/playlists?disable_polymer=1&flow=list&view=1"
case sort_by
when "last", "last_added"
@@ -354,7 +411,7 @@ def fetch_channel_playlists(ucid, author, auto_generated, continuation, sort_by)
url += "&sort=dd"
end
response = client.get(url)
response = YT_POOL.client &.get(url)
html = XML.parse_html(response.body)
continuation = html.xpath_node(%q(//button[@data-uix-load-more-href]))
@@ -375,230 +432,482 @@ def fetch_channel_playlists(ucid, author, auto_generated, continuation, sort_by)
end
def produce_channel_videos_url(ucid, page = 1, auto_generated = nil, sort_by = "newest")
object = {
"80226972:embedded" => {
"2:string" => ucid,
"3:base64" => {
"2:string" => "videos",
"6:varint": 2_i64,
"7:varint": 1_i64,
"12:varint": 1_i64,
"13:string": "",
"23:varint": 0_i64,
},
},
}
if auto_generated
seed = Time.unix(1525757349)
until seed >= Time.now
until seed >= Time.utc
seed += 1.month
end
timestamp = seed - (page - 1).months
page = "#{timestamp.to_unix}"
switch = 0x36
object["80226972:embedded"]["3:base64"].as(Hash)["4:varint"] = 0x36_i64
object["80226972:embedded"]["3:base64"].as(Hash)["15:string"] = "#{timestamp.to_unix}"
else
page = "#{page}"
switch = 0x00
object["80226972:embedded"]["3:base64"].as(Hash)["4:varint"] = 0_i64
object["80226972:embedded"]["3:base64"].as(Hash)["15:string"] = "#{page}"
end
meta = IO::Memory.new
meta.write(Bytes[0x12, 0x06])
meta.print("videos")
meta.write(Bytes[0x30, 0x02])
meta.write(Bytes[0x38, 0x01])
meta.write(Bytes[0x60, 0x01])
meta.write(Bytes[0x6a, 0x00])
meta.write(Bytes[0xb8, 0x01, 0x00])
meta.write(Bytes[0x20, switch])
meta.write(Bytes[0x7a, page.size])
meta.print(page)
case sort_by
when "newest"
# Empty tags can be omitted
# meta.write(Bytes[0x18,0x00])
when "popular"
meta.write(Bytes[0x18, 0x01])
object["80226972:embedded"]["3:base64"].as(Hash)["3:varint"] = 0x01_i64
when "oldest"
meta.write(Bytes[0x18, 0x02])
object["80226972:embedded"]["3:base64"].as(Hash)["3:varint"] = 0x02_i64
end
meta.rewind
meta = Base64.urlsafe_encode(meta.to_slice)
meta = URI.escape(meta)
object["80226972:embedded"]["3:string"] = Base64.urlsafe_encode(Protodec::Any.from_json(Protodec::Any.cast_json(object["80226972:embedded"]["3:base64"])))
object["80226972:embedded"].delete("3:base64")
continuation = IO::Memory.new
continuation.write(Bytes[0x12, ucid.size])
continuation.print(ucid)
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
continuation.write(Bytes[0x1a, meta.size])
continuation.print(meta)
continuation.rewind
continuation = continuation.gets_to_end
wrapper = IO::Memory.new
wrapper.write(Bytes[0xe2, 0xa9, 0x85, 0xb2, 0x02, continuation.size])
wrapper.print(continuation)
wrapper.rewind
wrapper = Base64.urlsafe_encode(wrapper.to_slice)
wrapper = URI.escape(wrapper)
url = "/browse_ajax?continuation=#{wrapper}&gl=US&hl=en"
return url
return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
end
def produce_channel_playlists_url(ucid, cursor, sort = "newest", auto_generated = false)
object = {
"80226972:embedded" => {
"2:string" => ucid,
"3:base64" => {
"2:string" => "playlist",
"6:varint": 2_i64,
"7:varint": 1_i64,
"12:varint": 1_i64,
"13:string": "",
"23:varint": 0_i64,
},
},
}
if !auto_generated
cursor = Base64.urlsafe_encode(cursor, false)
end
meta = IO::Memory.new
object["80226972:embedded"]["3:base64"].as(Hash)["15:string"] = cursor
if auto_generated
meta.write(Bytes[0x08, 0x0a])
end
meta.write(Bytes[0x12, 0x09])
meta.print("playlists")
if auto_generated
meta.write(Bytes[0x20, 0x32])
object["80226972:embedded"]["3:base64"].as(Hash)["4:varint"] = 0x32_i64
else
# TODO: Look at 0x01, 0x00
object["80226972:embedded"]["3:base64"].as(Hash)["4:varint"] = 1_i64
case sort
when "oldest", "oldest_created"
meta.write(Bytes[0x18, 0x02])
object["80226972:embedded"]["3:base64"].as(Hash)["3:varint"] = 2_i64
when "newest", "newest_created"
meta.write(Bytes[0x18, 0x03])
object["80226972:embedded"]["3:base64"].as(Hash)["3:varint"] = 3_i64
when "last", "last_added"
meta.write(Bytes[0x18, 0x04])
object["80226972:embedded"]["3:base64"].as(Hash)["3:varint"] = 4_i64
end
meta.write(Bytes[0x20, 0x01])
end
meta.write(Bytes[0x30, 0x02])
meta.write(Bytes[0x38, 0x01])
meta.write(Bytes[0x60, 0x01])
meta.write(Bytes[0x6a, 0x00])
object["80226972:embedded"]["3:string"] = Base64.urlsafe_encode(Protodec::Any.from_json(Protodec::Any.cast_json(object["80226972:embedded"]["3:base64"])))
object["80226972:embedded"].delete("3:base64")
meta.write(Bytes[0x7a, cursor.size])
meta.print(cursor)
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
meta.write(Bytes[0xb8, 0x01, 0x00])
meta.rewind
meta = Base64.urlsafe_encode(meta.to_slice)
meta = URI.escape(meta)
continuation = IO::Memory.new
continuation.write(Bytes[0x12, ucid.size])
continuation.print(ucid)
continuation.write(Bytes[0x1a])
continuation.write(write_var_int(meta.size))
continuation.print(meta)
continuation.rewind
continuation = continuation.gets_to_end
wrapper = IO::Memory.new
wrapper.write(Bytes[0xe2, 0xa9, 0x85, 0xb2, 0x02])
wrapper.write(write_var_int(continuation.size))
wrapper.print(continuation)
wrapper.rewind
wrapper = Base64.urlsafe_encode(wrapper.to_slice)
wrapper = URI.escape(wrapper)
url = "/browse_ajax?continuation=#{wrapper}&gl=US&hl=en"
return url
return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
end
def extract_channel_playlists_cursor(url, auto_generated)
wrapper = HTTP::Params.parse(URI.parse(url).query.not_nil!)["continuation"]
wrapper = URI.unescape(wrapper)
wrapper = Base64.decode(wrapper)
# 0xe2 0xa9 0x85 0xb2 0x02
wrapper += 5
continuation_size = read_var_int(wrapper[0, 4])
wrapper += write_var_int(continuation_size).size
continuation = wrapper[0, continuation_size]
# 0x12
continuation += 1
ucid_size = continuation[0]
continuation += 1
ucid = continuation[0, ucid_size]
continuation += ucid_size
# 0x1a
continuation += 1
meta_size = read_var_int(continuation[0, 4])
continuation += write_var_int(meta_size).size
meta = continuation[0, meta_size]
continuation += meta_size
meta = String.new(meta)
meta = URI.unescape(meta)
meta = Base64.decode(meta)
# 0x12 0x09 playlists
meta += 11
until meta[0] == 0x7a
tag = read_var_int(meta[0, 4])
meta += write_var_int(tag).size
value = meta[0]
meta += 1
end
# 0x7a
meta += 1
cursor_size = meta[0]
meta += 1
cursor = meta[0, cursor_size]
cursor = String.new(cursor)
cursor = URI.parse(url).query_params
.try { |i| URI.decode_www_form(i["continuation"]) }
.try { |i| Base64.decode(i) }
.try { |i| IO::Memory.new(i) }
.try { |i| Protodec::Any.parse(i) }
.try { |i| i["80226972:0:embedded"]["3:1:base64"].as_h.find { |k, v| k.starts_with?("15:") } }
.try &.[1].as_s || ""
if !auto_generated
cursor = URI.unescape(cursor)
cursor = Base64.decode_string(cursor)
cursor = URI.decode_www_form(cursor)
.try { |i| Base64.decode_string(i) }
end
return cursor
end
def get_about_info(ucid, locale)
client = make_client(YT_URL)
# TODO: Add "sort_by"
def fetch_channel_community(ucid, continuation, locale, config, kemal_config, format, thin_mode)
response = YT_POOL.client &.get("/channel/#{ucid}/community?gl=US&hl=en")
if response.status_code == 404
response = YT_POOL.client &.get("/user/#{ucid}/community?gl=US&hl=en")
end
about = client.get("/channel/#{ucid}/about?disable_polymer=1&gl=US&hl=en")
if response.status_code == 404
error_message = translate(locale, "This channel does not exist.")
raise error_message
end
ucid = response.body.match(/https:\/\/www.youtube.com\/channel\/(?<ucid>UC[a-zA-Z0-9_-]{22})/).not_nil!["ucid"]
if !continuation || continuation.empty?
initial_data = extract_initial_data(response.body)
body = initial_data["contents"]?.try &.["twoColumnBrowseResultsRenderer"]["tabs"].as_a.select { |tab| tab["tabRenderer"]?.try &.["selected"].as_bool.== true }[0]?
if !body
raise "Could not extract community tab."
end
body = body["tabRenderer"]["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"]
else
continuation = produce_channel_community_continuation(ucid, continuation)
headers = HTTP::Headers.new
headers["cookie"] = response.cookies.add_request_headers(headers)["cookie"]
headers["content-type"] = "application/x-www-form-urlencoded"
headers["x-client-data"] = "CIi2yQEIpbbJAQipncoBCNedygEIqKPKAQ=="
headers["x-spf-previous"] = ""
headers["x-spf-referer"] = ""
headers["x-youtube-client-name"] = "1"
headers["x-youtube-client-version"] = "2.20180719"
session_token = response.body.match(/"XSRF_TOKEN":"(?<session_token>[A-Za-z0-9\_\-\=]+)"/).try &.["session_token"]? || ""
post_req = {
session_token: session_token,
}
response = YT_POOL.client &.post("/comment_service_ajax?action_get_comments=1&ctoken=#{continuation}&continuation=#{continuation}&hl=en&gl=US", headers, form: post_req)
body = JSON.parse(response.body)
body = body["response"]["continuationContents"]["itemSectionContinuation"]? ||
body["response"]["continuationContents"]["backstageCommentsContinuation"]?
if !body
raise "Could not extract continuation."
end
end
continuation = body["continuations"]?.try &.[0]["nextContinuationData"]["continuation"].as_s
posts = body["contents"].as_a
if message = posts[0]["messageRenderer"]?
error_message = (message["text"]["simpleText"]? ||
message["text"]["runs"]?.try &.[0]?.try &.["text"]?)
.try &.as_s || ""
raise error_message
end
response = JSON.build do |json|
json.object do
json.field "authorId", ucid
json.field "comments" do
json.array do
posts.each do |post|
comments = post["backstagePostThreadRenderer"]?.try &.["comments"]? ||
post["backstageCommentsContinuation"]?
post = post["backstagePostThreadRenderer"]?.try &.["post"]["backstagePostRenderer"]? ||
post["commentThreadRenderer"]?.try &.["comment"]["commentRenderer"]?
if !post
next
end
if !post["contentText"]?
content_html = ""
else
content_html = post["contentText"]["simpleText"]?.try &.as_s.rchop('\ufeff').try { |block| HTML.escape(block) }.to_s ||
content_to_comment_html(post["contentText"]["runs"].as_a).try &.to_s || ""
end
author = post["authorText"]?.try &.["simpleText"]? || ""
json.object do
json.field "author", author
json.field "authorThumbnails" do
json.array do
qualities = {32, 48, 76, 100, 176, 512}
author_thumbnail = post["authorThumbnail"]["thumbnails"].as_a[0]["url"].as_s
qualities.each do |quality|
json.object do
json.field "url", author_thumbnail.gsub(/s\d+-/, "s#{quality}-")
json.field "width", quality
json.field "height", quality
end
end
end
end
if post["authorEndpoint"]?
json.field "authorId", post["authorEndpoint"]["browseEndpoint"]["browseId"]
json.field "authorUrl", post["authorEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"].as_s
else
json.field "authorId", ""
json.field "authorUrl", ""
end
published_text = post["publishedTimeText"]["runs"][0]["text"].as_s
published = decode_date(published_text.rchop(" (edited)"))
if published_text.includes?(" (edited)")
json.field "isEdited", true
else
json.field "isEdited", false
end
like_count = post["actionButtons"]["commentActionButtonsRenderer"]["likeButton"]["toggleButtonRenderer"]["accessibilityData"]["accessibilityData"]["label"]
.try &.as_s.gsub(/\D/, "").to_i? || 0
json.field "content", html_to_content(content_html)
json.field "contentHtml", content_html
json.field "published", published.to_unix
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))
json.field "likeCount", like_count
json.field "commentId", post["postId"]? || post["commentId"]? || ""
json.field "authorIsChannelOwner", post["authorEndpoint"]["browseEndpoint"]["browseId"] == ucid
if attachment = post["backstageAttachment"]?
json.field "attachment" do
json.object do
case attachment.as_h
when .has_key?("videoRenderer")
attachment = attachment["videoRenderer"]
json.field "type", "video"
if !attachment["videoId"]?
error_message = (attachment["title"]["simpleText"]? ||
attachment["title"]["runs"]?.try &.[0]?.try &.["text"]?)
json.field "error", error_message
else
video_id = attachment["videoId"].as_s
json.field "title", attachment["title"]["simpleText"].as_s
json.field "videoId", video_id
json.field "videoThumbnails" do
generate_thumbnails(json, video_id, config, kemal_config)
end
json.field "lengthSeconds", decode_length_seconds(attachment["lengthText"]["simpleText"].as_s)
author_info = attachment["ownerText"]["runs"][0].as_h
json.field "author", author_info["text"].as_s
json.field "authorId", author_info["navigationEndpoint"]["browseEndpoint"]["browseId"]
json.field "authorUrl", author_info["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"]
# TODO: json.field "authorThumbnails", "channelThumbnailSupportedRenderers"
# TODO: json.field "authorVerified", "ownerBadges"
published = decode_date(attachment["publishedTimeText"]["simpleText"].as_s)
json.field "published", published.to_unix
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))
view_count = attachment["viewCountText"]["simpleText"].as_s.gsub(/\D/, "").to_i64? || 0_i64
json.field "viewCount", view_count
json.field "viewCountText", translate(locale, "`x` views", number_to_short_text(view_count))
end
when .has_key?("backstageImageRenderer")
attachment = attachment["backstageImageRenderer"]
json.field "type", "image"
json.field "imageThumbnails" do
json.array do
thumbnail = attachment["image"]["thumbnails"][0].as_h
width = thumbnail["width"].as_i
height = thumbnail["height"].as_i
aspect_ratio = (width.to_f / height.to_f)
url = thumbnail["url"].as_s.gsub(/=w\d+-h\d+(-p)?(-nd)?(-df)?(-rwa)?/, "=s640")
qualities = {320, 560, 640, 1280, 2000}
qualities.each do |quality|
json.object do
json.field "url", url.gsub(/=s\d+/, "=s#{quality}")
json.field "width", quality
json.field "height", (quality / aspect_ratio).ceil.to_i
end
end
end
end
# TODO
# when .has_key?("pollRenderer")
# attachment = attachment["pollRenderer"]
# json.field "type", "poll"
else
json.field "type", "unknown"
json.field "error", "Unrecognized attachment type."
end
end
end
end
if comments && (reply_count = (comments["backstageCommentsRenderer"]["moreText"]["simpleText"]? ||
comments["backstageCommentsRenderer"]["moreText"]["runs"]?.try &.[0]?.try &.["text"]?)
.try &.as_s.gsub(/\D/, "").to_i?)
continuation = comments["backstageCommentsRenderer"]["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_s
continuation ||= ""
json.field "replies" do
json.object do
json.field "replyCount", reply_count
json.field "continuation", extract_channel_community_cursor(continuation)
end
end
end
end
end
end
end
if body["continuations"]?
continuation = body["continuations"][0]["nextContinuationData"]["continuation"].as_s
json.field "continuation", extract_channel_community_cursor(continuation)
end
end
end
if format == "html"
response = JSON.parse(response)
content_html = template_youtube_comments(response, locale, thin_mode)
response = JSON.build do |json|
json.object do
json.field "contentHtml", content_html
end
end
end
return response
end
def produce_channel_community_continuation(ucid, cursor)
object = {
"80226972:embedded" => {
"2:string" => ucid,
"3:string" => cursor,
},
}
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
return continuation
end
def extract_channel_community_cursor(continuation)
object = URI.decode_www_form(continuation)
.try { |i| Base64.decode(i) }
.try { |i| IO::Memory.new(i) }
.try { |i| Protodec::Any.parse(i) }
.try { |i| i["80226972:0:embedded"]["3:1:base64"].as_h }
if object["53:2:embedded"]?.try &.["3:0:embedded"]?
object["53:2:embedded"]["3:0:embedded"]["2:0:string"] = object["53:2:embedded"]["3:0:embedded"]
.try { |i| i["2:0:base64"].as_h }
.try { |i| Protodec::Any.cast_json(i) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i, padding: false) }
object["53:2:embedded"]["3:0:embedded"].as_h.delete("2:0:base64")
end
cursor = Protodec::Any.cast_json(object)
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
cursor
end
def get_about_info(ucid, locale)
about = YT_POOL.client &.get("/channel/#{ucid}/about?disable_polymer=1&gl=US&hl=en")
if about.status_code == 404
about = client.get("/user/#{ucid}/about?disable_polymer=1&gl=US&hl=en")
about = YT_POOL.client &.get("/user/#{ucid}/about?disable_polymer=1&gl=US&hl=en")
end
if md = about.headers["location"]?.try &.match(/\/channel\/(?<ucid>UC[a-zA-Z0-9_-]{22})/)
raise ChannelRedirect.new(channel_id: md["ucid"])
end
about = XML.parse_html(about.body)
if about.xpath_node(%q(//div[contains(@class, "channel-empty-message")]))
error_message = translate(locale, "This channel does not exist.")
raise error_message
end
if about.xpath_node(%q(//span[contains(@class,"qualified-channel-title-text")]/a)).try &.content.empty?
error_message = about.xpath_node(%q(//div[@class="yt-alert-content"])).try &.content.strip
error_message ||= translate(locale, "Could not get channel info.")
raise error_message
end
sub_count = about.xpath_node(%q(//span[contains(text(), "subscribers")]))
if sub_count
sub_count = sub_count.content.delete(", subscribers").to_i?
end
sub_count ||= 0
author = about.xpath_node(%q(//span[contains(@class,"qualified-channel-title-text")]/a)).not_nil!.content
author_url = about.xpath_node(%q(//span[contains(@class,"qualified-channel-title-text")]/a)).not_nil!["href"]
author_thumbnail = about.xpath_node(%q(//img[@class="channel-header-profile-image"])).not_nil!["src"]
ucid = about.xpath_node(%q(//meta[@itemprop="channelId"])).not_nil!["content"]
banner = about.xpath_node(%q(//div[@id="gh-banner"]/style)).not_nil!.content
banner = "https:" + banner.match(/background-image: url\((?<url>[^)]+)\)/).not_nil!["url"]
if banner.includes? "channels/c4/default_banner"
banner = nil
end
description_html = about.xpath_node(%q(//div[contains(@class,"about-description")])).try &.to_s ||
%(<div class="about-description branded-page-box-padding"><pre></pre></div>)
paid = about.xpath_node(%q(//meta[@itemprop="paid"])).not_nil!["content"] == "True"
is_family_friendly = about.xpath_node(%q(//meta[@itemprop="isFamilyFriendly"])).not_nil!["content"] == "True"
allowed_regions = about.xpath_node(%q(//meta[@itemprop="regionsAllowed"])).not_nil!["content"].split(",")
related_channels = about.xpath_nodes(%q(//div[contains(@class, "branded-page-related-channels")]/ul/li))
related_channels = related_channels.map do |node|
related_id = node["data-external-id"]?
related_id ||= ""
anchor = node.xpath_node(%q(.//h3[contains(@class, "yt-lockup-title")]/a))
related_title = anchor.try &.["title"]
related_title ||= ""
related_author_url = anchor.try &.["href"]
related_author_url ||= ""
related_author_thumbnail = node.xpath_node(%q(.//img)).try &.["data-thumb"]
related_author_thumbnail ||= ""
AboutRelatedChannel.new(
ucid: related_id,
author: related_title,
author_url: related_author_url,
author_thumbnail: related_author_thumbnail,
)
end
joined = about.xpath_node(%q(//span[contains(., "Joined")]))
.try &.content.try { |text| Time.parse(text, "Joined %b %-d, %Y", Time::Location.local) } || Time.unix(0)
total_views = about.xpath_node(%q(//span[contains(., "views")]/b))
.try &.content.try &.gsub(/\D/, "").to_i64? || 0_i64
sub_count = about.xpath_node(%q(.//span[contains(@class, "subscriber-count")]))
.try &.["title"].try { |text| short_text_to_number(text) } || 0
# Auto-generated channels
# https://support.google.com/youtube/answer/2579942
auto_generated = false
@@ -607,18 +916,34 @@ def get_about_info(ucid, locale)
auto_generated = true
end
return {author, ucid, auto_generated, sub_count}
tabs = about.xpath_nodes(%q(//ul[@id="channel-navigation-menu"]/li/a/span)).map { |node| node.content.downcase }
AboutChannel.new(
ucid: ucid,
author: author,
auto_generated: auto_generated,
author_url: author_url,
author_thumbnail: author_thumbnail,
banner: banner,
description_html: description_html,
paid: paid,
total_views: total_views,
sub_count: sub_count,
joined: joined,
is_family_friendly: is_family_friendly,
allowed_regions: allowed_regions,
related_channels: related_channels,
tabs: tabs
)
end
def get_60_videos(ucid, page, auto_generated, sort_by = "newest")
def get_60_videos(ucid, author, page, auto_generated, sort_by = "newest")
count = 0
videos = [] of SearchVideo
client = make_client(YT_URL)
2.times do |i|
url = produce_channel_videos_url(ucid, page * 2 + (i - 1), auto_generated: auto_generated, sort_by: sort_by)
response = client.get(url)
response = YT_POOL.client &.get(url)
json = JSON.parse(response.body)
if json["content_html"]? && !json["content_html"].as_s.empty?
@@ -632,7 +957,7 @@ def get_60_videos(ucid, page, auto_generated, sort_by = "newest")
if auto_generated
videos += extract_videos(nodeset)
else
videos += extract_videos(nodeset, ucid)
videos += extract_videos(nodeset, ucid, author)
end
else
break
@@ -643,11 +968,10 @@ def get_60_videos(ucid, page, auto_generated, sort_by = "newest")
end
def get_latest_videos(ucid)
client = make_client(YT_URL)
videos = [] of SearchVideo
url = produce_channel_videos_url(ucid, 0)
response = client.get(url)
response = YT_POOL.client &.get(url)
json = JSON.parse(response.body)
if json["content_html"]? && !json["content_html"].as_s.empty?

View File

@@ -22,6 +22,7 @@ class RedditComment
replies: RedditThing | String,
score: Int32,
depth: Int32,
permalink: String,
created_utc: {
type: Time,
converter: RedditComment::TimeConverter,
@@ -56,14 +57,22 @@ class RedditListing
})
end
def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_mode, region, sort_by = "top")
video = get_video(id, db, proxies, region: region)
def fetch_youtube_comments(id, db, cursor, format, locale, thin_mode, region, sort_by = "top")
video = get_video(id, db, region: region)
session_token = video.info["session_token"]?
ctoken = produce_comment_continuation(id, cursor: "", sort_by: sort_by)
continuation ||= ctoken
case cursor
when nil, ""
ctoken = produce_comment_continuation(id, cursor: "", sort_by: sort_by)
# when .starts_with? "Ug"
# ctoken = produce_comment_reply_continuation(id, video.ucid, cursor)
when .starts_with? "ADSJ"
ctoken = produce_comment_continuation(id, cursor: cursor, sort_by: sort_by)
else
ctoken = cursor
end
if !continuation || !session_token
if !session_token
if format == "json"
return {"comments" => [] of String}.to_json
else
@@ -72,11 +81,10 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
end
post_req = {
"session_token" => session_token,
page_token: ctoken,
session_token: session_token,
}
post_req = HTTP::Params.encode(post_req)
client = make_client(YT_URL, proxies, video.info["region"]?)
headers = HTTP::Headers.new
headers["content-type"] = "application/x-www-form-urlencoded"
@@ -89,7 +97,7 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
headers["x-youtube-client-name"] = "1"
headers["x-youtube-client-version"] = "2.20180719"
response = client.post("/comment_service_ajax?action_get_comments=1&ctoken=#{continuation}&continuation=#{continuation}&hl=en&gl=US", headers, post_req)
response = YT_POOL.client(region, &.post("/comment_service_ajax?action_get_comments=1&hl=en&gl=US", headers, form: post_req))
response = JSON.parse(response.body)
if !response["response"]["continuationContents"]?
@@ -112,10 +120,13 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
end
end
comments = JSON.build do |json|
response = JSON.build do |json|
json.object do
if body["header"]?
comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.delete("Comments,").to_i
count_text = body["header"]["commentsHeaderRenderer"]["countText"]
comment_count = (count_text["simpleText"]? || count_text["runs"]?.try &.[0]?.try &.["text"]?)
.try &.as_s.gsub(/\D/, "").to_i? || 0
json.field "commentCount", comment_count
end
@@ -139,16 +150,9 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
node_comment = node["commentRenderer"]
end
content_html = node_comment["contentText"]["simpleText"]?.try &.as_s.rchop('\ufeff')
if content_html
content_html = HTML.escape(content_html)
end
content_html ||= content_to_comment_html(node_comment["contentText"]["runs"].as_a)
content_html, content = html_to_content(content_html)
author = node_comment["authorText"]?.try &.["simpleText"]
author ||= ""
content_html = node_comment["contentText"]["simpleText"]?.try &.as_s.rchop('\ufeff').try { |block| HTML.escape(block) }.to_s ||
content_to_comment_html(node_comment["contentText"]["runs"].as_a).try &.to_s || ""
author = node_comment["authorText"]?.try &.["simpleText"]? || ""
json.field "author", author
json.field "authorThumbnails" do
@@ -180,10 +184,12 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
json.field "isEdited", false
end
json.field "content", content
json.field "content", html_to_content(content_html)
json.field "contentHtml", content_html
json.field "published", published.to_unix
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))
json.field "likeCount", node_comment["likeCount"]
json.field "commentId", node_comment["commentId"]
json.field "authorIsChannelOwner", node_comment["authorIsChannelOwner"]
@@ -199,13 +205,8 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
end
if node_replies && !response["commentRepliesContinuation"]?
reply_count = node_replies["moreText"]["simpleText"].as_s.delete("View all reply replies,")
if reply_count.empty?
reply_count = 1
else
reply_count = reply_count.try &.to_i?
reply_count ||= 1
end
reply_count = (node_replies["moreText"]["simpleText"]? || node_replies["moreText"]["runs"]?.try &.[0]?.try &.["text"]?)
.try &.as_s.gsub(/\D/, "").to_i? || 1
continuation = node_replies["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_s
continuation ||= ""
@@ -223,22 +224,22 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
end
if body["continuations"]?
continuation = body["continuations"][0]["nextContinuationData"]["continuation"]
json.field "continuation", continuation
continuation = body["continuations"][0]["nextContinuationData"]["continuation"].as_s
json.field "continuation", cursor.try &.starts_with?("E") ? continuation : extract_comment_cursor(continuation)
end
end
end
if format == "html"
comments = JSON.parse(comments)
content_html = template_youtube_comments(comments, locale, thin_mode)
response = JSON.parse(response)
content_html = template_youtube_comments(response, locale, thin_mode)
comments = JSON.build do |json|
response = JSON.build do |json|
json.object do
json.field "contentHtml", content_html
if comments["commentCount"]?
json.field "commentCount", comments["commentCount"]
if response["commentCount"]?
json.field "commentCount", response["commentCount"]
else
json.field "commentCount", 0
end
@@ -246,14 +247,15 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
end
end
return comments
return response
end
def fetch_reddit_comments(id, sort_by = "confidence")
client = make_client(REDDIT_URL)
headers = HTTP::Headers{"User-Agent" => "web:invidious:v#{CURRENT_VERSION} (by /u/omarroth)"}
query = "(url:3D#{id}%20OR%20url:#{id})%20(site:youtube.com%20OR%20site:youtu.be)"
# TODO: Use something like #479 for a static list of instances to use here
query = "(url:3D#{id}%20OR%20url:#{id})%20(site:invidio.us%20OR%20site:youtube.com%20OR%20site:youtu.be)"
search_results = client.get("/search.json?q=#{query}", headers)
if search_results.status_code == 200
@@ -282,56 +284,110 @@ def fetch_reddit_comments(id, sort_by = "confidence")
end
def template_youtube_comments(comments, locale, thin_mode)
html = ""
root = comments["comments"].as_a
root.each do |child|
if child["replies"]?
replies_html = <<-END_HTML
<div id="replies" class="pure-g">
<div class="pure-u-1-24"></div>
<div class="pure-u-23-24">
<p>
<a href="javascript:void(0)" data-continuation="#{child["replies"]["continuation"]}"
onclick="get_youtube_replies(this)">#{translate(locale, "View `x` replies", child["replies"]["replyCount"].to_s)}</a>
</p>
String.build do |html|
root = comments["comments"].as_a
root.each do |child|
if child["replies"]?
replies_html = <<-END_HTML
<div id="replies" class="pure-g">
<div class="pure-u-1-24"></div>
<div class="pure-u-23-24">
<p>
<a href="javascript:void(0)" data-continuation="#{child["replies"]["continuation"]}"
onclick="get_youtube_replies(this)">#{translate(locale, "View `x` replies", number_with_separator(child["replies"]["replyCount"]))}</a>
</p>
</div>
</div>
</div>
END_HTML
end
if !thin_mode
author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnails"][-1]["url"].as_s).full_path}"
else
author_thumbnail = ""
end
html += <<-END_HTML
<div class="pure-g">
<div class="pure-u-4-24 pure-u-md-2-24">
<img style="width:90%;padding-right:1em;padding-top:1em" src="#{author_thumbnail}">
</div>
<div class="pure-u-20-24 pure-u-md-22-24">
<p>
<b>
<a class="#{child["authorIsChannelOwner"] == true ? "channel-owner" : ""}" href="#{child["authorUrl"]}">#{child["author"]}</a>
</b>
<p style="white-space:pre-wrap">#{child["contentHtml"]}</p>
<span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale, "%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span>
|
<a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "YouTube comment permalink")}">[YT]</a>
|
<i class="icon ion-ios-thumbs-up"></i> #{number_with_separator(child["likeCount"])}
END_HTML
if child["creatorHeart"]?
if !thin_mode
creator_thumbnail = "/ggpht#{URI.parse(child["creatorHeart"]["creatorThumbnail"].as_s).full_path}"
else
creator_thumbnail = ""
END_HTML
end
html += <<-END_HTML
if !thin_mode
author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnails"][-1]["url"].as_s).full_path}"
else
author_thumbnail = ""
end
html << <<-END_HTML
<div class="pure-g" style="width:100%">
<div class="channel-profile pure-u-4-24 pure-u-md-2-24">
<img style="padding-right:1em;padding-top:1em;width:90%" src="#{author_thumbnail}">
</div>
<div class="pure-u-20-24 pure-u-md-22-24">
<p>
<b>
<a class="#{child["authorIsChannelOwner"] == true ? "channel-owner" : ""}" href="#{child["authorUrl"]}">#{child["author"]}</a>
</b>
<p style="white-space:pre-wrap">#{child["contentHtml"]}</p>
END_HTML
if child["attachment"]?
attachment = child["attachment"]
case attachment["type"]
when "image"
attachment = attachment["imageThumbnails"][1]
html << <<-END_HTML
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2">
<img style="width:100%" src="/ggpht#{URI.parse(attachment["url"].as_s).full_path}">
</div>
</div>
END_HTML
when "video"
html << <<-END_HTML
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2">
<div style="position:relative;width:100%;height:0;padding-bottom:56.25%;margin-bottom:5px">
END_HTML
if attachment["error"]?
html << <<-END_HTML
<p>#{attachment["error"]}</p>
END_HTML
else
html << <<-END_HTML
<iframe id='ivplayer' type='text/html' style='position:absolute;width:100%;height:100%;left:0;top:0' src='/embed/#{attachment["videoId"]?}?autoplay=0' frameborder='0'></iframe>
END_HTML
end
html << <<-END_HTML
</div>
</div>
</div>
END_HTML
end
end
html << <<-END_HTML
<span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale, "%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span>
|
END_HTML
if comments["videoId"]?
html << <<-END_HTML
<a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "YouTube comment permalink")}">[YT]</a>
|
END_HTML
elsif comments["authorId"]?
html << <<-END_HTML
<a href="https://www.youtube.com/channel/#{comments["authorId"]}/community?lb=#{child["commentId"]}" title="#{translate(locale, "YouTube comment permalink")}">[YT]</a>
|
END_HTML
end
html << <<-END_HTML
<i class="icon ion-ios-thumbs-up"></i> #{number_with_separator(child["likeCount"])}
END_HTML
if child["creatorHeart"]?
if !thin_mode
creator_thumbnail = "/ggpht#{URI.parse(child["creatorHeart"]["creatorThumbnail"].as_s).full_path}"
else
creator_thumbnail = ""
end
html << <<-END_HTML
<span class="creator-heart-container" title="#{translate(locale, "`x` marked it with a ❤", child["creatorHeart"]["creatorName"].as_s)}">
<div class="creator-heart">
<img class="creator-heart-background-hearted" src="#{creator_thumbnail}"></img>
@@ -340,84 +396,77 @@ def template_youtube_comments(comments, locale, thin_mode)
</div>
</div>
</span>
END_HTML
end
html << <<-END_HTML
</p>
#{replies_html}
</div>
</div>
END_HTML
end
html += <<-END_HTML
</p>
#{replies_html}
if comments["continuation"]?
html << <<-END_HTML
<div class="pure-g">
<div class="pure-u-1">
<p>
<a href="javascript:void(0)" data-continuation="#{comments["continuation"]}"
onclick="get_youtube_replies(this, true)">#{translate(locale, "Load more")}</a>
</p>
</div>
</div>
</div>
END_HTML
END_HTML
end
end
if comments["continuation"]?
html += <<-END_HTML
<div class="pure-g">
<div class="pure-u-1">
<p>
<a href="javascript:void(0)" data-continuation="#{comments["continuation"]}"
onclick="get_youtube_replies(this, true)">#{translate(locale, "Load more")}</a>
</p>
</div>
</div>
END_HTML
end
return html
end
def template_reddit_comments(root, locale)
html = ""
root.each do |child|
if child.data.is_a?(RedditComment)
child = child.data.as(RedditComment)
author = child.author
score = child.score
body_html = HTML.unescape(child.body_html)
String.build do |html|
root.each do |child|
if child.data.is_a?(RedditComment)
child = child.data.as(RedditComment)
body_html = HTML.unescape(child.body_html)
replies_html = ""
if child.replies.is_a?(RedditThing)
replies = child.replies.as(RedditThing)
replies_html = template_reddit_comments(replies.data.as(RedditListing).children, locale)
end
replies_html = ""
if child.replies.is_a?(RedditThing)
replies = child.replies.as(RedditThing)
replies_html = template_reddit_comments(replies.data.as(RedditListing).children, locale)
end
content = <<-END_HTML
<p>
<a href="javascript:void(0)" onclick="toggle_parent(this)">[ - ]</a>
<b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b>
#{translate(locale, "`x` points", number_with_separator(score))}
#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}
</p>
<div>
#{body_html}
#{replies_html}
</div>
END_HTML
if child.depth > 0
html += <<-END_HTML
if child.depth > 0
html << <<-END_HTML
<div class="pure-g">
<div class="pure-u-1-24">
</div>
<div class="pure-u-23-24">
#{content}
</div>
</div>
END_HTML
else
html += <<-END_HTML
END_HTML
else
html << <<-END_HTML
<div class="pure-g">
<div class="pure-u-1">
#{content}
</div>
</div>
END_HTML
end
html << <<-END_HTML
<p>
<a href="javascript:void(0)" onclick="toggle_parent(this)">[ - ]</a>
<b><a href="https://www.reddit.com/user/#{child.author}">#{child.author}</a></b>
#{translate(locale, "`x` points", number_with_separator(child.score))}
<span title="#{child.created_utc.to_s(translate(locale, "%a %B %-d %T %Y UTC"))}">#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}</span>
<a href="https://www.reddit.com#{child.permalink}" title="#{translate(locale, "permalink")}">#{translate(locale, "permalink")}</a>
</p>
<div>
#{body_html}
#{replies_html}
</div>
</div>
</div>
END_HTML
end
end
end
return html
end
def replace_links(html)
@@ -517,115 +566,90 @@ def content_to_comment_html(content)
end
text
end.join.rchop('\ufeff')
end.join("").delete('\ufeff')
return comment_html
end
def extract_comment_cursor(continuation)
cursor = URI.decode_www_form(continuation)
.try { |i| Base64.decode(i) }
.try { |i| IO::Memory.new(i) }
.try { |i| Protodec::Any.parse(i) }
.try { |i| i["6:2:embedded"]["1:0:string"].as_s }
return cursor
end
def produce_comment_continuation(video_id, cursor = "", sort_by = "top")
continuation = IO::Memory.new
object = {
"2:embedded" => {
"2:string" => video_id,
"24:varint" => 1_i64,
"25:varint" => 1_i64,
"28:varint" => 1_i64,
"36:embedded" => {
"5:varint" => -1_i64,
"8:varint" => 0_i64,
},
},
"3:varint" => 6_i64,
"6:embedded" => {
"1:string" => cursor,
"4:embedded" => {
"4:string" => video_id,
"6:varint" => 0_i64,
},
"5:varint" => 20_i64,
},
}
continuation.write(Bytes[0x12, 0x26])
continuation.write(Bytes[0x12, video_id.size])
continuation.print(video_id)
continuation.write(Bytes[0xc0, 0x01, 0x01])
continuation.write(Bytes[0xc8, 0x01, 0x01])
continuation.write(Bytes[0xe0, 0x01, 0x01])
continuation.write(Bytes[0xa2, 0x02, 0x0d])
continuation.write(Bytes[0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01])
continuation.write(Bytes[0x40, 0x00])
continuation.write(Bytes[0x18, 0x06])
if cursor.empty?
continuation.write(Bytes[0x32])
continuation.write(write_var_int(video_id.size + 8))
continuation.write(Bytes[0x22, video_id.size + 4])
continuation.write(Bytes[0x22, video_id.size])
continuation.print(video_id)
case sort_by
when "top"
continuation.write(Bytes[0x30, 0x00])
when "new", "newest"
continuation.write(Bytes[0x30, 0x01])
end
continuation.write(Bytes[0x78, 0x02])
else
continuation.write(Bytes[0x32])
continuation.write(write_var_int(cursor.size + video_id.size + 11))
continuation.write(Bytes[0x0a])
continuation.write(write_var_int(cursor.size))
continuation.print(cursor)
continuation.write(Bytes[0x22, video_id.size + 4])
continuation.write(Bytes[0x22, video_id.size])
continuation.print(video_id)
case sort_by
when "top"
continuation.write(Bytes[0x30, 0x00])
when "new", "newest"
continuation.write(Bytes[0x30, 0x01])
end
continuation.write(Bytes[0x28, 0x14])
case sort_by
when "top"
object["6:embedded"].as(Hash)["4:embedded"].as(Hash)["6:varint"] = 0_i64
when "new", "newest"
object["6:embedded"].as(Hash)["4:embedded"].as(Hash)["6:varint"] = 1_i64
end
continuation.rewind
continuation = continuation.gets_to_end
continuation = Base64.urlsafe_encode(continuation.to_slice)
continuation = URI.escape(continuation)
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
return continuation
end
def produce_comment_reply_continuation(video_id, ucid, comment_id)
continuation = IO::Memory.new
object = {
"2:embedded" => {
"2:string" => video_id,
"24:varint" => 1_i64,
"25:varint" => 1_i64,
"28:varint" => 1_i64,
"36:embedded" => {
"5:varint" => -1_i64,
"8:varint" => 0_i64,
},
},
"3:varint" => 6_i64,
"6:embedded" => {
"3:embedded" => {
"2:string" => comment_id,
"4:embedded" => {
"1:varint" => 0_i64,
},
"5:string" => ucid,
"6:string" => video_id,
"8:varint" => 1_i64,
"9:varint" => 10_i64,
},
},
}
continuation.write(Bytes[0x12, 0x26])
continuation.write(Bytes[0x12, video_id.size])
continuation.print(video_id)
continuation.write(Bytes[0xc0, 0x01, 0x01])
continuation.write(Bytes[0xc8, 0x01, 0x01])
continuation.write(Bytes[0xe0, 0x01, 0x01])
continuation.write(Bytes[0xa2, 0x02, 0x0d])
continuation.write(Bytes[0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01])
continuation.write(Bytes[0x40, 0x00])
continuation.write(Bytes[0x18, 0x06])
continuation.write(Bytes[0x32, ucid.size + video_id.size + comment_id.size + 16])
continuation.write(Bytes[0x1a, ucid.size + video_id.size + comment_id.size + 14])
continuation.write(Bytes[0x12, comment_id.size])
continuation.print(comment_id)
continuation.write(Bytes[0x22, 0x02, 0x08, 0x00]) # ??
continuation.write(Bytes[ucid.size + video_id.size + 7])
continuation.write(Bytes[ucid.size])
continuation.print(ucid)
continuation.write(Bytes[0x32, video_id.size])
continuation.print(video_id)
continuation.write(Bytes[0x40, 0x01])
continuation.write(Bytes[0x48, 0x0a])
continuation.rewind
continuation = continuation.gets_to_end
continuation = Base64.urlsafe_encode(continuation.to_slice)
continuation = URI.escape(continuation)
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
return continuation
end

View File

@@ -21,7 +21,7 @@ end
class Kemal::RouteHandler
{% for method in %w(GET POST PUT HEAD DELETE PATCH OPTIONS) %}
exclude ["/api/v1/*"], {{method}}
exclude ["/api/v1/*"], {{method}}
{% end %}
# Processes the route if it's a match. Otherwise renders 404.
@@ -33,8 +33,7 @@ class Kemal::RouteHandler
raise Kemal::Exceptions::CustomException.new(context)
end
if context.request.method == "HEAD" &&
context.request.path.ends_with? ".jpg"
if context.request.method == "HEAD" && context.request.path.ends_with? ".jpg"
context.response.headers["Content-Type"] = "image/jpeg"
end
@@ -45,7 +44,7 @@ end
class Kemal::ExceptionHandler
{% for method in %w(GET POST PUT HEAD DELETE PATCH OPTIONS) %}
exclude ["/api/v1/*"], {{method}}
exclude ["/api/v1/*"], {{method}}
{% end %}
private def call_exception_with_status_code(context : HTTP::Server::Context, exception : Exception, status_code : Int32)
@@ -69,20 +68,20 @@ class FilteredCompressHandler < Kemal::Handler
return call_next env if exclude_match? env
{% if flag?(:without_zlib) %}
call_next env
{% else %}
request_headers = env.request.headers
call_next env
{% else %}
request_headers = env.request.headers
if request_headers.includes_word?("Accept-Encoding", "gzip")
env.response.headers["Content-Encoding"] = "gzip"
env.response.output = Gzip::Writer.new(env.response.output, sync_close: true)
elsif request_headers.includes_word?("Accept-Encoding", "deflate")
env.response.headers["Content-Encoding"] = "deflate"
env.response.output = Flate::Writer.new(env.response.output, sync_close: true)
end
if request_headers.includes_word?("Accept-Encoding", "gzip")
env.response.headers["Content-Encoding"] = "gzip"
env.response.output = Gzip::Writer.new(env.response.output, sync_close: true)
elsif request_headers.includes_word?("Accept-Encoding", "deflate")
env.response.headers["Content-Encoding"] = "deflate"
env.response.output = Flate::Writer.new(env.response.output, sync_close: true)
end
call_next env
{% end %}
call_next env
{% end %}
end
end
@@ -96,8 +95,8 @@ class AuthHandler < Kemal::Handler
begin
if token = env.request.headers["Authorization"]?
token = JSON.parse(URI.unescape(token.lchop("Bearer ")))
session = URI.unescape(token["session"].as_s)
token = JSON.parse(URI.decode_www_form(token.lchop("Bearer ")))
session = URI.decode_www_form(token["session"].as_s)
scopes, expire, signature = validate_request(token, session, env.request, HMAC_KEY, PG_DB, nil)
if email = PG_DB.query_one?("SELECT email FROM session_ids WHERE id = $1", session, as: String)
@@ -130,7 +129,7 @@ class AuthHandler < Kemal::Handler
error_message = {"error" => ex.message}.to_json
env.response.status_code = 403
env.response.puts error_message
env.response.print error_message
end
end
end
@@ -159,10 +158,10 @@ class APIHandler < Kemal::Handler
call_next env
env.response.output.rewind
response = env.response.output.gets_to_end
if env.response.headers["Content-Type"]?.try &.== "application/json"
response = JSON.parse(response)
if env.response.output.as(IO::Memory).size != 0 &&
env.response.headers.includes_word?("Content-Type", "application/json")
response = JSON.parse(env.response.output)
if fields_text = env.params.query["fields"]?
begin
@@ -173,16 +172,30 @@ class APIHandler < Kemal::Handler
end
end
if env.params.query["pretty"]? && env.params.query["pretty"] == "1"
if env.params.query["pretty"]?.try &.== "1"
response = response.to_pretty_json
else
response = response.to_json
end
else
response = env.response.output.gets_to_end
end
rescue ex
env.response.content_type = "application/json" if env.response.headers.includes_word?("Content-Type", "text/html")
env.response.status_code = 500
if env.response.headers.includes_word?("Content-Type", "application/json")
response = {"error" => ex.message || "Unspecified error"}
if env.params.query["pretty"]?.try &.== "1"
response = response.to_pretty_json
else
response = response.to_json
end
end
rescue ex
ensure
env.response.output = output
env.response.puts response
env.response.print response
env.response.flush
end
@@ -213,15 +226,15 @@ end
class HTTP::Client
private def handle_response(response)
if @socket.is_a?(OpenSSL::SSL::Socket::Client)
if @socket.is_a?(OpenSSL::SSL::Socket::Client) && @host.ends_with?("googlevideo.com")
close unless response.keep_alive? || @socket.as(OpenSSL::SSL::Socket::Client).@in_buffer_rem.empty?
if @socket.as(OpenSSL::SSL::Socket::Client).@in_buffer_rem.empty?
@socket = nil
end
else
close unless response.keep_alive?
end
response
end
end

View File

@@ -24,6 +24,27 @@ end
struct ConfigPreferences
module StringToArray
def self.to_json(value : Array(String), json : JSON::Builder)
json.array do
value.each do |element|
json.string element
end
end
end
def self.from_json(value : JSON::PullParser) : Array(String)
begin
result = [] of String
value.read_array do
result << HTML.escape(value.read_string[0, 100])
end
rescue ex
result = [HTML.escape(value.read_string[0, 100]), ""]
end
result
end
def self.to_yaml(value : Array(String), yaml : YAML::Nodes::Builder)
yaml.sequence do
value.each do |element|
@@ -44,11 +65,11 @@ struct ConfigPreferences
node.raise "Expected scalar, not #{item.class}"
end
result << item.value
result << HTML.escape(item.value[0, 100])
end
rescue ex
if node.is_a?(YAML::Nodes::Scalar)
result = [node.value, ""]
result = [HTML.escape(node.value[0, 100]), ""]
else
result = ["", ""]
end
@@ -58,6 +79,51 @@ struct ConfigPreferences
end
end
module BoolToString
def self.to_json(value : String, json : JSON::Builder)
json.string value
end
def self.from_json(value : JSON::PullParser) : String
begin
result = value.read_string
if result.empty?
CONFIG.default_user_preferences.dark_mode
else
result
end
rescue ex
if value.read_bool
"dark"
else
"light"
end
end
end
def self.to_yaml(value : String, yaml : YAML::Nodes::Builder)
yaml.scalar value
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : String
unless node.is_a?(YAML::Nodes::Scalar)
node.raise "Expected scalar, not #{node.class}"
end
case node.value
when "true"
"dark"
when "false"
"light"
when ""
CONFIG.default_user_preferences.dark_mode
else
node.value
end
end
end
yaml_mapping({
annotations: {type: Bool, default: false},
annotations_subscribed: {type: Bool, default: false},
@@ -66,15 +132,17 @@ struct ConfigPreferences
comments: {type: Array(String), default: ["youtube", ""], converter: StringToArray},
continue: {type: Bool, default: false},
continue_autoplay: {type: Bool, default: true},
dark_mode: {type: Bool, default: false},
dark_mode: {type: String, default: "", converter: BoolToString},
latest_only: {type: Bool, default: false},
listen: {type: Bool, default: false},
local: {type: Bool, default: false},
locale: {type: String, default: "en-US"},
max_results: {type: Int32, default: 40},
notifications_only: {type: Bool, default: false},
player_style: {type: String, default: "invidious"},
quality: {type: String, default: "hd720"},
redirect_feed: {type: Bool, default: false},
default_home: {type: String, default: "Popular"},
feed_menu: {type: Array(String), default: ["Popular", "Trending", "Subscriptions", "Playlists"]},
related_videos: {type: Bool, default: true},
sort: {type: String, default: "published"},
speed: {type: Float32, default: 1.0_f32},
@@ -87,12 +155,53 @@ end
struct Config
module ConfigPreferencesConverter
def self.to_yaml(value : Preferences, yaml : YAML::Nodes::Builder)
value.to_yaml(yaml)
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Preferences
Preferences.new(*ConfigPreferences.new(ctx, node).to_tuple)
end
end
def self.to_yaml(value : Preferences, yaml : YAML::Nodes::Builder)
value.to_yaml(yaml)
module FamilyConverter
def self.to_yaml(value : Socket::Family, yaml : YAML::Nodes::Builder)
case value
when Socket::Family::UNSPEC
yaml.scalar nil
when Socket::Family::INET
yaml.scalar "ipv4"
when Socket::Family::INET6
yaml.scalar "ipv6"
end
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Socket::Family
if node.is_a?(YAML::Nodes::Scalar)
case node.value.downcase
when "ipv4"
Socket::Family::INET
when "ipv6"
Socket::Family::INET6
else
Socket::Family::UNSPEC
end
else
node.raise "Expected scalar, not #{node.class}"
end
end
end
def disabled?(option)
case disabled = CONFIG.disable_proxy
when Bool
return disabled
when Array
if disabled.includes? option
return true
else
return false
end
end
end
@@ -105,8 +214,6 @@ struct Config
hmac_key: String?, # HMAC signing key for CSRF tokens and verifying pubsub subscriptions
domain: String?, # Domain to be used for links to resources on the site where an absolute URL is required
use_pubsub_feeds: {type: Bool | Int32, default: false}, # Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
default_home: {type: String, default: "Top"},
feed_menu: {type: Array(String), default: ["Popular", "Top", "Trending", "Subscriptions"]},
top_enabled: {type: Bool, default: true},
captcha_enabled: {type: Bool, default: true},
login_enabled: {type: Bool, default: true},
@@ -118,11 +225,17 @@ struct Config
default: Preferences.new(*ConfigPreferences.from_yaml("").to_tuple),
converter: ConfigPreferencesConverter,
},
dmca_content: {type: Array(String), default: [] of String}, # For compliance with DMCA, disables download widget using list of video IDs
check_tables: {type: Bool, default: false}, # Check table integrity, automatically try to add any missing columns, create tables, etc.
cache_annotations: {type: Bool, default: false}, # Cache annotations requested from IA, will not cache empty annotations or annotations that only contain cards
banner: {type: String?, default: nil}, # Optional banner to be displayed along top of page for announcements, etc.
hsts: {type: Bool?, default: true}, # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely
dmca_content: {type: Array(String), default: [] of String}, # For compliance with DMCA, disables download widget using list of video IDs
check_tables: {type: Bool, default: false}, # Check table integrity, automatically try to add any missing columns, create tables, etc.
cache_annotations: {type: Bool, default: false}, # Cache annotations requested from IA, will not cache empty annotations or annotations that only contain cards
banner: {type: String?, default: nil}, # Optional banner to be displayed along top of page for announcements, etc.
hsts: {type: Bool?, default: true}, # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely
disable_proxy: {type: Bool? | Array(String)?, default: false}, # Disable proxying server-wide: options: 'dash', 'livestreams', 'downloads', 'local'
force_resolve: {type: Socket::Family, default: Socket::Family::UNSPEC, converter: FamilyConverter}, # Connect to YouTube over 'ipv6', 'ipv4'. Will sometimes resolve fix issues with rate-limiting (see https://github.com/ytdl-org/youtube-dl/issues/21729)
port: {type: Int32, default: 3000}, # Port to listen for connections (overrided by command line argument)
host_binding: {type: String, default: "0.0.0.0"}, # Host to bind (overrided by command line argument)
pool_size: {type: Int32, default: 100}, # Pool size for HTTP requests to youtube.com and ytimg.com (each domain has a separate pool of `pool_size`)
admin_email: {type: String, default: "omarroth@protonmail.com"}, # Email for bug reports
})
end
@@ -146,7 +259,7 @@ def rank_videos(db, n)
published = rs.read(Time)
# Exponential decay, older videos tend to rank lower
temperature = wilson_score * Math.exp(-0.000005*((Time.now - published).total_minutes))
temperature = wilson_score * Math.exp(-0.000005*((Time.utc - published).total_minutes))
top << {temperature, id}
end
end
@@ -160,46 +273,47 @@ def rank_videos(db, n)
return top[0..n - 1]
end
def login_req(login_form, f_req)
def login_req(f_req)
data = {
# Unfortunately there's not much information available on `bgRequest`; part of Google's BotGuard
# Generally this is much longer (>1250 characters), see also
# https://github.com/ytdl-org/youtube-dl/commit/baf67a604d912722b0fe03a40e9dc5349a2208cb .
# For now this can be empty.
"bgRequest" => %|["identifier",""]|,
"pstMsg" => "1",
"checkConnection" => "youtube",
"checkedDomains" => "youtube",
"hl" => "en",
"deviceinfo" => %q([null,null,null,[],null,"US",null,null,[],"GlifWebSignIn",null,[null,null,[]]]),
"deviceinfo" => %|[null,null,null,[],null,"US",null,null,[],"GlifWebSignIn",null,[null,null,[]]]|,
"f.req" => f_req,
"flowName" => "GlifWebSignIn",
"flowEntry" => "ServiceLogin",
# "cookiesDisabled" => "false",
# "gmscoreversion" => "undefined",
# "continue" => "https://accounts.google.com/ManageAccount",
# "azt" => "",
# "bgHash" => "",
}
data = login_form.merge(data)
return HTTP::Params.encode(data)
end
def html_to_content(description_html)
if !description_html
description = ""
description_html = ""
else
description_html = description_html.to_s
description = description_html.gsub("<br>", "\n")
description = description.gsub("<br/>", "\n")
def html_to_content(description_html : String)
description = description_html.gsub(/(<br>)|(<br\/>)/, {
"<br>": "\n",
"<br/>": "\n",
})
if description.empty?
description = ""
else
description = XML.parse_html(description).content.strip("\n ")
end
if !description.empty?
description = XML.parse_html(description).content.strip("\n ")
end
return description_html, description
return description
end
def extract_videos(nodeset, ucid = nil, author_name = nil)
videos = extract_items(nodeset, ucid, author_name)
videos.select! { |item| !item.is_a?(SearchChannel | SearchPlaylist) }
videos.map { |video| video.as(SearchVideo) }
videos.select { |item| item.is_a?(SearchVideo) }.map { |video| video.as(SearchVideo) }
end
def extract_items(nodeset, ucid = nil, author_name = nil)
@@ -218,20 +332,9 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
next
end
anchor = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-byline")]/a))
if anchor
author = anchor.content.strip
author_id = anchor["href"].split("/")[-1]
end
author ||= author_name
author_id ||= ucid
author ||= ""
author_id ||= ""
description_html = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-description")]))
description_html, description = html_to_content(description_html)
author_id = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-byline")]/a)).try &.["href"].split("/")[-1] || ucid || ""
author = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-byline")]/a)).try &.content.strip || author_name || ""
description_html = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-description")])).try &.to_s || ""
tile = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-tile")]))
if !tile
@@ -248,14 +351,14 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
anchor = node.xpath_node(%q(.//ul[@class="yt-lockup-meta-info"]/li/a))
end
video_count = node.xpath_node(%q(.//span[@class="formatted-video-count-label"]/b))
video_count = node.xpath_node(%q(.//span[@class="formatted-video-count-label"]/b)) ||
node.xpath_node(%q(.//span[@class="formatted-video-count-label"]))
if video_count
video_count = video_count.content
if video_count == "50+"
author = "YouTube"
author_id = "UC-9-kyTW8ZkZNDHQJ6FgpwQ"
video_count = video_count.rchop("+")
end
video_count = video_count.gsub(/\D/, "").to_i?
@@ -285,22 +388,17 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
)
end
playlist_thumbnail = node.xpath_node(%q(.//div/span/img)).try &.["data-thumb"]?
playlist_thumbnail ||= node.xpath_node(%q(.//div/span/img)).try &.["src"]
if !playlist_thumbnail || playlist_thumbnail.empty?
thumbnail_id = videos[0]?.try &.id
else
thumbnail_id = playlist_thumbnail.match(/\/vi\/(?<video_id>[a-zA-Z0-9_-]{11})\/\w+\.jpg/).try &.["video_id"]
end
playlist_thumbnail = node.xpath_node(%q(.//span/img)).try &.["data-thumb"]?
playlist_thumbnail ||= node.xpath_node(%q(.//span/img)).try &.["src"]
items << SearchPlaylist.new(
title,
plid,
author,
author_id,
video_count,
videos,
thumbnail_id
title: title,
id: plid,
author: author,
ucid: author_id,
video_count: video_count,
videos: videos,
thumbnail: playlist_thumbnail
)
when .includes? "yt-lockup-channel"
author = title.strip
@@ -318,65 +416,37 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
author_thumbnail ||= ""
subscriber_count = node.xpath_node(%q(.//span[contains(@class, "yt-subscriber-count")])).try &.["title"].gsub(/\D/, "").to_i?
subscriber_count ||= 0
subscriber_count = node.xpath_node(%q(.//span[contains(@class, "subscriber-count")]))
.try &.["title"].try { |text| short_text_to_number(text) } || 0
video_count = node.xpath_node(%q(.//ul[@class="yt-lockup-meta-info"]/li)).try &.content.split(" ")[0].gsub(/\D/, "").to_i?
video_count ||= 0
items << SearchChannel.new(
author: author,
ucid: ucid,
author_thumbnail: author_thumbnail,
subscriber_count: subscriber_count,
video_count: video_count,
description: description,
description_html: description_html
video_count: video_count || 0,
description_html: description_html,
auto_generated: video_count ? false : true,
)
else
id = id.lchop("/watch?v=")
metadata = node.xpath_nodes(%q(.//div[contains(@class,"yt-lockup-meta")]/ul/li))
metadata = node.xpath_node(%q(.//div[contains(@class,"yt-lockup-meta")]/ul))
begin
published = decode_date(metadata[0].content.lchop("Streamed ").lchop("Starts "))
rescue ex
end
begin
published ||= Time.unix(metadata[0].xpath_node(%q(.//span)).not_nil!["data-timestamp"].to_i64)
rescue ex
end
published ||= Time.now
published = metadata.try &.xpath_node(%q(.//li[contains(text(), " ago")])).try { |node| decode_date(node.content.sub(/^[a-zA-Z]+ /, "")) }
published ||= metadata.try &.xpath_node(%q(.//span[@data-timestamp])).try { |node| Time.unix(node["data-timestamp"].to_i64) }
published ||= Time.utc
begin
view_count = metadata[0].content.rchop(" watching").delete(",").try &.to_i64?
rescue ex
end
begin
view_count ||= metadata.try &.[1].content.delete("No views,").try &.to_i64?
rescue ex
end
view_count = metadata.try &.xpath_node(%q(.//li[contains(text(), " views")])).try &.content.gsub(/\D/, "").to_i64?
view_count ||= 0_i64
length_seconds = node.xpath_node(%q(.//span[@class="video-time"]))
if length_seconds
length_seconds = decode_length_seconds(length_seconds.content)
else
length_seconds = -1
end
length_seconds = node.xpath_node(%q(.//span[@class="video-time"])).try { |node| decode_length_seconds(node.content) }
length_seconds ||= -1
live_now = node.xpath_node(%q(.//span[contains(@class, "yt-badge-live")]))
if live_now
live_now = true
else
live_now = false
end
if node.xpath_node(%q(.//span[text()="Premium"]))
premium = true
else
premium = false
end
live_now = node.xpath_node(%q(.//span[contains(@class, "yt-badge-live")])) ? true : false
premium = node.xpath_node(%q(.//span[text()="Premium"])) ? true : false
if !premium || node.xpath_node(%q(.//span[contains(text(), "Free episode")]))
paid = false
@@ -396,7 +466,6 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
ucid: author_id,
published: published,
views: view_count,
description: description,
description_html: description_html,
length_seconds: length_seconds,
live_now: live_now,
@@ -415,26 +484,18 @@ def extract_shelf_items(nodeset, ucid = nil, author_name = nil)
nodeset.each do |shelf|
shelf_anchor = shelf.xpath_node(%q(.//h2[contains(@class, "branded-page-module-title")]))
next if !shelf_anchor
if !shelf_anchor
next
end
title = shelf_anchor.xpath_node(%q(.//span[contains(@class, "branded-page-module-title-text")]))
if title
title = title.content.strip
end
title = shelf_anchor.xpath_node(%q(.//span[contains(@class, "branded-page-module-title-text")])).try &.content.strip
title ||= ""
id = shelf_anchor.xpath_node(%q(.//a)).try &.["href"]
if !id
next
end
next if !id
is_playlist = false
shelf_is_playlist = false
videos = [] of SearchPlaylistVideo
shelf.xpath_nodes(%q(.//ul[contains(@class, "yt-uix-shelfslider-list")]/li)).each do |child_node|
shelf.xpath_nodes(%q(.//ul[contains(@class, "yt-uix-shelfslider-list") or contains(@class, "expanded-shelf-content-list")]/li)).each do |child_node|
type = child_node.xpath_node(%q(./div))
if !type
next
@@ -442,7 +503,7 @@ def extract_shelf_items(nodeset, ucid = nil, author_name = nil)
case type["class"]
when .includes? "yt-lockup-video"
is_playlist = true
shelf_is_playlist = true
anchor = child_node.xpath_node(%q(.//h3[contains(@class, "yt-lockup-title")]/a))
if anchor
@@ -475,41 +536,60 @@ def extract_shelf_items(nodeset, ucid = nil, author_name = nil)
playlist_thumbnail = child_node.xpath_node(%q(.//span/img)).try &.["data-thumb"]?
playlist_thumbnail ||= child_node.xpath_node(%q(.//span/img)).try &.["src"]
if !playlist_thumbnail || playlist_thumbnail.empty?
thumbnail_id = videos[0]?.try &.id
else
thumbnail_id = playlist_thumbnail.match(/\/vi\/(?<video_id>[a-zA-Z0-9_-]{11})\/\w+\.jpg/).try &.["video_id"]
end
video_count_label = child_node.xpath_node(%q(.//span[@class="formatted-video-count-label"]))
if video_count_label
video_count = video_count_label.content.gsub(/\D/, "").to_i?
video_count = child_node.xpath_node(%q(.//span[@class="formatted-video-count-label"]/b)) ||
child_node.xpath_node(%q(.//span[@class="formatted-video-count-label"]))
if video_count
video_count = video_count.content.gsub(/\D/, "").to_i?
end
video_count ||= 50
videos = [] of SearchPlaylistVideo
child_node.xpath_nodes(%q(.//*[contains(@class, "yt-lockup-playlist-items")]/li)).each do |video|
anchor = video.xpath_node(%q(.//a))
if anchor
video_title = anchor.content.strip
id = HTTP::Params.parse(URI.parse(anchor["href"]).query.not_nil!)["v"]
end
video_title ||= ""
id ||= ""
anchor = video.xpath_node(%q(.//span/span))
if anchor
length_seconds = decode_length_seconds(anchor.content)
end
length_seconds ||= 0
videos << SearchPlaylistVideo.new(
video_title,
id,
length_seconds
)
end
items << SearchPlaylist.new(
playlist_title,
plid,
author_name,
ucid,
video_count,
Array(SearchPlaylistVideo).new,
thumbnail_id
title: playlist_title,
id: plid,
author: author_name,
ucid: ucid,
video_count: video_count,
videos: videos,
thumbnail: playlist_thumbnail
)
end
end
if is_playlist
if shelf_is_playlist
plid = HTTP::Params.parse(URI.parse(id).query.not_nil!)["list"]
items << SearchPlaylist.new(
title,
plid,
author_name,
ucid,
videos.size,
videos,
videos[0].try &.id
title: title,
id: plid,
author: author_name,
ucid: ucid,
video_count: videos.size,
videos: videos,
thumbnail: "https://i.ytimg.com/vi/#{videos[0].id}/mqdefault.jpg"
)
end
end
@@ -517,12 +597,22 @@ def extract_shelf_items(nodeset, ucid = nil, author_name = nil)
return items
end
def analyze_table(db, logger, table_name, struct_type = nil)
def check_enum(db, logger, enum_name, struct_type = nil)
if !db.query_one?("SELECT true FROM pg_type WHERE typname = $1", enum_name, as: Bool)
logger.puts("CREATE TYPE #{enum_name}")
db.using_connection do |conn|
conn.as(PG::Connection).exec_all(File.read("config/sql/#{enum_name}.sql"))
end
end
end
def check_table(db, logger, table_name, struct_type = nil)
# Create table if it doesn't exist
begin
db.exec("SELECT * FROM #{table_name} LIMIT 0")
rescue ex
logger.write("CREATE TABLE #{table_name}\n")
logger.puts("CREATE TABLE #{table_name}")
db.using_connection do |conn|
conn.as(PG::Connection).exec_all(File.read("config/sql/#{table_name}.sql"))
@@ -546,7 +636,7 @@ def analyze_table(db, logger, table_name, struct_type = nil)
if name != column_array[i]?
if !column_array[i]?
new_column = column_types.select { |line| line.starts_with? name }[0]
logger.write("ALTER TABLE #{table_name} ADD COLUMN #{new_column}\n")
logger.puts("ALTER TABLE #{table_name} ADD COLUMN #{new_column}")
db.exec("ALTER TABLE #{table_name} ADD COLUMN #{new_column}")
next
end
@@ -564,26 +654,29 @@ def analyze_table(db, logger, table_name, struct_type = nil)
# There's a column we didn't expect
if !new_column
logger.write("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]}\n")
logger.puts("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]}")
db.exec("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE")
column_array = get_column_array(db, table_name)
next
end
logger.write("ALTER TABLE #{table_name} ADD COLUMN #{new_column}\n")
logger.puts("ALTER TABLE #{table_name} ADD COLUMN #{new_column}")
db.exec("ALTER TABLE #{table_name} ADD COLUMN #{new_column}")
logger.write("UPDATE #{table_name} SET #{column_array[i]}_new=#{column_array[i]}\n")
logger.puts("UPDATE #{table_name} SET #{column_array[i]}_new=#{column_array[i]}")
db.exec("UPDATE #{table_name} SET #{column_array[i]}_new=#{column_array[i]}")
logger.write("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE\n")
logger.puts("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE")
db.exec("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE")
logger.write("ALTER TABLE #{table_name} RENAME COLUMN #{column_array[i]}_new TO #{column_array[i]}\n")
logger.puts("ALTER TABLE #{table_name} RENAME COLUMN #{column_array[i]}_new TO #{column_array[i]}")
db.exec("ALTER TABLE #{table_name} RENAME COLUMN #{column_array[i]}_new TO #{column_array[i]}")
column_array = get_column_array(db, table_name)
end
else
logger.write("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE\n")
logger.puts("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE")
db.exec("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE")
end
end
@@ -634,34 +727,7 @@ def cache_annotation(db, id, annotations)
end
end
def proxy_file(response, env)
if !response.body_io?
return
end
if response.headers.includes_word?("Content-Encoding", "gzip")
Gzip::Writer.open(env.response) do |deflate|
copy_in_chunks(response.body_io, deflate)
end
elsif response.headers.includes_word?("Content-Encoding", "deflate")
Flate::Writer.open(env.response) do |deflate|
copy_in_chunks(response.body_io, deflate)
end
else
copy_in_chunks(response.body_io, env.response)
end
end
# https://stackoverflow.com/a/44802810 <3
def copy_in_chunks(input, output, chunk_size = 4096)
size = 1
while size > 0
size = IO.copy(input, output, chunk_size)
Fiber.yield
end
end
def create_notification_stream(env, proxies, config, kemal_config, decrypt_function, topics, connection_channel)
def create_notification_stream(env, config, kemal_config, decrypt_function, topics, connection_channel)
connection = Channel(PQ::Notification).new(8)
connection_channel.send({true, connection})
@@ -676,10 +742,10 @@ def create_notification_stream(env, proxies, config, kemal_config, decrypt_funct
loop do
time_span = [0, 0, 0, 0]
time_span[rand(4)] = rand(30) + 5
published = Time.now - Time::Span.new(time_span[0], time_span[1], time_span[2], time_span[3])
published = Time.utc - Time::Span.new(time_span[0], time_span[1], time_span[2], time_span[3])
video_id = TEST_IDS[rand(TEST_IDS.size)]
video = get_video(video_id, PG_DB, proxies)
video = get_video(video_id, PG_DB)
video.published = published
response = JSON.parse(video.to_json(locale, config, kemal_config, decrypt_function))
@@ -700,6 +766,7 @@ def create_notification_stream(env, proxies, config, kemal_config, decrypt_funct
id += 1
sleep 1.minute
Fiber.yield
end
rescue ex
end
@@ -754,7 +821,7 @@ def create_notification_stream(env, proxies, config, kemal_config, decrypt_funct
next
end
video = get_video(video_id, PG_DB, proxies)
video = get_video(video_id, PG_DB)
video.published = Time.unix(published)
response = JSON.parse(video.to_json(locale, config, Kemal.config, decrypt_function))
@@ -783,7 +850,7 @@ def create_notification_stream(env, proxies, config, kemal_config, decrypt_funct
begin
# Send heartbeat
loop do
env.response.puts ":keepalive #{Time.now.to_unix}"
env.response.puts ":keepalive #{Time.utc.to_unix}"
env.response.puts
env.response.flush
sleep (20 + rand(11)).seconds
@@ -793,3 +860,88 @@ def create_notification_stream(env, proxies, config, kemal_config, decrypt_funct
connection_channel.send({false, connection})
end
end
def extract_initial_data(body)
initial_data = body.match(/window\["ytInitialData"\] = (?<info>.*?);\n/).try &.["info"] || "{}"
if initial_data.starts_with?("JSON.parse(\"")
return JSON.parse(JSON.parse(%({"initial_data":"#{initial_data[12..-3]}"}))["initial_data"].as_s)
else
return JSON.parse(initial_data)
end
end
def proxy_file(response, env)
if response.headers.includes_word?("Content-Encoding", "gzip")
Gzip::Writer.open(env.response) do |deflate|
response.pipe(deflate)
end
elsif response.headers.includes_word?("Content-Encoding", "deflate")
Flate::Writer.open(env.response) do |deflate|
response.pipe(deflate)
end
else
response.pipe(env.response)
end
end
class HTTP::Client::Response
def pipe(io)
HTTP.serialize_body(io, headers, @body, @body_io, @version)
end
end
# Supports serialize_body without first writing headers
module HTTP
def self.serialize_body(io, headers, body, body_io, version)
if body
io << body
elsif body_io
content_length = content_length(headers)
if content_length
copied = IO.copy(body_io, io)
if copied != content_length
raise ArgumentError.new("Content-Length header is #{content_length} but body had #{copied} bytes")
end
elsif Client::Response.supports_chunked?(version)
headers["Transfer-Encoding"] = "chunked"
serialize_chunked_body(io, body_io)
else
io << body
end
end
end
end
class HTTP::Client
property family : Socket::Family = Socket::Family::UNSPEC
private def socket
socket = @socket
return socket if socket
hostname = @host.starts_with?('[') && @host.ends_with?(']') ? @host[1..-2] : @host
socket = TCPSocket.new hostname, @port, @dns_timeout, @connect_timeout, @family
socket.read_timeout = @read_timeout if @read_timeout
socket.sync = false
{% if !flag?(:without_openssl) %}
if tls = @tls
socket = OpenSSL::SSL::Socket::Client.new(socket, context: tls, sync_close: true, hostname: @host)
end
{% end %}
@socket = socket
end
end
class TCPSocket
def initialize(host, port, dns_timeout = nil, connect_timeout = nil, family = Socket::Family::UNSPEC)
Addrinfo.tcp(host, port, timeout: dns_timeout, family: family) do |addrinfo|
super(addrinfo.family, addrinfo.type, addrinfo.protocol)
connect(addrinfo, timeout: connect_timeout) do |error|
close
error
end
end
end
end

View File

@@ -22,12 +22,12 @@ def refresh_channels(db, logger, config)
begin
channel = fetch_channel(id, db, config.full_refresh)
db.exec("UPDATE channels SET updated = $1, author = $2, deleted = false WHERE id = $3", Time.now, channel.author, id)
db.exec("UPDATE channels SET updated = $1, author = $2, deleted = false WHERE id = $3", Time.utc, channel.author, id)
rescue ex
if ex.message == "Deleted or invalid channel"
db.exec("UPDATE channels SET updated = $1, deleted = true WHERE id = $2", Time.now, id)
db.exec("UPDATE channels SET updated = $1, deleted = true WHERE id = $2", Time.utc, id)
end
logger.write("#{id} : #{ex.message}\n")
logger.puts("#{id} : #{ex.message}")
end
active_channel.send(true)
@@ -36,6 +36,7 @@ def refresh_channels(db, logger, config)
end
sleep 1.minute
Fiber.yield
end
end
@@ -68,14 +69,14 @@ def refresh_feeds(db, logger, config)
column_array = get_column_array(db, view_name)
ChannelVideo.to_type_tuple.each_with_index do |name, i|
if name != column_array[i]?
logger.write("DROP MATERIALIZED VIEW #{view_name}\n")
logger.puts("DROP MATERIALIZED VIEW #{view_name}")
db.exec("DROP MATERIALIZED VIEW #{view_name}")
raise "view does not exist"
end
end
if db.query_one("SELECT pg_get_viewdef('#{view_name}')", as: String).includes? "ucid = ANY"
logger.write("Materialized view #{view_name} is out-of-date, recreating...\n")
if !db.query_one("SELECT pg_get_viewdef('#{view_name}')", as: String).includes? "WHERE ((cv.ucid = ANY (u.subscriptions))"
logger.puts("Materialized view #{view_name} is out-of-date, recreating...")
db.exec("DROP MATERIALIZED VIEW #{view_name}")
end
@@ -87,21 +88,18 @@ def refresh_feeds(db, logger, config)
legacy_view_name = "subscriptions_#{sha256(email)[0..7]}"
db.exec("SELECT * FROM #{legacy_view_name} LIMIT 0")
logger.write("RENAME MATERIALIZED VIEW #{legacy_view_name}\n")
logger.puts("RENAME MATERIALIZED VIEW #{legacy_view_name}")
db.exec("ALTER MATERIALIZED VIEW #{legacy_view_name} RENAME TO #{view_name}")
rescue ex
begin
# While iterating through, we may have an email stored from a deleted account
if db.query_one?("SELECT true FROM users WHERE email = $1", email, as: Bool)
logger.write("CREATE #{view_name}\n")
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS \
SELECT * FROM channel_videos WHERE
ucid IN (SELECT unnest(subscriptions) FROM users WHERE email = E'#{email.gsub("'", "\\'")}')
ORDER BY published DESC")
logger.puts("CREATE #{view_name}")
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS #{MATERIALIZED_VIEW_SQL.call(email)}")
db.exec("UPDATE users SET feed_needs_update = false WHERE email = $1", email)
end
rescue ex
logger.write("REFRESH #{email} : #{ex.message}\n")
logger.puts("REFRESH #{email} : #{ex.message}")
end
end
end
@@ -112,6 +110,7 @@ def refresh_feeds(db, logger, config)
end
sleep 5.seconds
Fiber.yield
end
end
@@ -128,6 +127,8 @@ def subscribe_to_feeds(db, logger, key, config)
end
max_channel = Channel(Int32).new
client_pool = HTTPPool.new(PUBSUB_URL, capacity: max_threads, timeout: 0.05)
spawn do
max_threads = max_channel.receive
active_threads = 0
@@ -148,12 +149,13 @@ def subscribe_to_feeds(db, logger, key, config)
spawn do
begin
response = subscribe_pubsub(ucid, key, config)
response = subscribe_pubsub(ucid, key, config, client_pool)
if response.status_code >= 400
logger.write("#{ucid} : #{response.body}\n")
logger.puts("#{ucid} : #{response.body}")
end
rescue ex
logger.puts("#{ucid} : #{ex.message}")
end
active_channel.send(true)
@@ -162,6 +164,7 @@ def subscribe_to_feeds(db, logger, key, config)
end
sleep 1.minute
Fiber.yield
end
end
@@ -174,12 +177,16 @@ def pull_top_videos(config, db)
begin
top = rank_videos(db, 40)
rescue ex
sleep 1.minute
Fiber.yield
next
end
if top.size > 0
args = arg_array(top)
else
if top.size == 0
sleep 1.minute
Fiber.yield
next
end
@@ -194,22 +201,23 @@ def pull_top_videos(config, db)
end
yield videos
sleep 1.minute
Fiber.yield
end
end
def pull_popular_videos(db)
loop do
subscriptions = db.query_all("SELECT channel FROM \
(SELECT UNNEST(subscriptions) AS channel FROM users) AS d \
GROUP BY channel ORDER BY COUNT(channel) DESC LIMIT 40", as: String)
videos = db.query_all("SELECT DISTINCT ON (ucid) * FROM \
channel_videos WHERE ucid IN (#{arg_array(subscriptions)}) \
ORDER BY ucid, published DESC", subscriptions, as: ChannelVideo).sort_by { |video| video.published }.reverse
videos = db.query_all("SELECT DISTINCT ON (ucid) * FROM channel_videos WHERE ucid IN \
(SELECT channel FROM (SELECT UNNEST(subscriptions) AS channel FROM users) AS d \
GROUP BY channel ORDER BY COUNT(channel) DESC LIMIT 40) \
ORDER BY ucid, published DESC", as: ChannelVideo).sort_by { |video| video.published }.reverse
yield videos
sleep 1.minute
Fiber.yield
end
end
@@ -217,12 +225,13 @@ def update_decrypt_function
loop do
begin
decrypt_function = fetch_decrypt_function
yield decrypt_function
rescue ex
next
end
yield decrypt_function
sleep 1.minute
Fiber.yield
end
end
@@ -237,5 +246,6 @@ def find_working_proxies(regions)
end
sleep 1.minute
Fiber.yield
end
end

View File

@@ -1,13 +1,20 @@
require "logger"
enum LogLevel
Debug
Info
Warn
Error
end
class Invidious::LogHandler < Kemal::BaseLogHandler
def initialize(@io : IO = STDOUT)
def initialize(@io : IO = STDOUT, @level = LogLevel::Warn)
end
def call(context : HTTP::Server::Context)
time = Time.now
time = Time.utc
call_next(context)
elapsed_text = elapsed_text(Time.now - time)
elapsed_text = elapsed_text(Time.utc - time)
@io << time << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
@@ -18,7 +25,15 @@ class Invidious::LogHandler < Kemal::BaseLogHandler
context
end
def write(message : String)
def puts(message : String)
@io << message << '\n'
if @io.is_a? File
@io.flush
end
end
def write(message : String, level = @level)
@io << message
if @io.is_a? File
@@ -26,6 +41,29 @@ class Invidious::LogHandler < Kemal::BaseLogHandler
end
end
def set_log_level(level : String)
case level.downcase
when "debug"
set_log_level(LogLevel::Debug)
when "info"
set_log_level(LogLevel::Info)
when "warn"
set_log_level(LogLevel::Warn)
when "error"
set_log_level(LogLevel::Error)
end
end
def set_log_level(level : LogLevel)
@level = level
end
{% for level in %w(debug info warn error) %}
def {{level.id}}(message : String)
puts(message, LogLevel::{{level.id.capitalize}})
end
{% end %}
private def elapsed_text(elapsed)
millis = elapsed.total_milliseconds
return "#{millis.round(2)}ms" if millis >= 1

View File

@@ -4,7 +4,7 @@ def Object.from_json(string_or_io, default) : self
new parser, default
end
# Adds configurable 'default' to
# Adds configurable 'default'
macro patched_json_mapping(_properties_, strict = false)
{% for key, value in _properties_ %}
{% _properties_[key] = {type: value} unless value.is_a?(HashLiteral) || value.is_a?(NamedTupleLiteral) %}
@@ -50,7 +50,7 @@ macro patched_json_mapping(_properties_, strict = false)
rescue exc : ::JSON::ParseException
raise ::JSON::MappingError.new(exc.message, self.class.to_s, nil, *%location, exc)
end
while %pull.kind != :end_object
until %pull.kind.end_object?
%key_location = %pull.location
key = %pull.read_object_key
case key

View File

@@ -31,10 +31,10 @@ class HTTPProxy
if resp[:code]? == 200
{% if !flag?(:without_openssl) %}
if tls
tls_socket = OpenSSL::SSL::Socket::Client.new(socket, context: tls, sync_close: true, hostname: host)
socket = tls_socket
end
if tls
tls_socket = OpenSSL::SSL::Socket::Client.new(socket, context: tls, sync_close: true, hostname: host)
socket = tls_socket
end
{% end %}
return socket
@@ -77,6 +77,10 @@ class HTTPClient < HTTP::Client
end
end
def unset_proxy
@socket = nil
end
def proxy_connection_options
opts = {} of Symbol => Float64 | Nil
@@ -86,6 +90,19 @@ class HTTPClient < HTTP::Client
return opts
end
def exec(request)
if self.host == "www.youtube.com"
request.headers["x-youtube-client-name"] ||= "1"
request.headers["x-youtube-client-version"] ||= "1.20180719"
request.headers["user-agent"] ||= random_user_agent
request.headers["accept-charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
request.headers["accept"] ||= "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
request.headers["accept-language"] ||= "en-us,en;q=0.5"
end
super
end
end
def get_proxies(country_code = "US")

View File

@@ -1,8 +1,7 @@
def fetch_decrypt_function(id = "CvFH_6DNRCY")
client = make_client(YT_URL)
document = client.get("/watch?v=#{id}&gl=US&hl=en&disable_polymer=1").body
document = YT_POOL.client &.get("/watch?v=#{id}&gl=US&hl=en&disable_polymer=1").body
url = document.match(/src="(?<url>\/yts\/jsbin\/player_ias-.{9}\/en_US\/base.js)"/).not_nil!["url"]
player = client.get(url).body
player = YT_POOL.client &.get(url).body
function_name = player.match(/^(?<name>[^=]+)=function\(a\){a=a\.split\(""\)/m).not_nil!["name"]
function_body = player.match(/^#{Regex.escape(function_name)}=function\(a\){(?<body>[^}]+)}/m).not_nil!["body"]

View File

@@ -0,0 +1,194 @@
# Since systems have a limit on number of open files (`ulimit -a`),
# we serve them from memory to avoid 'Too many open files' without needing
# to modify ulimit.
#
# Very heavily re-used:
# https://github.com/kemalcr/kemal/blob/master/src/kemal/helpers/helpers.cr
# https://github.com/kemalcr/kemal/blob/master/src/kemal/static_file_handler.cr
#
# Changes:
# - A `send_file` overload is added which supports sending a Slice, file_path, filestat
# - `StaticFileHandler` is patched to cache to and serve from @cached_files
private def multipart(file, env : HTTP::Server::Context)
# See http://httpwg.org/specs/rfc7233.html
fileb = file.size
startb = endb = 0
if match = env.request.headers["Range"].match /bytes=(\d{1,})-(\d{0,})/
startb = match[1].to_i { 0 } if match.size >= 2
endb = match[2].to_i { 0 } if match.size >= 3
end
endb = fileb - 1 if endb == 0
if startb < endb < fileb
content_length = 1 + endb - startb
env.response.status_code = 206
env.response.content_length = content_length
env.response.headers["Accept-Ranges"] = "bytes"
env.response.headers["Content-Range"] = "bytes #{startb}-#{endb}/#{fileb}" # MUST
if startb > 1024
skipped = 0
# file.skip only accepts values less or equal to 1024 (buffer size, undocumented)
until (increase_skipped = skipped + 1024) > startb
file.skip(1024)
skipped = increase_skipped
end
if (skipped_minus_startb = skipped - startb) > 0
file.skip skipped_minus_startb
end
else
file.skip(startb)
end
IO.copy(file, env.response, content_length)
else
env.response.content_length = fileb
env.response.status_code = 200 # Range not satisfable, see 4.4 Note
IO.copy(file, env.response)
end
end
# Set the Content-Disposition to "attachment" with the specified filename,
# instructing the user agents to prompt to save.
private def attachment(env : HTTP::Server::Context, filename : String? = nil, disposition : String? = nil)
disposition = "attachment" if disposition.nil? && filename
if disposition && filename
env.response.headers["Content-Disposition"] = "#{disposition}; filename=\"#{File.basename(filename)}\""
end
end
def send_file(env : HTTP::Server::Context, file_path : String, data : Slice(UInt8), filestat : File::Info, filename : String? = nil, disposition : String? = nil)
config = Kemal.config.serve_static
mime_type = MIME.from_filename(file_path, "application/octet-stream")
env.response.content_type = mime_type
env.response.headers["Accept-Ranges"] = "bytes"
env.response.headers["X-Content-Type-Options"] = "nosniff"
minsize = 860 # http://webmasters.stackexchange.com/questions/31750/what-is-recommended-minimum-object-size-for-gzip-performance-benefits ??
request_headers = env.request.headers
filesize = data.bytesize
attachment(env, filename, disposition)
Kemal.config.static_headers.try(&.call(env.response, file_path, filestat))
file = IO::Memory.new(data)
if env.request.method == "GET" && env.request.headers.has_key?("Range")
return multipart(file, env)
end
condition = config.is_a?(Hash) && config["gzip"]? == true && filesize > minsize && Kemal::Utils.zip_types(file_path)
if condition && request_headers.includes_word?("Accept-Encoding", "gzip")
env.response.headers["Content-Encoding"] = "gzip"
Gzip::Writer.open(env.response) do |deflate|
IO.copy(file, deflate)
end
elsif condition && request_headers.includes_word?("Accept-Encoding", "deflate")
env.response.headers["Content-Encoding"] = "deflate"
Flate::Writer.open(env.response) do |deflate|
IO.copy(file, deflate)
end
else
env.response.content_length = filesize
IO.copy(file, env.response)
end
return
end
module Kemal
class StaticFileHandler < HTTP::StaticFileHandler
CACHE_LIMIT = 5_000_000 # 5MB
@cached_files = {} of String => {data: Bytes, filestat: File::Info}
def call(context : HTTP::Server::Context)
return call_next(context) if context.request.path.not_nil! == "/"
case context.request.method
when "GET", "HEAD"
else
if @fallthrough
call_next(context)
else
context.response.status_code = 405
context.response.headers.add("Allow", "GET, HEAD")
end
return
end
config = Kemal.config.serve_static
original_path = context.request.path.not_nil!
request_path = URI.decode_www_form(original_path)
# File path cannot contains '\0' (NUL) because all filesystem I know
# don't accept '\0' character as file name.
if request_path.includes? '\0'
context.response.status_code = 400
return
end
expanded_path = File.expand_path(request_path, "/")
is_dir_path = if original_path.ends_with?('/') && !expanded_path.ends_with? '/'
expanded_path = expanded_path + '/'
true
else
expanded_path.ends_with? '/'
end
file_path = File.join(@public_dir, expanded_path)
if file = @cached_files[file_path]?
last_modified = file[:filestat].modification_time
add_cache_headers(context.response.headers, last_modified)
if cache_request?(context, last_modified)
context.response.status_code = 304
return
end
send_file(context, file_path, file[:data], file[:filestat])
else
is_dir = Dir.exists? file_path
if request_path != expanded_path
redirect_to context, expanded_path
elsif is_dir && !is_dir_path
redirect_to context, expanded_path + '/'
end
if Dir.exists?(file_path)
if config.is_a?(Hash) && config["dir_listing"] == true
context.response.content_type = "text/html"
directory_listing(context.response, request_path, file_path)
else
call_next(context)
end
elsif File.exists?(file_path)
last_modified = modification_time(file_path)
add_cache_headers(context.response.headers, last_modified)
if cache_request?(context, last_modified)
context.response.status_code = 304
return
end
if @cached_files.sum { |element| element[1][:data].bytesize } + (size = File.size(file_path)) < CACHE_LIMIT
data = Bytes.new(size)
File.open(file_path) do |file|
file.read(data)
end
filestat = File.info(file_path)
@cached_files[file_path] = {data: data, filestat: filestat}
send_file(context, file_path, data, filestat)
else
send_file(context, file_path)
end
else
call_next(context)
end
end
end
end
end

View File

@@ -1,6 +1,6 @@
def generate_token(email, scopes, expire, key, db)
session = "v1:#{Base64.urlsafe_encode(Random::Secure.random_bytes(32))}"
PG_DB.exec("INSERT INTO session_ids VALUES ($1, $2, $3)", session, email, Time.now)
PG_DB.exec("INSERT INTO session_ids VALUES ($1, $2, $3)", session, email, Time.utc)
token = {
"session" => session,
@@ -18,7 +18,7 @@ def generate_token(email, scopes, expire, key, db)
end
def generate_response(session, scopes, key, db, expire = 6.hours, use_nonce = false)
expire = Time.now + expire
expire = Time.utc + expire
token = {
"session" => session,
@@ -69,7 +69,7 @@ end
def validate_request(token, session, request, key, db, locale = nil)
case token
when String
token = JSON.parse(URI.unescape(token)).as_h
token = JSON.parse(URI.decode_www_form(token)).as_h
when JSON::Any
token = token.as_h
when Nil
@@ -85,8 +85,8 @@ def validate_request(token, session, request, key, db, locale = nil)
end
if token["nonce"]? && (nonce = db.query_one?("SELECT * FROM nonces WHERE nonce = $1", token["nonce"], as: {String, Time}))
if nonce[1] > Time.now
db.exec("UPDATE nonces SET expire = $1 WHERE nonce = $2", Time.new(1990, 1, 1), nonce[0])
if nonce[1] > Time.utc
db.exec("UPDATE nonces SET expire = $1 WHERE nonce = $2", Time.utc(1990, 1, 1), nonce[0])
else
raise translate(locale, "Erroneous token")
end
@@ -100,7 +100,7 @@ def validate_request(token, session, request, key, db, locale = nil)
end
expire = token["expire"]?.try &.as_i
if expire.try &.< Time.now.to_unix
if expire.try &.< Time.utc.to_unix
raise translate(locale, "Token is expired, please try again")
end

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ struct MixVideo
ucid: String,
length_seconds: Int32,
index: Int32,
mixes: Array(String),
rdid: String,
})
end
@@ -19,27 +19,21 @@ struct Mix
end
def fetch_mix(rdid, video_id, cookies = nil, locale = nil)
client = make_client(YT_URL)
headers = HTTP::Headers.new
headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
if cookies
headers = cookies.add_request_headers(headers)
end
response = client.get("/watch?v=#{video_id}&list=#{rdid}&gl=US&hl=en&has_verified=1&bpctr=9999999999", headers)
response = YT_POOL.client &.get("/watch?v=#{video_id}&list=#{rdid}&gl=US&hl=en&has_verified=1&bpctr=9999999999", headers)
yt_data = response.body.match(/window\["ytInitialData"\] = (?<data>.*);/)
if yt_data
yt_data = JSON.parse(yt_data["data"].rchop(";"))
else
initial_data = extract_initial_data(response.body)
if !initial_data["contents"]["twoColumnWatchNextResults"]["playlist"]?
raise translate(locale, "Could not create mix.")
end
if !yt_data["contents"]["twoColumnWatchNextResults"]["playlist"]?
raise translate(locale, "Could not create mix.")
end
playlist = yt_data["contents"]["twoColumnWatchNextResults"]["playlist"]["playlist"]
playlist = initial_data["contents"]["twoColumnWatchNextResults"]["playlist"]["playlist"]
mix_title = playlist["title"].as_s
contents = playlist["contents"].as_a
@@ -70,7 +64,7 @@ def fetch_mix(rdid, video_id, cookies = nil, locale = nil)
ucid,
length_seconds,
index,
[rdid]
rdid
)
end

View File

@@ -1,4 +1,84 @@
struct PlaylistVideo
def to_xml(host_url, auto_generated, xml : XML::Builder)
xml.element("entry") do
xml.element("id") { xml.text "yt:video:#{self.id}" }
xml.element("yt:videoId") { xml.text self.id }
xml.element("yt:channelId") { xml.text self.ucid }
xml.element("title") { xml.text self.title }
xml.element("link", rel: "alternate", href: "#{host_url}/watch?v=#{self.id}")
xml.element("author") do
if auto_generated
xml.element("name") { xml.text self.author }
xml.element("uri") { xml.text "#{host_url}/channel/#{self.ucid}" }
else
xml.element("name") { xml.text author }
xml.element("uri") { xml.text "#{host_url}/channel/#{ucid}" }
end
end
xml.element("content", type: "xhtml") do
xml.element("div", xmlns: "http://www.w3.org/1999/xhtml") do
xml.element("a", href: "#{host_url}/watch?v=#{self.id}") do
xml.element("img", src: "#{host_url}/vi/#{self.id}/mqdefault.jpg")
end
end
end
xml.element("published") { xml.text self.published.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("media:group") do
xml.element("media:title") { xml.text self.title }
xml.element("media:thumbnail", url: "#{host_url}/vi/#{self.id}/mqdefault.jpg",
width: "320", height: "180")
end
end
end
def to_xml(host_url, auto_generated, xml : XML::Builder? = nil)
if xml
to_xml(host_url, auto_generated, xml)
else
XML.build do |json|
to_xml(host_url, auto_generated, xml)
end
end
end
def to_json(locale, config, kemal_config, json : JSON::Builder, index : Int32?)
json.object do
json.field "title", self.title
json.field "videoId", self.id
json.field "author", self.author
json.field "authorId", self.ucid
json.field "authorUrl", "/channel/#{self.ucid}"
json.field "videoThumbnails" do
generate_thumbnails(json, self.id, config, kemal_config)
end
if index
json.field "index", index
json.field "indexId", self.index.to_u64.to_s(16).upcase
else
json.field "index", self.index
end
json.field "lengthSeconds", self.length_seconds
end
end
def to_json(locale, config, kemal_config, json : JSON::Builder? = nil, index : Int32? = nil)
if json
to_json(locale, config, kemal_config, json, index: index)
else
JSON.build do |json|
to_json(locale, config, kemal_config, json, index: index)
end
end
end
db_mapping({
title: String,
id: String,
@@ -6,76 +86,195 @@ struct PlaylistVideo
ucid: String,
length_seconds: Int32,
published: Time,
playlists: Array(String),
index: Int32,
plid: String,
index: Int64,
live_now: Bool,
})
end
struct Playlist
def to_json(offset, locale, config, kemal_config, json : JSON::Builder, continuation : String? = nil)
json.object do
json.field "type", "playlist"
json.field "title", self.title
json.field "playlistId", self.id
json.field "playlistThumbnail", self.thumbnail
json.field "author", self.author
json.field "authorId", self.ucid
json.field "authorUrl", "/channel/#{self.ucid}"
json.field "authorThumbnails" do
json.array do
qualities = {32, 48, 76, 100, 176, 512}
qualities.each do |quality|
json.object do
json.field "url", self.author_thumbnail.not_nil!.gsub(/=\d+/, "=s#{quality}")
json.field "width", quality
json.field "height", quality
end
end
end
end
json.field "description", html_to_content(self.description_html)
json.field "descriptionHtml", self.description_html
json.field "videoCount", self.video_count
json.field "viewCount", self.views
json.field "updated", self.updated.to_unix
json.field "isListed", self.privacy.public?
json.field "videos" do
json.array do
videos = get_playlist_videos(PG_DB, self, offset: offset, locale: locale, continuation: continuation)
videos.each_with_index do |video, index|
video.to_json(locale, config, Kemal.config, json)
end
end
end
end
end
def to_json(offset, locale, config, kemal_config, json : JSON::Builder? = nil, continuation : String? = nil)
if json
to_json(offset, locale, config, kemal_config, json, continuation: continuation)
else
JSON.build do |json|
to_json(offset, locale, config, kemal_config, json, continuation: continuation)
end
end
end
db_mapping({
title: String,
id: String,
author: String,
author_thumbnail: String,
ucid: String,
description: String,
description_html: String,
video_count: Int32,
views: Int64,
updated: Time,
thumbnail: String?,
})
def privacy
PlaylistPrivacy::Public
end
end
def fetch_playlist_videos(plid, page, video_count, continuation = nil, locale = nil)
client = make_client(YT_URL)
enum PlaylistPrivacy
Public = 0
Unlisted = 1
Private = 2
end
if continuation
html = client.get("/watch?v=#{continuation}&list=#{plid}&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999")
html = XML.parse_html(html.body)
struct InvidiousPlaylist
def to_json(offset, locale, config, kemal_config, json : JSON::Builder, continuation : String? = nil)
json.object do
json.field "type", "invidiousPlaylist"
json.field "title", self.title
json.field "playlistId", self.id
index = html.xpath_node(%q(//span[@id="playlist-current-index"])).try &.content.to_i?
if index
index -= 1
end
index ||= 0
else
index = (page - 1) * 100
end
json.field "author", self.author
json.field "authorId", self.ucid
json.field "authorUrl", nil
json.field "authorThumbnails", [] of String
if video_count > 100
url = produce_playlist_url(plid, index)
json.field "description", html_to_content(self.description_html)
json.field "descriptionHtml", self.description_html
json.field "videoCount", self.video_count
response = client.get(url)
response = JSON.parse(response.body)
if !response["content_html"]? || response["content_html"].as_s.empty?
raise translate(locale, "Empty playlist")
end
json.field "viewCount", self.views
json.field "updated", self.updated.to_unix
json.field "isListed", self.privacy.public?
document = XML.parse_html(response["content_html"].as_s)
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
videos = extract_playlist(plid, nodeset, index)
else
# Playlist has less than one page of videos, so subsequent pages will be empty
if page > 1
videos = [] of PlaylistVideo
else
# Extract first page of videos
response = client.get("/playlist?list=#{plid}&gl=US&hl=en&disable_polymer=1")
document = XML.parse_html(response.body)
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
videos = extract_playlist(plid, nodeset, 0)
if continuation
until videos[0].id == continuation
videos.shift
json.field "videos" do
json.array do
videos = get_playlist_videos(PG_DB, self, offset: offset, locale: locale, continuation: continuation)
videos.each_with_index do |video, index|
video.to_json(locale, config, Kemal.config, json, offset + index)
end
end
end
end
end
return videos
def to_json(offset, locale, config, kemal_config, json : JSON::Builder? = nil, continuation : String? = nil)
if json
to_json(offset, locale, config, kemal_config, json, continuation: continuation)
else
JSON.build do |json|
to_json(offset, locale, config, kemal_config, json, continuation: continuation)
end
end
end
property thumbnail_id
module PlaylistPrivacyConverter
def self.from_rs(rs)
return PlaylistPrivacy.parse(String.new(rs.read(Slice(UInt8))))
end
end
db_mapping({
title: String,
id: String,
author: String,
description: {type: String, default: ""},
video_count: Int32,
created: Time,
updated: Time,
privacy: {type: PlaylistPrivacy, default: PlaylistPrivacy::Private, converter: PlaylistPrivacyConverter},
index: Array(Int64),
})
def thumbnail
@thumbnail_id ||= PG_DB.query_one?("SELECT id FROM playlist_videos WHERE plid = $1 ORDER BY array_position($2, index) LIMIT 1", self.id, self.index, as: String) || "-----------"
"/vi/#{@thumbnail_id}/mqdefault.jpg"
end
def author_thumbnail
nil
end
def ucid
nil
end
def views
0_i64
end
def description_html
HTML.escape(self.description).gsub("\n", "<br>")
end
end
def create_playlist(db, title, privacy, user)
plid = "IVPL#{Random::Secure.urlsafe_base64(24)[0, 31]}"
playlist = InvidiousPlaylist.new(
title: title.byte_slice(0, 150),
id: plid,
author: user.email,
description: "", # Max 5000 characters
video_count: 0,
created: Time.utc,
updated: Time.utc,
privacy: privacy,
index: [] of Int64,
)
playlist_array = playlist.to_a
args = arg_array(playlist_array)
db.exec("INSERT INTO playlists VALUES (#{args})", args: playlist_array)
return playlist
end
def extract_playlist(plid, nodeset, index)
@@ -114,9 +313,9 @@ def extract_playlist(plid, nodeset, index)
author: author,
ucid: ucid,
length_seconds: length_seconds,
published: Time.now,
playlists: [plid],
index: index + offset,
published: Time.utc,
plid: plid,
index: (index + offset).to_i64,
live_now: live_now
)
end
@@ -128,51 +327,48 @@ def produce_playlist_url(id, index)
if id.starts_with? "UC"
id = "UU" + id.lchop("UC")
end
ucid = "VL" + id
plid = "VL" + id
meta = IO::Memory.new
meta.write(Bytes[0x08])
meta.write(write_var_int(index))
data = {"1:varint" => index.to_i64}
.try { |i| Protodec::Any.cast_json(i) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i, padding: false) }
meta.rewind
meta = Base64.urlsafe_encode(meta.to_slice, false)
meta = "PT:#{meta}"
object = {
"80226972:embedded" => {
"2:string" => plid,
"3:base64" => {
"15:string" => "PT:#{data}",
},
},
}
continuation = IO::Memory.new
continuation.write(Bytes[0x7a, meta.size])
continuation.print(meta)
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
continuation.rewind
meta = Base64.urlsafe_encode(continuation.to_slice)
meta = URI.escape(meta)
return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
end
continuation = IO::Memory.new
continuation.write(Bytes[0x12, ucid.size])
continuation.print(ucid)
continuation.write(Bytes[0x1a, meta.size])
continuation.print(meta)
wrapper = IO::Memory.new
wrapper.write(Bytes[0xe2, 0xa9, 0x85, 0xb2, 0x02, continuation.size])
wrapper.print(continuation)
wrapper.rewind
wrapper = Base64.urlsafe_encode(wrapper.to_slice)
wrapper = URI.escape(wrapper)
url = "/browse_ajax?continuation=#{wrapper}&gl=US&hl=en"
return url
def get_playlist(db, plid, locale, refresh = true, force_refresh = false)
if plid.starts_with? "IV"
if playlist = db.query_one?("SELECT * FROM playlists WHERE id = $1", plid, as: InvidiousPlaylist)
return playlist
else
raise "Playlist does not exist."
end
else
return fetch_playlist(plid, locale)
end
end
def fetch_playlist(plid, locale)
client = make_client(YT_URL)
if plid.starts_with? "UC"
plid = "UU#{plid.lchop("UC")}"
end
response = client.get("/playlist?list=#{plid}&hl=en&disable_polymer=1")
response = YT_POOL.client &.get("/playlist?list=#{plid}&hl=en&disable_polymer=1")
if response.status_code != 200
raise translate(locale, "Not a playlist.")
end
@@ -186,9 +382,11 @@ def fetch_playlist(plid, locale)
end
title = title.content.strip(" \n")
description_html = document.xpath_node(%q(//span[@class="pl-header-description-text"]/div/div[1]))
description_html ||= document.xpath_node(%q(//span[@class="pl-header-description-text"]))
description_html, description = html_to_content(description_html)
description_html = document.xpath_node(%q(//span[@class="pl-header-description-text"]/div/div[1])).try &.to_s ||
document.xpath_node(%q(//span[@class="pl-header-description-text"])).try &.to_s || ""
playlist_thumbnail = document.xpath_node(%q(//div[@class="pl-header-thumb"]/img)).try &.["data-thumb"]? ||
document.xpath_node(%q(//div[@class="pl-header-thumb"]/img)).try &.["src"]
# YouTube allows anonymous playlists, so most of this can be empty or optional
anchor = document.xpath_node(%q(//ul[@class="pl-header-details"]))
@@ -201,15 +399,12 @@ def fetch_playlist(plid, locale)
video_count = anchor.try &.xpath_node(%q(.//li[2])).try &.content.gsub(/\D/, "").to_i?
video_count ||= 0
views = anchor.try &.xpath_node(%q(.//li[3])).try &.content.delete("No views, ").to_i64?
views = anchor.try &.xpath_node(%q(.//li[3])).try &.content.gsub(/\D/, "").to_i64?
views ||= 0_i64
updated = anchor.try &.xpath_node(%q(.//li[4])).try &.content.lchop("Last updated on ").lchop("Updated ")
if updated
updated = decode_date(updated)
else
updated = Time.now
end
updated = anchor.try &.xpath_node(%q(.//li[4])).try &.content.lchop("Last updated on ").lchop("Updated ").try { |date| decode_date(date) }
updated ||= Time.utc
playlist = Playlist.new(
title: title,
@@ -217,16 +412,67 @@ def fetch_playlist(plid, locale)
author: author,
author_thumbnail: author_thumbnail,
ucid: ucid,
description: description,
description_html: description_html,
video_count: video_count,
views: views,
updated: updated
updated: updated,
thumbnail: playlist_thumbnail,
)
return playlist
end
def get_playlist_videos(db, playlist, offset, locale = nil, continuation = nil)
if playlist.is_a? InvidiousPlaylist
if !offset
index = PG_DB.query_one?("SELECT index FROM playlist_videos WHERE plid = $1 AND id = $2 LIMIT 1", playlist.id, continuation, as: Int64)
offset = playlist.index.index(index) || 0
end
db.query_all("SELECT * FROM playlist_videos WHERE plid = $1 ORDER BY array_position($2, index) LIMIT 100 OFFSET $3", playlist.id, playlist.index, offset, as: PlaylistVideo)
else
fetch_playlist_videos(playlist.id, playlist.video_count, offset, locale, continuation)
end
end
def fetch_playlist_videos(plid, video_count, offset = 0, locale = nil, continuation = nil)
if continuation
html = YT_POOL.client &.get("/watch?v=#{continuation}&list=#{plid}&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999")
html = XML.parse_html(html.body)
index = html.xpath_node(%q(//span[@id="playlist-current-index"])).try &.content.to_i?.try &.- 1
offset = index || offset
end
if video_count > 100
url = produce_playlist_url(plid, offset)
response = YT_POOL.client &.get(url)
response = JSON.parse(response.body)
if !response["content_html"]? || response["content_html"].as_s.empty?
raise translate(locale, "Empty playlist")
end
document = XML.parse_html(response["content_html"].as_s)
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
videos = extract_playlist(plid, nodeset, offset)
elsif offset > 100
return [] of PlaylistVideo
else # Extract first page of videos
response = YT_POOL.client &.get("/playlist?list=#{plid}&gl=US&hl=en&disable_polymer=1")
document = XML.parse_html(response.body)
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
videos = extract_playlist(plid, nodeset, 0)
end
until videos.empty? || videos[0].index == offset
videos.shift
end
return videos
end
def template_playlist(playlist)
html = <<-END_HTML
<h3>

View File

@@ -1,4 +1,96 @@
struct SearchVideo
def to_xml(host_url, auto_generated, query_params, xml : XML::Builder)
query_params["v"] = self.id
xml.element("entry") do
xml.element("id") { xml.text "yt:video:#{self.id}" }
xml.element("yt:videoId") { xml.text self.id }
xml.element("yt:channelId") { xml.text self.ucid }
xml.element("title") { xml.text self.title }
xml.element("link", rel: "alternate", href: "#{host_url}/watch?#{query_params}")
xml.element("author") do
if auto_generated
xml.element("name") { xml.text self.author }
xml.element("uri") { xml.text "#{host_url}/channel/#{self.ucid}" }
else
xml.element("name") { xml.text author }
xml.element("uri") { xml.text "#{host_url}/channel/#{ucid}" }
end
end
xml.element("content", type: "xhtml") do
xml.element("div", xmlns: "http://www.w3.org/1999/xhtml") do
xml.element("a", href: "#{host_url}/watch?#{query_params}") do
xml.element("img", src: "#{host_url}/vi/#{self.id}/mqdefault.jpg")
end
xml.element("p", style: "word-break:break-word;white-space:pre-wrap") { xml.text html_to_content(self.description_html) }
end
end
xml.element("published") { xml.text self.published.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("media:group") do
xml.element("media:title") { xml.text self.title }
xml.element("media:thumbnail", url: "#{host_url}/vi/#{self.id}/mqdefault.jpg",
width: "320", height: "180")
xml.element("media:description") { xml.text html_to_content(self.description_html) }
end
xml.element("media:community") do
xml.element("media:statistics", views: self.views)
end
end
end
def to_xml(host_url, auto_generated, query_params, xml : XML::Builder | Nil = nil)
if xml
to_xml(host_url, auto_generated, query_params, xml)
else
XML.build do |json|
to_xml(host_url, auto_generated, query_params, xml)
end
end
end
def to_json(locale, config, kemal_config, json : JSON::Builder)
json.object do
json.field "type", "video"
json.field "title", self.title
json.field "videoId", self.id
json.field "author", self.author
json.field "authorId", self.ucid
json.field "authorUrl", "/channel/#{self.ucid}"
json.field "videoThumbnails" do
generate_thumbnails(json, self.id, config, kemal_config)
end
json.field "description", html_to_content(self.description_html)
json.field "descriptionHtml", self.description_html
json.field "viewCount", self.views
json.field "published", self.published.to_unix
json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale))
json.field "lengthSeconds", self.length_seconds
json.field "liveNow", self.live_now
json.field "paid", self.paid
json.field "premium", self.premium
end
end
def to_json(locale, config, kemal_config, json : JSON::Builder | Nil = nil)
if json
to_json(locale, config, kemal_config, json)
else
JSON.build do |json|
to_json(locale, config, kemal_config, json)
end
end
end
db_mapping({
title: String,
id: String,
@@ -6,7 +98,6 @@ struct SearchVideo
ucid: String,
published: Time,
views: Int64,
description: String,
description_html: String,
length_seconds: Int32,
live_now: Bool,
@@ -25,46 +116,124 @@ struct SearchPlaylistVideo
end
struct SearchPlaylist
def to_json(locale, config, kemal_config, json : JSON::Builder)
json.object do
json.field "type", "playlist"
json.field "title", self.title
json.field "playlistId", self.id
json.field "playlistThumbnail", self.thumbnail
json.field "author", self.author
json.field "authorId", self.ucid
json.field "authorUrl", "/channel/#{self.ucid}"
json.field "videoCount", self.video_count
json.field "videos" do
json.array do
self.videos.each do |video|
json.object do
json.field "title", video.title
json.field "videoId", video.id
json.field "lengthSeconds", video.length_seconds
json.field "videoThumbnails" do
generate_thumbnails(json, video.id, config, Kemal.config)
end
end
end
end
end
end
end
def to_json(locale, config, kemal_config, json : JSON::Builder | Nil = nil)
if json
to_json(locale, config, kemal_config, json)
else
JSON.build do |json|
to_json(locale, config, kemal_config, json)
end
end
end
db_mapping({
title: String,
id: String,
author: String,
ucid: String,
video_count: Int32,
videos: Array(SearchPlaylistVideo),
thumbnail_id: String?,
title: String,
id: String,
author: String,
ucid: String,
video_count: Int32,
videos: Array(SearchPlaylistVideo),
thumbnail: String?,
})
end
struct SearchChannel
def to_json(locale, config, kemal_config, json : JSON::Builder)
json.object do
json.field "type", "channel"
json.field "author", self.author
json.field "authorId", self.ucid
json.field "authorUrl", "/channel/#{self.ucid}"
json.field "authorThumbnails" do
json.array do
qualities = {32, 48, 76, 100, 176, 512}
qualities.each do |quality|
json.object do
json.field "url", self.author_thumbnail.gsub(/=\d+/, "=s#{quality}")
json.field "width", quality
json.field "height", quality
end
end
end
end
json.field "autoGenerated", self.auto_generated
json.field "subCount", self.subscriber_count
json.field "videoCount", self.video_count
json.field "description", html_to_content(self.description_html)
json.field "descriptionHtml", self.description_html
end
end
def to_json(locale, config, kemal_config, json : JSON::Builder | Nil = nil)
if json
to_json(locale, config, kemal_config, json)
else
JSON.build do |json|
to_json(locale, config, kemal_config, json)
end
end
end
db_mapping({
author: String,
ucid: String,
author_thumbnail: String,
subscriber_count: Int32,
video_count: Int32,
description: String,
description_html: String,
auto_generated: Bool,
})
end
alias SearchItem = SearchVideo | SearchChannel | SearchPlaylist
def channel_search(query, page, channel)
client = make_client(YT_URL)
response = client.get("/channel/#{channel}?disable_polymer=1&hl=en&gl=US")
response = YT_POOL.client &.get("/channel/#{channel}?disable_polymer=1&hl=en&gl=US")
document = XML.parse_html(response.body)
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
if !canonical
response = client.get("/c/#{channel}?disable_polymer=1&hl=en&gl=US")
response = YT_POOL.client &.get("/c/#{channel}?disable_polymer=1&hl=en&gl=US")
document = XML.parse_html(response.body)
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
end
if !canonical
response = client.get("/user/#{channel}?disable_polymer=1&hl=en&gl=US")
response = YT_POOL.client &.get("/user/#{channel}?disable_polymer=1&hl=en&gl=US")
document = XML.parse_html(response.body)
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
end
@@ -76,7 +245,7 @@ def channel_search(query, page, channel)
ucid = canonical["href"].split("/")[-1]
url = produce_channel_search_url(ucid, query, page)
response = client.get(url)
response = YT_POOL.client &.get(url)
json = JSON.parse(response.body)
if json["content_html"]? && !json["content_html"].as_s.empty?
@@ -93,13 +262,12 @@ def channel_search(query, page, channel)
return count, items
end
def search(query, page = 1, search_params = produce_search_params(content_type: "all"), proxies = nil, region = nil)
client = make_client(YT_URL, proxies, region)
def search(query, page = 1, search_params = produce_search_params(content_type: "all"), region = nil)
if query.empty?
return {0, [] of SearchItem}
end
html = client.get("/results?q=#{URI.escape(query)}&page=#{page}&sp=#{search_params}&hl=en&disable_polymer=1").body
html = YT_POOL.client(region, &.get("/results?q=#{URI.encode_www_form(query)}&page=#{page}&sp=#{search_params}&hl=en&disable_polymer=1").body)
if html.empty?
return {0, [] of SearchItem}
end
@@ -113,143 +281,185 @@ end
def produce_search_params(sort : String = "relevance", date : String = "", content_type : String = "",
duration : String = "", features : Array(String) = [] of String)
head = "\x08"
head += case sort
when "relevance"
"\x00"
when "rating"
"\x01"
when "upload_date", "date"
"\x02"
when "view_count", "views"
"\x03"
else
raise "No sort #{sort}"
end
object = {
"1:varint" => 0_i64,
"2:embedded" => {} of String => Int64,
}
body = ""
body += case date
when "hour"
"\x08\x01"
when "today"
"\x08\x02"
when "week"
"\x08\x03"
when "month"
"\x08\x04"
when "year"
"\x08\x05"
else
""
end
case sort
when "relevance"
object["1:varint"] = 0_i64
when "rating"
object["1:varint"] = 1_i64
when "upload_date", "date"
object["1:varint"] = 2_i64
when "view_count", "views"
object["1:varint"] = 3_i64
else
raise "No sort #{sort}"
end
body += case content_type
when "video"
"\x10\x01"
when "channel"
"\x10\x02"
when "playlist"
"\x10\x03"
when "movie"
"\x10\x04"
when "show"
"\x10\x05"
when "all"
""
else
"\x10\x01"
end
case date
when "hour"
object["2:embedded"].as(Hash)["1:varint"] = 1_i64
when "today"
object["2:embedded"].as(Hash)["1:varint"] = 2_i64
when "week"
object["2:embedded"].as(Hash)["1:varint"] = 3_i64
when "month"
object["2:embedded"].as(Hash)["1:varint"] = 4_i64
when "year"
object["2:embedded"].as(Hash)["1:varint"] = 5_i64
end
body += case duration
when "short"
"\x18\x01"
when "long"
"\x18\x02"
else
""
end
case content_type
when "video"
object["2:embedded"].as(Hash)["2:varint"] = 1_i64
when "channel"
object["2:embedded"].as(Hash)["2:varint"] = 2_i64
when "playlist"
object["2:embedded"].as(Hash)["2:varint"] = 3_i64
when "movie"
object["2:embedded"].as(Hash)["2:varint"] = 4_i64
when "show"
object["2:embedded"].as(Hash)["2:varint"] = 5_i64
when "all"
#
else
object["2:embedded"].as(Hash)["2:varint"] = 1_i64
end
case duration
when "short"
object["2:embedded"].as(Hash)["3:varint"] = 1_i64
when "long"
object["2:embedded"].as(Hash)["3:varint"] = 18_i64
end
features.each do |feature|
body += case feature
when "hd"
"\x20\x01"
when "subtitles"
"\x28\x01"
when "creative_commons", "cc"
"\x30\x01"
when "3d"
"\x38\x01"
when "live", "livestream"
"\x40\x01"
when "purchased"
"\x48\x01"
when "4k"
"\x70\x01"
when "360"
"\x78\x01"
when "location"
"\xb8\x01\x01"
when "hdr"
"\xc8\x01\x01"
else
raise "Unknown feature #{feature}"
end
case feature
when "hd"
object["2:embedded"].as(Hash)["4:varint"] = 1_i64
when "subtitles"
object["2:embedded"].as(Hash)["5:varint"] = 1_i64
when "creative_commons", "cc"
object["2:embedded"].as(Hash)["6:varint"] = 1_i64
when "3d"
object["2:embedded"].as(Hash)["7:varint"] = 1_i64
when "live", "livestream"
object["2:embedded"].as(Hash)["8:varint"] = 1_i64
when "purchased"
object["2:embedded"].as(Hash)["9:varint"] = 1_i64
when "4k"
object["2:embedded"].as(Hash)["14:varint"] = 1_i64
when "360"
object["2:embedded"].as(Hash)["15:varint"] = 1_i64
when "location"
object["2:embedded"].as(Hash)["23:varint"] = 1_i64
when "hdr"
object["2:embedded"].as(Hash)["25:varint"] = 1_i64
end
end
if !body.empty?
token = head + "\x12" + body.size.unsafe_chr + body
else
token = head
if object["2:embedded"].as(Hash).empty?
object.delete("2:embedded")
end
token = Base64.urlsafe_encode(token)
token = URI.escape(token)
params = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
return token
return params
end
def produce_channel_search_url(ucid, query, page)
page = "#{page}"
object = {
"80226972:embedded" => {
"2:string" => ucid,
"3:base64" => {
"2:string" => "search",
"6:varint" => 2_i64,
"7:varint" => 1_i64,
"12:varint" => 1_i64,
"13:string" => "",
"23:varint" => 0_i64,
"15:string" => "#{page}",
},
"11:string" => query,
},
}
meta = IO::Memory.new
meta.write(Bytes[0x12, 0x06])
meta.print("search")
continuation = object.try { |i| Protodec::Any.cast_json(object) }
.try { |i| Protodec::Any.from_json(i) }
.try { |i| Base64.urlsafe_encode(i) }
.try { |i| URI.encode_www_form(i) }
meta.write(Bytes[0x30, 0x02])
meta.write(Bytes[0x38, 0x01])
meta.write(Bytes[0x60, 0x01])
meta.write(Bytes[0x6a, 0x00])
meta.write(Bytes[0xb8, 0x01, 0x00])
meta.write(Bytes[0x7a, page.size])
meta.print(page)
meta.rewind
meta = Base64.urlsafe_encode(meta.to_slice)
meta = URI.escape(meta)
continuation = IO::Memory.new
continuation.write(Bytes[0x12, ucid.size])
continuation.print(ucid)
continuation.write(Bytes[0x1a, meta.size])
continuation.print(meta)
continuation.write(Bytes[0x5a, query.size])
continuation.print(query)
continuation.rewind
continuation = continuation.gets_to_end
wrapper = IO::Memory.new
wrapper.write(Bytes[0xe2, 0xa9, 0x85, 0xb2, 0x02, continuation.size])
wrapper.print(continuation)
wrapper.rewind
wrapper = Base64.urlsafe_encode(wrapper.to_slice)
wrapper = URI.escape(wrapper)
url = "/browse_ajax?continuation=#{wrapper}&gl=US&hl=en"
return url
return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en"
end
def process_search_query(query, page, user, region)
if user
user = user.as(User)
view_name = "subscriptions_#{sha256(user.email)}"
end
channel = nil
content_type = "all"
date = ""
duration = ""
features = [] of String
sort = "relevance"
subscriptions = nil
operators = query.split(" ").select { |a| a.match(/\w+:[\w,]+/) }
operators.each do |operator|
key, value = operator.downcase.split(":")
case key
when "channel", "user"
channel = operator.split(":")[-1]
when "content_type", "type"
content_type = value
when "date"
date = value
when "duration"
duration = value
when "feature", "features"
features = value.split(",")
when "sort"
sort = value
when "subscriptions"
subscriptions = value == "true"
else
operators.delete(operator)
end
end
search_query = (query.split(" ") - operators).join(" ")
if channel
count, items = channel_search(search_query, page, channel)
elsif subscriptions
if view_name
items = PG_DB.query_all("SELECT id,title,published,updated,ucid,author,length_seconds FROM (
SELECT *,
to_tsvector(#{view_name}.title) ||
to_tsvector(#{view_name}.author)
as document
FROM #{view_name}
) v_search WHERE v_search.document @@ plainto_tsquery($1) LIMIT 20 OFFSET $2;", search_query, (page - 1) * 20, as: ChannelVideo)
count = items.size
else
items = [] of ChannelVideo
count = 0
end
else
search_params = produce_search_params(sort: sort, date: date, content_type: content_type,
duration: duration, features: features)
count, items = search(search_query, page, search_params, region).as(Tuple)
end
{search_query, count, items}
end

View File

@@ -1,5 +1,4 @@
def fetch_trending(trending_type, proxies, region, locale)
client = make_client(YT_URL)
def fetch_trending(trending_type, region, locale)
headers = HTTP::Headers.new
headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
@@ -12,29 +11,24 @@ def fetch_trending(trending_type, proxies, region, locale)
if trending_type && trending_type != "Default"
trending_type = trending_type.downcase.capitalize
response = client.get("/feed/trending?gl=#{region}&hl=en", headers).body
response = YT_POOL.client &.get("/feed/trending?gl=#{region}&hl=en", headers).body
yt_data = response.match(/window\["ytInitialData"\] = (?<data>.*);/)
if yt_data
yt_data = JSON.parse(yt_data["data"].rchop(";"))
else
raise translate(locale, "Could not pull trending pages.")
end
initial_data = extract_initial_data(response)
tabs = yt_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"][0]["tabRenderer"]["content"]["sectionListRenderer"]["subMenu"]["channelListSubMenuRenderer"]["contents"].as_a
tabs = initial_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"][0]["tabRenderer"]["content"]["sectionListRenderer"]["subMenu"]["channelListSubMenuRenderer"]["contents"].as_a
url = tabs.select { |tab| tab["channelListSubMenuAvatarRenderer"]["title"]["simpleText"] == trending_type }[0]?
if url
url["channelListSubMenuAvatarRenderer"]["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"]
url = url["channelListSubMenuAvatarRenderer"]["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"].as_s
url += "&disable_polymer=1&gl=#{region}&hl=en"
trending = client.get(url).body
trending = YT_POOL.client &.get(url).body
plid = extract_plid(url)
else
trending = client.get("/feed/trending?gl=#{region}&hl=en&disable_polymer=1").body
trending = YT_POOL.client &.get("/feed/trending?gl=#{region}&hl=en&disable_polymer=1").body
end
else
trending = client.get("/feed/trending?gl=#{region}&hl=en&disable_polymer=1").body
trending = YT_POOL.client &.get("/feed/trending?gl=#{region}&hl=en&disable_polymer=1").body
end
trending = XML.parse_html(trending)
@@ -47,7 +41,7 @@ end
def extract_plid(url)
wrapper = HTTP::Params.parse(URI.parse(url).query.not_nil!)["bp"]
wrapper = URI.unescape(wrapper)
wrapper = URI.decode_www_form(wrapper)
wrapper = Base64.decode(wrapper)
# 0xe2 0x02 0x2e

View File

@@ -1,5 +1,8 @@
require "crypto/bcrypt/password"
# Materialized views may not be defined using bound parameters (`$1` as used elsewhere)
MATERIALIZED_VIEW_SQL = ->(email : String) { "SELECT cv.* FROM channel_videos cv WHERE EXISTS (SELECT subscriptions FROM users u WHERE cv.ucid = ANY (u.subscriptions) AND u.email = E'#{email.gsub({'\'' => "\\'", '\\' => "\\\\"})}') ORDER BY published DESC" }
struct User
module PreferencesConverter
def self.from_rs(rs)
@@ -28,69 +31,13 @@ struct User
end
struct Preferences
module StringToArray
def self.to_json(value : Array(String), json : JSON::Builder)
json.array do
value.each do |element|
json.string element
end
end
end
def self.from_json(value : JSON::PullParser) : Array(String)
begin
result = [] of String
value.read_array do
result << HTML.escape(value.read_string)
end
rescue ex
result = [HTML.escape(value.read_string), ""]
end
result
end
def self.to_yaml(value : Array(String), yaml : YAML::Nodes::Builder)
yaml.sequence do
value.each do |element|
yaml.scalar element
end
end
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Array(String)
begin
unless node.is_a?(YAML::Nodes::Sequence)
node.raise "Expected sequence, not #{node.class}"
end
result = [] of String
node.nodes.each do |item|
unless item.is_a?(YAML::Nodes::Scalar)
node.raise "Expected scalar, not #{item.class}"
end
result << HTML.escape(item.value)
end
rescue ex
if node.is_a?(YAML::Nodes::Scalar)
result = [HTML.escape(node.value), ""]
else
result = ["", ""]
end
end
result
end
end
module EscapeString
module ProcessString
def self.to_json(value : String, json : JSON::Builder)
json.string value
end
def self.from_json(value : JSON::PullParser) : String
HTML.escape(value.read_string)
HTML.escape(value.read_string[0, 100])
end
def self.to_yaml(value : String, yaml : YAML::Nodes::Builder)
@@ -98,7 +45,25 @@ struct Preferences
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : String
HTML.escape(node.value)
HTML.escape(node.value[0, 100])
end
end
module ClampInt
def self.to_json(value : Int32, json : JSON::Builder)
json.number value
end
def self.from_json(value : JSON::PullParser) : Int32
value.read_int.clamp(0, MAX_ITEMS_PER_PAGE).to_i32
end
def self.to_yaml(value : Int32, yaml : YAML::Nodes::Builder)
yaml.scalar value
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Int32
node.value.clamp(0, MAX_ITEMS_PER_PAGE)
end
end
@@ -106,21 +71,23 @@ struct Preferences
annotations: {type: Bool, default: CONFIG.default_user_preferences.annotations},
annotations_subscribed: {type: Bool, default: CONFIG.default_user_preferences.annotations_subscribed},
autoplay: {type: Bool, default: CONFIG.default_user_preferences.autoplay},
captions: {type: Array(String), default: CONFIG.default_user_preferences.captions, converter: StringToArray},
comments: {type: Array(String), default: CONFIG.default_user_preferences.comments, converter: StringToArray},
captions: {type: Array(String), default: CONFIG.default_user_preferences.captions, converter: ConfigPreferences::StringToArray},
comments: {type: Array(String), default: CONFIG.default_user_preferences.comments, converter: ConfigPreferences::StringToArray},
continue: {type: Bool, default: CONFIG.default_user_preferences.continue},
continue_autoplay: {type: Bool, default: CONFIG.default_user_preferences.continue_autoplay},
dark_mode: {type: Bool, default: CONFIG.default_user_preferences.dark_mode},
dark_mode: {type: String, default: CONFIG.default_user_preferences.dark_mode, converter: ConfigPreferences::BoolToString},
latest_only: {type: Bool, default: CONFIG.default_user_preferences.latest_only},
listen: {type: Bool, default: CONFIG.default_user_preferences.listen},
local: {type: Bool, default: CONFIG.default_user_preferences.local},
locale: {type: String, default: CONFIG.default_user_preferences.locale, converter: EscapeString},
max_results: {type: Int32, default: CONFIG.default_user_preferences.max_results},
locale: {type: String, default: CONFIG.default_user_preferences.locale, converter: ProcessString},
max_results: {type: Int32, default: CONFIG.default_user_preferences.max_results, converter: ClampInt},
notifications_only: {type: Bool, default: CONFIG.default_user_preferences.notifications_only},
quality: {type: String, default: CONFIG.default_user_preferences.quality, converter: EscapeString},
redirect_feed: {type: Bool, default: CONFIG.default_user_preferences.redirect_feed},
player_style: {type: String, default: CONFIG.default_user_preferences.player_style, converter: ProcessString},
quality: {type: String, default: CONFIG.default_user_preferences.quality, converter: ProcessString},
default_home: {type: String, default: CONFIG.default_user_preferences.default_home},
feed_menu: {type: Array(String), default: CONFIG.default_user_preferences.feed_menu},
related_videos: {type: Bool, default: CONFIG.default_user_preferences.related_videos},
sort: {type: String, default: CONFIG.default_user_preferences.sort, converter: EscapeString},
sort: {type: String, default: CONFIG.default_user_preferences.sort, converter: ProcessString},
speed: {type: Float32, default: CONFIG.default_user_preferences.speed},
thin_mode: {type: Bool, default: CONFIG.default_user_preferences.thin_mode},
unseen_only: {type: Bool, default: CONFIG.default_user_preferences.unseen_only},
@@ -133,7 +100,7 @@ def get_user(sid, headers, db, refresh = true)
if email = db.query_one?("SELECT email FROM session_ids WHERE id = $1", sid, as: String)
user = db.query_one("SELECT * FROM users WHERE email = $1", email, as: User)
if refresh && Time.now - user.updated > 1.minute
if refresh && Time.utc - user.updated > 1.minute
user, sid = fetch_user(sid, headers, db)
user_array = user.to_a
@@ -141,17 +108,14 @@ def get_user(sid, headers, db, refresh = true)
args = arg_array(user_array)
db.exec("INSERT INTO users VALUES (#{args}) \
ON CONFLICT (email) DO UPDATE SET updated = $1, subscriptions = $3", user_array)
ON CONFLICT (email) DO UPDATE SET updated = $1, subscriptions = $3", args: user_array)
db.exec("INSERT INTO session_ids VALUES ($1,$2,$3) \
ON CONFLICT (id) DO NOTHING", sid, user.email, Time.now)
ON CONFLICT (id) DO NOTHING", sid, user.email, Time.utc)
begin
view_name = "subscriptions_#{sha256(user.email)}"
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS \
SELECT * FROM channel_videos WHERE
ucid IN (SELECT unnest(subscriptions) FROM users WHERE email = E'#{user.email.gsub("'", "\\'")}')
ORDER BY published DESC")
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS #{MATERIALIZED_VIEW_SQL.call(user.email)}")
rescue ex
end
end
@@ -163,17 +127,14 @@ def get_user(sid, headers, db, refresh = true)
args = arg_array(user.to_a)
db.exec("INSERT INTO users VALUES (#{args}) \
ON CONFLICT (email) DO UPDATE SET updated = $1, subscriptions = $3", user_array)
ON CONFLICT (email) DO UPDATE SET updated = $1, subscriptions = $3", args: user_array)
db.exec("INSERT INTO session_ids VALUES ($1,$2,$3) \
ON CONFLICT (id) DO NOTHING", sid, user.email, Time.now)
ON CONFLICT (id) DO NOTHING", sid, user.email, Time.utc)
begin
view_name = "subscriptions_#{sha256(user.email)}"
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS \
SELECT * FROM channel_videos WHERE
ucid IN (SELECT unnest(subscriptions) FROM users WHERE email = E'#{user.email.gsub("'", "\\'")}')
ORDER BY published DESC")
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS #{MATERIALIZED_VIEW_SQL.call(user.email)}")
rescue ex
end
end
@@ -182,8 +143,7 @@ def get_user(sid, headers, db, refresh = true)
end
def fetch_user(sid, headers, db)
client = make_client(YT_URL)
feed = client.get("/subscription_manager?disable_polymer=1", headers)
feed = YT_POOL.client &.get("/subscription_manager?disable_polymer=1", headers)
feed = XML.parse_html(feed.body)
channels = [] of String
@@ -206,7 +166,7 @@ def fetch_user(sid, headers, db)
token = Base64.urlsafe_encode(Random::Secure.random_bytes(32))
user = User.new(Time.now, [] of String, channels, email, CONFIG.default_user_preferences, nil, token, [] of String, true)
user = User.new(Time.utc, [] of String, channels, email, CONFIG.default_user_preferences, nil, token, [] of String, true)
return user, sid
end
@@ -214,7 +174,7 @@ def create_user(sid, email, password)
password = Crypto::Bcrypt::Password.create(password, cost: 10)
token = Base64.urlsafe_encode(Random::Secure.random_bytes(32))
user = User.new(Time.now, [] of String, [] of String, email, CONFIG.default_user_preferences, password.to_s, token, [] of String, true)
user = User.new(Time.utc, [] of String, [] of String, email, CONFIG.default_user_preferences, password.to_s, token, [] of String, true)
return user, sid
end
@@ -235,7 +195,7 @@ def generate_captcha(key, db)
end
clock_svg = <<-END_SVG
<svg viewBox="0 0 100 100" width="200px">
<svg viewBox="0 0 100 100" width="200px" height="200px">
<circle cx="50" cy="50" r="45" fill="#eee" stroke="black" stroke-width="2"></circle>
<text x="69" y="20.091" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 1</text>
@@ -259,7 +219,7 @@ def generate_captcha(key, db)
END_SVG
image = ""
convert = Process.run(%(convert -density 1200 -resize 400x400 -background none svg:- png:-), shell: true,
convert = Process.run(%(rsvg-convert -w 400 -h 400 -b none -f png), shell: true,
input: IO::Memory.new(clock_svg), output: Process::Redirect::Pipe) do |proc|
image = proc.output.gets_to_end
image = Base64.strict_encode(image)
@@ -293,8 +253,7 @@ def subscribe_ajax(channel_id, action, env_headers)
headers = HTTP::Headers.new
headers["Cookie"] = env_headers["Cookie"]
client = make_client(YT_URL)
html = client.get("/subscription_manager?disable_polymer=1", headers)
html = YT_POOL.client &.get("/subscription_manager?disable_polymer=1", headers)
cookies = HTTP::Cookies.from_headers(headers)
html.cookies.each do |cookie|
@@ -314,10 +273,138 @@ def subscribe_ajax(channel_id, action, env_headers)
headers["content-type"] = "application/x-www-form-urlencoded"
post_req = {
"session_token" => session_token,
session_token: session_token,
}
post_url = "/subscription_ajax?#{action}=1&c=#{channel_id}"
client.post(post_url, headers, form: post_req)
YT_POOL.client &.post(post_url, headers, form: post_req)
end
end
# TODO: Playlist stub, sync with YouTube for Google accounts
# def playlist_ajax(video_ids, source_playlist_id, name, privacy, action, env_headers)
# headers = HTTP::Headers.new
# headers["Cookie"] = env_headers["Cookie"]
#
# html = YT_POOL.client &.get("/view_all_playlists?disable_polymer=1", headers)
#
# cookies = HTTP::Cookies.from_headers(headers)
# html.cookies.each do |cookie|
# if {"VISITOR_INFO1_LIVE", "YSC", "SIDCC"}.includes? cookie.name
# if cookies[cookie.name]?
# cookies[cookie.name] = cookie
# else
# cookies << cookie
# end
# end
# end
# headers = cookies.add_request_headers(headers)
#
# if match = html.body.match(/'XSRF_TOKEN': "(?<session_token>[A-Za-z0-9\_\-\=]+)"/)
# session_token = match["session_token"]
#
# headers["content-type"] = "application/x-www-form-urlencoded"
#
# post_req = {
# video_ids: [] of String,
# source_playlist_id: "",
# n: name,
# p: privacy,
# session_token: session_token,
# }
# post_url = "/playlist_ajax?#{action}=1"
#
# response = client.post(post_url, headers, form: post_req)
# if response.status_code == 200
# return JSON.parse(response.body)["result"]["playlistId"].as_s
# else
# return nil
# end
# end
# end
def get_subscription_feed(db, user, max_results = 40, page = 1)
limit = max_results.clamp(0, MAX_ITEMS_PER_PAGE)
offset = (page - 1) * limit
notifications = db.query_one("SELECT notifications FROM users WHERE email = $1", user.email,
as: Array(String))
view_name = "subscriptions_#{sha256(user.email)}"
if user.preferences.notifications_only && !notifications.empty?
# Only show notifications
args = arg_array(notifications)
notifications = db.query_all("SELECT * FROM channel_videos WHERE id IN (#{args}) ORDER BY published DESC", args: notifications, as: ChannelVideo)
videos = [] of ChannelVideo
notifications.sort_by! { |video| video.published }.reverse!
case user.preferences.sort
when "alphabetically"
notifications.sort_by! { |video| video.title }
when "alphabetically - reverse"
notifications.sort_by! { |video| video.title }.reverse!
when "channel name"
notifications.sort_by! { |video| video.author }
when "channel name - reverse"
notifications.sort_by! { |video| video.author }.reverse!
end
else
if user.preferences.latest_only
if user.preferences.unseen_only
# Show latest video from a channel that a user hasn't watched
# "unseen_only" isn't really correct here, more accurate would be "unwatched_only"
if user.watched.empty?
values = "'{}'"
else
values = "VALUES #{user.watched.map { |id| %(('#{id}')) }.join(",")}"
end
videos = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM #{view_name} WHERE NOT id = ANY (#{values}) ORDER BY ucid, published DESC", as: ChannelVideo)
else
# Show latest video from each channel
videos = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM #{view_name} ORDER BY ucid, published DESC", as: ChannelVideo)
end
videos.sort_by! { |video| video.published }.reverse!
else
if user.preferences.unseen_only
# Only show unwatched
if user.watched.empty?
values = "'{}'"
else
values = "VALUES #{user.watched.map { |id| %(('#{id}')) }.join(",")}"
end
videos = PG_DB.query_all("SELECT * FROM #{view_name} WHERE NOT id = ANY (#{values}) ORDER BY published DESC LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
else
# Sort subscriptions as normal
videos = PG_DB.query_all("SELECT * FROM #{view_name} ORDER BY published DESC LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
end
end
case user.preferences.sort
when "published - reverse"
videos.sort_by! { |video| video.published }
when "alphabetically"
videos.sort_by! { |video| video.title }
when "alphabetically - reverse"
videos.sort_by! { |video| video.title }.reverse!
when "channel name"
videos.sort_by! { |video| video.author }
when "channel name - reverse"
videos.sort_by! { |video| video.author }.reverse!
end
notifications = PG_DB.query_one("SELECT notifications FROM users WHERE email = $1", user.email, as: Array(String))
notifications = videos.select { |v| notifications.includes? v.id }
videos = videos - notifications
end
return videos, notifications
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
<% content_for "header" do %>
<title><%= playlist.title %> - Invidious</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/playlist/<%= plid %>" />
<% end %>
<div class="pure-g">
<div class="pure-u-1 pure-u-lg-1-5"></div>
<div class="pure-u-1 pure-u-lg-3-5">
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/add_playlist_items" method="get">
<legend><a href="/playlist?list=<%= playlist.id %>"><%= translate(locale, "Editing playlist `x`", %|"#{HTML.escape(playlist.title)}"|) %></a></legend>
<fieldset>
<input class="pure-input-1" type="search" name="q" <% if query %>value="<%= HTML.escape(query) %>"<% else %>placeholder="<%= translate(locale, "Search for videos") %>"<% end %>>
<input type="hidden" name="list" value="<%= plid %>">
</fieldset>
</form>
</div>
</div>
<div class="pure-u-1 pure-u-lg-1-5"></div>
</div>
<script>
var playlist_data = {
csrf_token: '<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>',
}
</script>
<script src="/js/playlist_widget.js"></script>
<div class="pure-g">
<% videos.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<%= rendered "components/item" %>
<% end %>
<% end %>
</div>
<% if query %>
<div class="pure-g h-box">
<div class="pure-u-1 pure-u-lg-1-5">
<% if page > 1 %>
<a href="/add_playlist_items?list=<%= plid %>&q=<%= HTML.escape(query.not_nil!) %>&page=<%= page - 1 %>">
<%= translate(locale, "Previous page") %>
</a>
<% end %>
</div>
<div class="pure-u-1 pure-u-lg-3-5"></div>
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
<% if count >= 20 %>
<a href="/add_playlist_items?list=<%= plid %>&q=<%= HTML.escape(query.not_nil!) %>&page=<%= page + 1 %>">
<%= translate(locale, "Next page") %>
</a>
<% end %>
</div>
</div>
<% end %>

View File

@@ -72,7 +72,7 @@
<input type="hidden" name="expire" value="<%= expire %>">
<% end %>
<input type="hidden" name="csrf_token" value="<%= URI.escape(csrf_token) %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</form>
</div>
<% end %>

View File

@@ -6,7 +6,7 @@
<div class="pure-u-1 pure-u-lg-1-5"></div>
<div class="pure-u-1 pure-u-lg-3-5">
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/change_password?referer=<%= URI.escape(referer) %>" method="post">
<form class="pure-form pure-form-aligned" action="/change_password?referer=<%= URI.encode_www_form(referer) %>" method="post">
<legend><%= translate(locale, "Change password") %></legend>
<fieldset>
@@ -23,7 +23,7 @@
<%= translate(locale, "Change password") %>
</button>
<input type="hidden" name="csrf_token" value="<%= URI.escape(csrf_token) %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</fieldset>
</form>
</div>

View File

@@ -1,37 +1,61 @@
<% content_for "header" do %>
<title><%= author %> - Invidious</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/channel/<%= ucid %>" />
<title><%= channel.author %> - Invidious</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/channel/<%= channel.ucid %>" />
<% end %>
<% if channel.banner %>
<div class="h-box">
<img style="width:100%" src="/ggpht<%= URI.parse(channel.banner.not_nil!.gsub("=w1060-", "=w1280-")).full_path %>">
</div>
<div class="h-box">
<hr>
</div>
<% end %>
<div class="pure-g h-box">
<div class="pure-u-2-3">
<h3><%= author %></h3>
<div class="channel-profile">
<img src="/ggpht<%= URI.parse(channel.author_thumbnail).full_path %>">
<span><%= channel.author %></span>
</div>
</div>
<div class="pure-u-1-3" style="text-align:right">
<h3>
<a href="/feed/channel/<%= ucid %>"><i class="icon ion-logo-rss"></i></a>
<a href="/feed/channel/<%= channel.ucid %>"><i class="icon ion-logo-rss"></i></a>
</h3>
</div>
</div>
<div class="h-box">
<% sub_count_text = number_to_short_text(sub_count) %>
<p><span style="white-space:pre-wrap"><%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %></span></p>
</div>
<div class="h-box">
<% ucid = channel.ucid %>
<% author = channel.author %>
<% sub_count_text = number_to_short_text(channel.sub_count) %>
<%= rendered "components/subscribe_widget" %>
</div>
<div class="pure-g h-box">
<div class="pure-u-1-3">
<a href="https://www.youtube.com/channel/<%= ucid %>"><%= translate(locale, "View channel on YouTube") %></a>
<% if !auto_generated %>
<a href="https://www.youtube.com/channel/<%= channel.ucid %>"><%= translate(locale, "View channel on YouTube") %></a>
<% if !channel.auto_generated %>
<div class="pure-u-1 pure-md-1-3">
<b><%= translate(locale, "Videos") %></b>
</div>
<% end %>
<div class="pure-u-1 pure-md-1-3">
<% if auto_generated %>
<% if channel.auto_generated %>
<b><%= translate(locale, "Playlists") %></b>
<% else %>
<a href="/channel/<%= ucid %>/playlists"><%= translate(locale, "Playlists") %></a>
<a href="/channel/<%= channel.ucid %>/playlists"><%= translate(locale, "Playlists") %></a>
<% end %>
</div>
<div class="pure-u-1 pure-md-1-3">
<% if channel.tabs.includes? "community" %>
<a href="/channel/<%= channel.ucid %>/community"><%= translate(locale, "Community") %></a>
<% end %>
</div>
</div>
@@ -43,7 +67,7 @@
<% if sort_by == sort %>
<b><%= translate(locale, sort) %></b>
<% else %>
<a href="/channel/<%= ucid %>?page=<%= page %>&sort_by=<%= sort %>">
<a href="/channel/<%= channel.ucid %>?page=<%= page %>&sort_by=<%= sort %>">
<%= translate(locale, sort) %>
</a>
<% end %>
@@ -67,8 +91,8 @@
<div class="pure-g h-box">
<div class="pure-u-1 pure-u-lg-1-5">
<% if page >= 2 %>
<a href="/channel/<%= ucid %>?page=<%= page - 1 %><% if sort_by != "newest" %>&sort_by=<%= sort_by %><% end %>">
<% if page > 1 %>
<a href="/channel/<%= channel.ucid %>?page=<%= page - 1 %><% if sort_by != "newest" %>&sort_by=<%= sort_by %><% end %>">
<%= translate(locale, "Previous page") %>
</a>
<% end %>
@@ -76,7 +100,7 @@
<div class="pure-u-1 pure-u-lg-3-5"></div>
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
<% if count == 60 %>
<a href="/channel/<%= ucid %>?page=<%= page + 1 %><% if sort_by != "newest" %>&sort_by=<%= sort_by %><% end %>">
<a href="/channel/<%= channel.ucid %>?page=<%= page + 1 %><% if sort_by != "newest" %>&sort_by=<%= sort_by %><% end %>">
<%= translate(locale, "Next page") %>
</a>
<% end %>

View File

@@ -3,7 +3,7 @@
<% end %>
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/clear_watch_history?referer=<%= URI.escape(referer) %>" method="post">
<form class="pure-form pure-form-aligned" action="/clear_watch_history?referer=<%= URI.encode_www_form(referer) %>" method="post">
<legend><%= translate(locale, "Clear watch history?") %></legend>
<div class="pure-g">
@@ -13,12 +13,12 @@
</button>
</div>
<div class="pure-u-1-2">
<a class="pure-button" href="<%= URI.escape(referer) %>">
<a class="pure-button" href="<%= URI.encode_www_form(referer) %>">
<%= translate(locale, "No") %>
</a>
</div>
</div>
<input type="hidden" name="csrf_token" value="<%= URI.escape(csrf_token) %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</form>
</div>

View File

@@ -0,0 +1,84 @@
<% content_for "header" do %>
<title><%= channel.author %> - Invidious</title>
<% end %>
<% if channel.banner %>
<div class="h-box">
<img style="width:100%" src="/ggpht<%= URI.parse(channel.banner.not_nil!.gsub("=w1060-", "=w1280-")).full_path %>">
</div>
<div class="h-box">
<hr>
</div>
<% end %>
<div class="pure-g h-box">
<div class="pure-u-2-3">
<div class="channel-profile">
<img src="/ggpht<%= URI.parse(channel.author_thumbnail).full_path %>">
<span><%= channel.author %></span>
</div>
</div>
<div class="pure-u-1-3" style="text-align:right">
<h3>
<a href="/feed/channel/<%= channel.ucid %>"><i class="icon ion-logo-rss"></i></a>
</h3>
</div>
</div>
<div class="h-box">
<p><span style="white-space:pre-wrap"><%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %></span></p>
</div>
<div class="h-box">
<% ucid = channel.ucid %>
<% author = channel.author %>
<% sub_count_text = number_to_short_text(channel.sub_count) %>
<%= rendered "components/subscribe_widget" %>
</div>
<div class="pure-g h-box">
<div class="pure-u-1-3">
<a href="https://www.youtube.com/channel/<%= channel.ucid %>/community"><%= translate(locale, "View channel on YouTube") %></a>
<% if !channel.auto_generated %>
<div class="pure-u-1 pure-md-1-3">
<a href="/channel/<%= channel.ucid %>"><%= translate(locale, "Videos") %></a>
</div>
<% end %>
<div class="pure-u-1 pure-md-1-3">
<a href="/channel/<%= channel.ucid %>/playlists"><%= translate(locale, "Playlists") %></a>
</div>
<div class="pure-u-1 pure-md-1-3">
<% if channel.tabs.includes? "community" %>
<b><%= translate(locale, "Community") %></b>
<% end %>
</div>
</div>
<div class="pure-u-2-3"></div>
</div>
<div class="h-box">
<hr>
</div>
<% if error_message %>
<div class="h-box">
<p><%= error_message %></p>
</div>
<% else %>
<div class="h-box pure-g" id="comments">
<%= template_youtube_comments(items.not_nil!, locale, thin_mode) %>
</div>
<% end %>
<script>
var community_data = {
ucid: '<%= channel.ucid %>',
youtube_comments_text: '<%= HTML.escape(translate(locale, "View YouTube comments")) %>',
comments_text: '<%= HTML.escape(translate(locale, "View `x` comments", "{commentCount}")) %>',
hide_replies_text: '<%= HTML.escape(translate(locale, "Hide replies")) %>',
show_replies_text: '<%= HTML.escape(translate(locale, "Show replies")) %>',
preferences: <%= env.get("preferences").as(Preferences).to_json %>,
}
</script>
<script src="/js/community.js?v=<%= ASSET_COMMIT %>"></script>

View File

@@ -2,9 +2,9 @@
<div class="pure-u-1 pure-u-md-1-4"></div>
<div class="pure-u-1 pure-u-md-1-2">
<div class="pure-g">
<% feed_menu = config.feed_menu.dup %>
<% feed_menu = env.get("preferences").as(Preferences).feed_menu.dup %>
<% if !env.get?("user") %>
<% feed_menu.reject! {|feed| feed == "Subscriptions"} %>
<% feed_menu.reject! {|item| {"Subscriptions", "Playlists"}.includes? item} %>
<% end %>
<% feed_menu.each do |feed| %>
<div class="pure-u-1-2 pure-u-md-1-<%= feed_menu.size %>">

View File

@@ -11,11 +11,11 @@
<p><%= item.author %></p>
</a>
<p><%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %></p>
<p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p>
<% if !item.auto_generated %><p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p><% end %>
<h5><%= item.description_html %></h5>
<% when SearchPlaylist %>
<% when SearchPlaylist, InvidiousPlaylist %>
<% if item.id.starts_with? "RD" %>
<% url = "/mix?list=#{item.id}&continuation=#{item.thumbnail_id}" %>
<% url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").full_path.split("/")[2]}" %>
<% else %>
<% url = "/playlist?list=#{item.id}" %>
<% end %>
@@ -23,7 +23,7 @@
<a style="width:100%" href="<%= url %>">
<% if !env.get("preferences").as(Preferences).thin_mode %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item.thumbnail_id %>/mqdefault.jpg"/>
<img class="thumbnail" src="<%= URI.parse(item.thumbnail || "/").full_path %>"/>
<p class="length"><%= number_with_separator(item.video_count) %> videos</p>
</div>
<% end %>
@@ -35,7 +35,7 @@
</b>
</p>
<% when MixVideo %>
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.mixes[0] %>">
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.rdid %>">
<% if !env.get("preferences").as(Preferences).thin_mode %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
@@ -52,10 +52,23 @@
</b>
</p>
<% when PlaylistVideo %>
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.playlists[0] %>">
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.plid %>">
<% if !env.get("preferences").as(Preferences).thin_mode %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
<% if plid = env.get?("remove_playlist_items") %>
<form onsubmit="return false" action="/playlist_ajax?action_remove_video=1&set_video_id=<%= item.index %>&playlist_id=<%= plid %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
<p class="watched">
<a onclick="remove_playlist_item(this)" data-index="<%= item.index %>" data-plid="<%= plid %>" href="javascript:void(0)">
<button type="submit" style="all:unset">
<i class="icon ion-md-trash"></i>
</button>
</a>
</p>
</form>
<% end %>
<% if item.responds_to?(:live_now) && item.live_now %>
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
<% elsif item.length_seconds != 0 %>
@@ -63,7 +76,7 @@
<% end %>
</div>
<% end %>
<p><%= item.title %></p>
<p><a href="/watch?v=<%= item.id %>"><%= item.title %></a></p>
</a>
<p>
<b>
@@ -72,9 +85,9 @@
</p>
<h5 class="pure-g">
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
<div class="pure-u-2-3"><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></div>
<% elsif Time.now - item.published > 1.minute %>
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.utc %>
<div class="pure-u-2-3"><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %></div>
<% elsif Time.utc - item.published > 1.minute %>
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
<% else %>
<div class="pure-u-2-3"></div>
@@ -91,7 +104,7 @@
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
<% if env.get? "show_watched" %>
<form onsubmit="return false" action="/watch_ajax?action_mark_watched=1&id=<%= item.id %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
<p class="watched">
<a onclick="mark_watched(this)" data-id="<%= item.id %>" href="javascript:void(0)">
<button type="submit" style="all:unset">
@@ -103,6 +116,17 @@
</a>
</p>
</form>
<% elsif plid = env.get? "add_playlist_items" %>
<form onsubmit="return false" action="/playlist_ajax?action_add_video=1&video_id=<%= item.id %>&playlist_id=<%= plid %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
<p class="watched">
<a onclick="add_playlist_item(this)" data-id="<%= item.id %>" data-plid="<%= plid %>" href="javascript:void(0)">
<button type="submit" style="all:unset">
<i class="icon ion-md-add"></i>
</button>
</a>
</p>
</form>
<% end %>
<% if item.responds_to?(:live_now) && item.live_now %>
@@ -121,9 +145,9 @@
</p>
<h5 class="pure-g">
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
<div class="pure-u-2-3"><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></div>
<% elsif Time.now - item.published > 1.minute %>
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.utc %>
<div class="pure-u-2-3"><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %></div>
<% elsif Time.utc - item.published > 1.minute %>
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
<% else %>
<div class="pure-u-2-3"></div>

View File

@@ -1,12 +1,12 @@
<video style="outline:none;width:100%;background-color:#000" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>"
id="player" class="video-js"
id="player" class="video-js player-style-<%= params.player_style %>"
onmouseenter='this["data-title"]=this["title"];this["title"]=""'
onmouseleave='this["title"]=this["data-title"];this["data-title"]=""'
oncontextmenu='this["title"]=this["data-title"]'
<% if params.autoplay %>autoplay<% end %>
<% if params.video_loop %>loop<% end %>
<% if params.controls %>controls<% end %>>
<% if hlsvp %>
<% if hlsvp && !CONFIG.disabled?("livestreams") %>
<source src="<%= hlsvp %>?local=true" type="application/x-mpegURL" label="livestream">
<% else %>
<% if params.listen %>
@@ -43,7 +43,7 @@
var player_data = {
aspect_ratio: '<%= aspect_ratio %>',
title: "<%= video.title.dump_unquoted %>",
description: "<%= HTML.escape(description) %>",
description: "<%= HTML.escape(video.short_description) %>",
thumbnail: "<%= thumbnail %>"
}
</script>

View File

@@ -6,7 +6,6 @@
<script src="/js/video.min.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/videojs-contrib-quality-levels.min.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/videojs-http-source-selector.min.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/videojs.hotkeys.min.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/videojs-markers.min.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/videojs-share.min.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/videojs-vtt-thumbnails.min.js?v=<%= ASSET_COMMIT %>"></script>

View File

@@ -2,7 +2,7 @@
<% if subscriptions.includes? ucid %>
<p>
<form action="/subscription_ajax?action_remove_subscriptions=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
<button data-type="unsubscribe" id="subscribe" class="pure-button pure-button-primary">
<b><input style="all:unset" type="submit" value="<%= translate(locale, "Unsubscribe") %> | <%= sub_count_text %>"></b>
</button>
@@ -11,7 +11,7 @@
<% else %>
<p>
<form action="/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
<button data-type="subscribe" id="subscribe" class="pure-button pure-button-primary">
<b><input style="all:unset" type="submit" value="<%= translate(locale, "Subscribe") %> | <%= sub_count_text %>"></b>
</button>
@@ -24,7 +24,7 @@
ucid: '<%= ucid %>',
author: '<%= HTML.escape(author) %>',
sub_count_text: '<%= HTML.escape(sub_count_text) %>',
csrf_token: '<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>',
csrf_token: '<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>',
subscribe_text: '<%= HTML.escape(translate(locale, "Subscribe")) %>',
unsubscribe_text: '<%= HTML.escape(translate(locale, "Unsubscribe")) %>'
}

View File

@@ -0,0 +1,39 @@
<% content_for "header" do %>
<title><%= translate(locale, "Create playlist") %> - Invidious</title>
<% end %>
<div class="pure-g">
<div class="pure-u-1 pure-u-lg-1-5"></div>
<div class="pure-u-1 pure-u-lg-3-5">
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/create_playlist?referer=<%= URI.encode_www_form(referer) %>" method="post">
<fieldset>
<legend><%= translate(locale, "Create playlist") %></legend>
<div class="pure-control-group">
<label for="title"><%= translate(locale, "Title") %> :</label>
<input required name="title" type="text" placeholder="<%= translate(locale, "Title") %>">
</div>
<div class="pure-control-group">
<label for="privacy"><%= translate(locale, "Playlist privacy") %> :</label>
<select name="privacy" id="privacy">
<% PlaylistPrivacy.names.each do |option| %>
<option value="<%= option %>" <% if option == "Public" %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-controls">
<button type="submit" name="action" value="create_playlist" class="pure-button pure-button-primary">
<%= translate(locale, "Create playlist") %>
</button>
</div>
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</fieldset>
</form>
</div>
</div>
<div class="pure-u-1 pure-u-lg-1-5"></div>
</div>

View File

@@ -3,7 +3,7 @@
<% end %>
<div class="h-box">
<form class="pure-form pure-form-aligned" enctype="multipart/form-data" action="/data_control?referer=<%= URI.escape(referer) %>" method="post">
<form class="pure-form pure-form-aligned" enctype="multipart/form-data" action="/data_control?referer=<%= URI.encode_www_form(referer) %>" method="post">
<fieldset>
<legend><%= translate(locale, "Import") %></legend>

View File

@@ -3,7 +3,7 @@
<% end %>
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/delete_account?referer=<%= URI.escape(referer) %>" method="post">
<form class="pure-form pure-form-aligned" action="/delete_account?referer=<%= URI.encode_www_form(referer) %>" method="post">
<legend><%= translate(locale, "Delete account?") %></legend>
<div class="pure-g">
@@ -13,12 +13,12 @@
</button>
</div>
<div class="pure-u-1-2">
<a class="pure-button" href="<%= URI.escape(referer) %>">
<a class="pure-button" href="<%= URI.encode_www_form(referer) %>">
<%= translate(locale, "No") %>
</a>
</div>
</div>
<input type="hidden" name="csrf_token" value="<%= URI.escape(csrf_token) %>">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</form>
</div>

View File

@@ -0,0 +1,24 @@
<% content_for "header" do %>
<title><%= translate(locale, "Delete playlist") %> - Invidious</title>
<% end %>
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/delete_playlist?list=<%= plid %>&referer=<%= URI.encode_www_form(referer) %>" method="post">
<legend><%= translate(locale, "Delete playlist `x`?", %|"#{HTML.escape(playlist.title)}"|) %></legend>
<div class="pure-g">
<div class="pure-u-1-2">
<button type="submit" name="submit" value="delete_playlist" class="pure-button pure-button-primary">
<%= translate(locale, "Yes") %>
</button>
</div>
<div class="pure-u-1-2">
<a class="pure-button" href="/playlist?list=<%= plid %>">
<%= translate(locale, "No") %>
</a>
</div>
</div>
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</form>
</div>

View File

@@ -0,0 +1,81 @@
<% content_for "header" do %>
<title><%= playlist.title %> - Invidious</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/playlist/<%= plid %>" />
<% end %>
<form class="pure-form" action="/edit_playlist?list=<%= plid %>" method="post">
<div class="pure-g h-box">
<div class="pure-u-2-3">
<h3><input class="pure-input-1" maxlength="150" name="title" type="text" value="<%= playlist.title %>"></h3>
<b>
<%= playlist.author %> |
<%= translate(locale, "`x` videos", "#{playlist.video_count}") %> |
<%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> |
<i class="icon <%= {"ion-md-globe", "ion-ios-unlock", "ion-ios-lock"}[playlist.privacy.value] %>"></i>
<select name="privacy">
<% {"Public", "Unlisted", "Private"}.each do |option| %>
<option value="<%= option %>" <% if option == playlist.privacy.to_s %>selected<% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</b>
</div>
<div class="pure-u-1-3" style="text-align:right">
<h3>
<div class="pure-g user-field">
<div class="pure-u-1-3">
<a href="javascript:void(0)">
<button type="submit" style="all:unset">
<i class="icon ion-md-save"></i>
</button>
</a>
</div>
<div class="pure-u-1-3"><a href="/delete_playlist?list=<%= plid %>"><i class="icon ion-md-trash"></i></a></div>
<div class="pure-u-1-3"><a href="/feed/playlist/<%= plid %>"><i class="icon ion-logo-rss"></i></a></div>
</div>
</h3>
</div>
</div>
<div class="h-box">
<textarea maxlength="5000" name="description" style="margin-top:10px;max-width:100%;height:20vh" class="pure-input-1"><%= playlist.description %></textarea>
</div>
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(csrf_token) %>">
</form>
<% if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email %>
<div class="h-box" style="text-align:right">
<h3>
<a href="/add_playlist_items?list=<%= plid %>"><i class="icon ion-md-add"></i></a>
</h3>
</div>
<% end %>
<div class="h-box">
<hr>
</div>
<div class="pure-g">
<% videos.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<%= rendered "components/item" %>
<% end %>
<% end %>
</div>
<div class="pure-g h-box">
<div class="pure-u-1 pure-u-lg-1-5">
<% if page > 1 %>
<a href="/playlist?list=<%= playlist.id %>&page=<%= page - 1 %>">
<%= translate(locale, "Previous page") %>
</a>
<% end %>
</div>
<div class="pure-u-1 pure-u-lg-3-5"></div>
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
<% if videos.size == 100 %>
<a href="/playlist?list=<%= playlist.id %>&page=<%= page + 1 %>">
<%= translate(locale, "Next page") %>
</a>
<% end %>
</div>
</div>

View File

@@ -6,7 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="thumbnail" content="<%= thumbnail %>">
<%= rendered "components/player_sources" %>
<link rel="stylesheet" href="/css/videojs-overlay.css?v=<%= ASSET_COMMIT %>">
<script src="/js/videojs-overlay.min.js?v=<%= ASSET_COMMIT %>"></script>
<link rel="stylesheet" href="/css/default.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/darktheme.css?v=<%= ASSET_COMMIT %>">
<title><%= HTML.escape(video.title) %> - Invidious</title>
<style>
#player {
@@ -26,11 +29,13 @@
<script>
var video_data = {
id: '<%= video.id %>',
index: '<%= continuation %>',
plid: '<%= plid %>',
length_seconds: '<%= video.info["length_seconds"].to_f %>',
length_seconds: '<%= video.length_seconds.to_f %>',
video_series: <%= video_series.to_json %>,
params: <%= params.to_json %>,
preferences: <%= preferences.to_json %>
preferences: <%= preferences.to_json %>,
premiere_timestamp: <%= video.premiere_timestamp.try &.to_unix || "null" %>
}
</script>

View File

@@ -0,0 +1,8 @@
<% content_for "header" do %>
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
<title>
Invidious
</title>
<% end %>
<%= rendered "components/feed_menu" %>

View File

@@ -20,52 +20,52 @@
<script>
var watched_data = {
csrf_token: '<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>',
csrf_token: '<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>',
}
</script>
<script src="/js/watched_widget.js"></script>
<div class="pure-g">
<% watched.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<div class="pure-u-1 pure-u-md-1-4">
<div class="h-box">
<a style="width:100%" href="/watch?v=<%= item %>">
<% if !env.get("preferences").as(Preferences).thin_mode %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item %>/mqdefault.jpg"/>
<form onsubmit="return false" action="/watch_ajax?action_mark_unwatched=1&id=<%= item %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
<p class="watched">
<a onclick="mark_unwatched(this)" data-id="<%= item %>" href="javascript:void(0)">
<button type="submit" style="all:unset">
<i class="icon ion-md-trash"></i>
</button>
</a>
</p>
</form>
</div>
<p></p>
<% end %>
</a>
<% watched.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<div class="pure-u-1 pure-u-md-1-4">
<div class="h-box">
<a style="width:100%" href="/watch?v=<%= item %>">
<% if !env.get("preferences").as(Preferences).thin_mode %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item %>/mqdefault.jpg"/>
<form onsubmit="return false" action="/watch_ajax?action_mark_unwatched=1&id=<%= item %>&referer=<%= env.get("current_page") %>" method="post">
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
<p class="watched">
<a onclick="mark_unwatched(this)" data-id="<%= item %>" href="javascript:void(0)">
<button type="submit" style="all:unset">
<i class="icon ion-md-trash"></i>
</button>
</a>
</p>
</form>
</div>
<p></p>
<% end %>
</a>
</div>
</div>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<div class="pure-g h-box">
<div class="pure-u-1 pure-u-lg-1-5">
<% if page >= 2 %>
<a href="/feed/history?page=<%= page - 1 %>">
<% if page > 1 %>
<a href="/feed/history?page=<%= page - 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
<%= translate(locale, "Previous page") %>
</a>
<% end %>
</div>
<div class="pure-u-1 pure-u-lg-3-5"></div>
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
<% if watched.size >= limit %>
<a href="/feed/history?page=<%= page + 1 %>">
<% if watched.size >= max_results %>
<a href="/feed/history?page=<%= page + 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
<%= translate(locale, "Next page") %>
</a>
<% end %>

View File

@@ -9,6 +9,20 @@
<body>
<h1><%= translate(locale, "JavaScript license information") %></h1>
<table id="jslicense-labels1">
<tr>
<td>
<a href="/js/community.js?v=<%= ASSET_COMMIT %>">community.js</a>
</td>
<td>
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
</td>
<td>
<a href="/js/community.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
</td>
</tr>
<tr>
<td>
<a href="/js/embed.js?v=<%= ASSET_COMMIT %>">embed.js</a>
@@ -71,7 +85,7 @@
</td>
<td>
<a href="http://www.jclark.com/xml/copying.txt">Expat</a>
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a>
</td>
<td>
@@ -121,20 +135,6 @@
</td>
</tr>
<tr>
<td>
<a href="/js/videojs.hotkeys.min.js?v=<%= ASSET_COMMIT %>">videojs.hotkeys.min.js</a>
</td>
<td>
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a>
</td>
<td>
<a href="https://github.com/ctd1500/videojs-hotkeys"><%= translate(locale, "source") %></a>
</td>
</tr>
<tr>
<td>
<a href="/js/videojs-http-source-selector.min.js?v=<%= ASSET_COMMIT %>">videojs-http-source-selector.min.js</a>
@@ -163,6 +163,20 @@
</td>
</tr>
<tr>
<td>
<a href="/js/videojs-overlay.min.js?v=<%= ASSET_COMMIT %>">videojs-overlay.min.js</a>
</td>
<td>
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a>
</td>
<td>
<a href="https://github.com/brightcove/videojs-overlay"><%= translate(locale, "source") %></a>
</td>
</tr>
<tr>
<td>
<a href="/js/videojs-share.min.js?v=<%= ASSET_COMMIT %>">videojs-share.min.js</a>

Some files were not shown because too many files have changed in this diff Show More