mirror of
https://github.com/iv-org/invidious.git
synced 2025-12-23 20:40:17 +00:00
Compare commits
206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e2a65a5ce | ||
|
|
fea20ea913 | ||
|
|
5b2480fff2 | ||
|
|
b0dca2a363 | ||
|
|
59bbe72798 | ||
|
|
f99a30a57e | ||
|
|
aa4cb29621 | ||
|
|
91ad4e396b | ||
|
|
351e17aacf | ||
|
|
6c8e09acdb | ||
|
|
1a7b341745 | ||
|
|
af592ea8c1 | ||
|
|
bb096a0357 | ||
|
|
3c226892c6 | ||
|
|
47f6fe069a | ||
|
|
aa3c1d930b | ||
|
|
99b0b4f5b8 | ||
|
|
bcd239ac2b | ||
|
|
2cc25b1e6e | ||
|
|
5fd3ed782f | ||
|
|
c34a24b633 | ||
|
|
775612ec5a | ||
|
|
fd43b16213 | ||
|
|
5a455ec4f7 | ||
|
|
1277c3d156 | ||
|
|
8033d1ca6d | ||
|
|
28df6881a7 | ||
|
|
e5fa5df7be | ||
|
|
f7dbf2bdd4 | ||
|
|
857c57daba | ||
|
|
5515da3c2d | ||
|
|
cfc111f855 | ||
|
|
3dd4043827 | ||
|
|
351ecfae0f | ||
|
|
b22393092b | ||
|
|
1485ee8027 | ||
|
|
60826c2d0c | ||
|
|
fb383458d7 | ||
|
|
196ee1aa8b | ||
|
|
2df97cd2f5 | ||
|
|
501b523680 | ||
|
|
6efa6691b1 | ||
|
|
c47f1ae236 | ||
|
|
aac240fe41 | ||
|
|
041debcd93 | ||
|
|
0632a2d3c8 | ||
|
|
9f40b3a873 | ||
|
|
8fad0af935 | ||
|
|
48ad744ebf | ||
|
|
556d5b0ca5 | ||
|
|
e30d70b6d4 | ||
|
|
a58f5a925a | ||
|
|
a3cc3c57fd | ||
|
|
0d0d3edeae | ||
|
|
dd0be7c522 | ||
|
|
9d2982fcd7 | ||
|
|
ebfd7d2153 | ||
|
|
818cd2454d | ||
|
|
b31d1c06f5 | ||
|
|
6cd884555c | ||
|
|
47ef74a1bb | ||
|
|
cc6d6ddd66 | ||
|
|
6a6cf015a6 | ||
|
|
ca79e81b39 | ||
|
|
a9e86cecf5 | ||
|
|
5773b1c3e5 | ||
|
|
b562b3410b | ||
|
|
f6440e9830 | ||
|
|
e43636e1e9 | ||
|
|
6783bf9903 | ||
|
|
807723c5b2 | ||
|
|
d3c4936116 | ||
|
|
bbb40aef51 | ||
|
|
485a3e29e7 | ||
|
|
1477f99c2c | ||
|
|
2e1f9d5fa9 | ||
|
|
9dea251862 | ||
|
|
17edfd6573 | ||
|
|
458e9d6cc7 | ||
|
|
485459b8b2 | ||
|
|
fcf377d26b | ||
|
|
3be1c9261f | ||
|
|
38600b3347 | ||
|
|
62f7f7a689 | ||
|
|
552f616305 | ||
|
|
a3164177f8 | ||
|
|
fa6bf21cd1 | ||
|
|
eecf76c1fb | ||
|
|
d1635cf24e | ||
|
|
b43e9ed7e7 | ||
|
|
12b2ab5da8 | ||
|
|
1c9085556c | ||
|
|
9122f8acee | ||
|
|
ef8c9f093c | ||
|
|
801dffd571 | ||
|
|
0b1c57b39f | ||
|
|
2febc268f7 | ||
|
|
58995bb3a2 | ||
|
|
8c944815bc | ||
|
|
f065a21542 | ||
|
|
27e032d10d | ||
|
|
ab3980cd38 | ||
|
|
1db648a525 | ||
|
|
ce3b5b683d | ||
|
|
9d23f1298d | ||
|
|
3f791b65b5 | ||
|
|
317d8703ca | ||
|
|
fda619f704 | ||
|
|
e4a0669da8 | ||
|
|
89725df3dc | ||
|
|
51799844c9 | ||
|
|
48de136e9d | ||
|
|
cb6f97a831 | ||
|
|
7e0cd0ab60 | ||
|
|
8521f04087 | ||
|
|
8ba45808be | ||
|
|
d876fd7f5b | ||
|
|
352e409a6e | ||
|
|
d6ec441c8e | ||
|
|
d197497349 | ||
|
|
d892ba6aa5 | ||
|
|
84b2583973 | ||
|
|
108648b427 | ||
|
|
71bf8b6b4d | ||
|
|
576067c1e5 | ||
|
|
e23bab0103 | ||
|
|
4e111c84f3 | ||
|
|
8cecce7570 | ||
|
|
0338fd42e1 | ||
|
|
b3788bc143 | ||
|
|
18d66ddded | ||
|
|
701b5ea561 | ||
|
|
86d0de4b0e | ||
|
|
a95958f9f6 | ||
|
|
69ab236f3f | ||
|
|
4cf3c6a616 | ||
|
|
da48bbf312 | ||
|
|
ac957db6d1 | ||
|
|
64464f23ae | ||
|
|
52cb239194 | ||
|
|
efd54b7523 | ||
|
|
2aca57cb82 | ||
|
|
d68baf08cb | ||
|
|
a7578aa709 | ||
|
|
a8261d376a | ||
|
|
fc346b4efd | ||
|
|
ad09e734da | ||
|
|
a674fea1c2 | ||
|
|
9e22b34fac | ||
|
|
fe24408620 | ||
|
|
c07ad0941c | ||
|
|
2f02b38b62 | ||
|
|
3ac766530d | ||
|
|
de77c71042 | ||
|
|
9c854a1757 | ||
|
|
f66fa1150e | ||
|
|
f820706e4f | ||
|
|
29e9e0f2cc | ||
|
|
2933093e17 | ||
|
|
71cd8918be | ||
|
|
c049ba59ff | ||
|
|
51c5f28443 | ||
|
|
bb1ed902a9 | ||
|
|
b016a60a75 | ||
|
|
890d485bb5 | ||
|
|
208bb2d72f | ||
|
|
267bf289c4 | ||
|
|
b3e083d866 | ||
|
|
a675c64c2d | ||
|
|
8b50c8515f | ||
|
|
1eaa377583 | ||
|
|
4345b1d930 | ||
|
|
06bf0c2622 | ||
|
|
3ac8de0a64 | ||
|
|
f237fd9847 | ||
|
|
5730280325 | ||
|
|
ab4df7e078 | ||
|
|
b52e6c99ab | ||
|
|
7dab548522 | ||
|
|
785c341822 | ||
|
|
7d2e1f63b5 | ||
|
|
e119459411 | ||
|
|
97ef2191fd | ||
|
|
e833ccf309 | ||
|
|
a4134d30fa | ||
|
|
6069fd02d3 | ||
|
|
bb15dc57a4 | ||
|
|
bdfe170c3b | ||
|
|
0fa2ba53ab | ||
|
|
4bb657debf | ||
|
|
dd12840e34 | ||
|
|
b027dcfec9 | ||
|
|
9e9b6f1542 | ||
|
|
7cd66e20d0 | ||
|
|
d93df15eff | ||
|
|
ddfd20d997 | ||
|
|
fd8af88493 | ||
|
|
bfa488f77d | ||
|
|
03be793930 | ||
|
|
37d88d5ff7 | ||
|
|
4616f889fd | ||
|
|
59cbf95c4f | ||
|
|
058711d3a8 | ||
|
|
2ddc61fa5c | ||
|
|
e04b7d0f01 | ||
|
|
2faa2ed1f4 |
126
CHANGELOG.md
126
CHANGELOG.md
@@ -1,3 +1,129 @@
|
||||
# 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
|
||||
|
||||
Hope everyone has been doing well. This past month there have been [97 commits](https://github.com/omarroth/invidious/compare/0.17.0...0.18.0) from 10 contributors. For the most part changes this month have been on optimizing various parts of the site, mainly subscription feeds and support for serving images and other assets.
|
||||
|
||||
I'm quite happy to mention that support for Greek (`el`) has been added, which I hope will continue to make the site accessible for more users.
|
||||
|
||||
Subscription feeds will now only update when necessary, rather than periodically. This greatly lightens the load on DB as well as making the feeds generally more responsive when changing subscriptions, importing data, and when receiving new uploads.
|
||||
|
||||
Caching for images and other assets should be greatly improved with [#456](https://github.com/omarroth/invidious/issues/456). JavaScript has been pulled out into separate files where possible to take advantage of this, which should result in lighter pages and faster load times.
|
||||
|
||||
This past month several people have encountered issues with downloads and watching high quality video through the site, see [#532](https://github.com/omarroth/invidious/issues/532) and [#562](https://github.com/omarroth/invidious/issues/562). For this coming month I've allocated some more hardware which should help with this, and I'm also looking into optimizing how videos are currently served.
|
||||
|
||||
## For Developers
|
||||
|
||||
`viewCount` is now available for `/api/v1/popular` and all videos returned from `/api/v1/auth/notifications`. Both also now provide `"type"` for indicating available information for each object.
|
||||
|
||||
An `/authorize_token` page is now available for more easily creating new tokens for use in applications, see [this comment](https://github.com/omarroth/invidious/issues/473#issuecomment-496230812) in [#473](https://github.com/omarroth/invidious/issues/473) for more details.
|
||||
|
||||
A POST `/api/v1/auth/notifications` endpoint is also now available for correctly returning notifications for 150+ channels.
|
||||
|
||||
## For Administrators
|
||||
|
||||
There are two new schema changes for administrators: `views` for adding view count to the popular page, and `feed_needs_update` for tracking feed changes.
|
||||
|
||||
As always the relevant migration scripts are provided which should run when following instructions for [updating](https://github.com/omarroth/invidious/wiki/Updating). Otherwise, adding `check_tables: true` to your config will automatically make the required changes.
|
||||
|
||||
## Native Notifications
|
||||
|
||||
[<img src="https://omar.yt/81c3ae1839831bd9300d75e273b6552a86dc2352/native_notification.png" height="160" width="472">](https://omar.yt/81c3ae1839831bd9300d75e273b6552a86dc2352/native_notification.png "Example of native notification, available in repository under screnshots/native_notification.png")
|
||||
|
||||
It is now possible to receive [Web notifications](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API) from subscribed channels.
|
||||
|
||||
You can enable notifications by clicking "Enable web notifications" in your preferences. Generally they appear within 20-60 seconds of a new video being uploaded, and I've found them to be an enormous quality of life improvement.
|
||||
|
||||
Although it has been fairly stable, please feel free to report any issues you find [here](https://github.com/omarroth/invidious/issues) or emailing me directly at omarroth@protonmail.com.
|
||||
|
||||
Important to note for administrators is that instances require [`use_pubsub_feeds`](https://github.com/omarroth/invidious/wiki/Configuration) and must be served over HTTPS in order to correctly send web notifications.
|
||||
|
||||
## Finances
|
||||
|
||||
### Donations
|
||||
|
||||
- [Patreon](https://www.patreon.com/omarroth) : \$49.73
|
||||
- [Liberapay](https://liberapay.com/omarroth) : \$100.57
|
||||
- Crypto : ~\$11.12 (converted from BCH, BTC)
|
||||
- Total : \$161.42
|
||||
|
||||
### 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-db1 (s-4vcpu-8gb) : \$40.00 (database)
|
||||
- Total : \$85.00
|
||||
|
||||
See you all next month!
|
||||
|
||||
# 0.17.0 (2019-05-06)
|
||||
|
||||
# Version 0.17.0: Player and Authentication API
|
||||
|
||||
14
README.md
14
README.md
@@ -27,12 +27,16 @@ 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
|
||||
|
||||
@@ -201,7 +205,7 @@ $ ./sentry
|
||||
## Made with Invidious
|
||||
|
||||
- [FreeTube](https://github.com/FreeTubeApp/FreeTube): An Open Source YouTube app for privacy.
|
||||
- [CloudTube](https://github.com/cloudrac3r/cadencegq): Website featuring pastebin, image host, and YouTube player
|
||||
- [CloudTube](https://cadence.moe/cloudtube/subscriptions): A JS-rich alternate YouTube player
|
||||
- [PeerTubeify](https://gitlab.com/Ealhad/peertubeify): On YouTube, displays a link to the same video on PeerTube, if it exists.
|
||||
- [MusicPiped](https://github.com/deep-gaurav/MusicPiped): A materialistic music player that streams music from YouTube.
|
||||
|
||||
|
||||
@@ -2,6 +2,17 @@
|
||||
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;
|
||||
@@ -222,6 +233,11 @@ input[type="search"]::-webkit-search-cancel-button {
|
||||
.navbar > .searchbar > form {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.25em;
|
||||
margin: 0.42em 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 320px) {
|
||||
@@ -265,6 +281,16 @@ input[type="search"]::-webkit-search-cancel-button {
|
||||
}
|
||||
}
|
||||
|
||||
.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,
|
||||
@@ -327,6 +353,11 @@ input[type="search"]::-webkit-search-cancel-button {
|
||||
background-color: rgba(15, 15, 15, 0.5);
|
||||
}
|
||||
|
||||
fieldset > select,
|
||||
span > select {
|
||||
color: rgba(49, 49, 51, 1);
|
||||
}
|
||||
|
||||
.video-js .vjs-load-progress,
|
||||
.video-js .vjs-load-progress div {
|
||||
background: rgba(87, 87, 88, 1);
|
||||
@@ -341,6 +372,12 @@ input[type="search"]::-webkit-search-cancel-button {
|
||||
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);
|
||||
|
||||
1
assets/css/videojs-overlay.css
Normal file
1
assets/css/videojs-overlay.css
Normal 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}
|
||||
101
assets/js/community.js
Normal file
101
assets/js/community.js
Normal 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();
|
||||
}
|
||||
94
assets/js/embed.js
Normal file
94
assets/js/embed.js
Normal file
@@ -0,0 +1,94 @@
|
||||
function get_playlist(plid, retries = 5) {
|
||||
if (retries <= 0) {
|
||||
console.log('Failed to pull playlist');
|
||||
return;
|
||||
}
|
||||
|
||||
if (plid.startsWith('RD')) {
|
||||
var plid_url = '/api/v1/mixes/' + plid +
|
||||
'?continuation=' + video_data.id +
|
||||
'&format=html&hl=' + video_data.preferences.locale;
|
||||
} else {
|
||||
var plid_url = '/api/v1/playlists/' + plid +
|
||||
'?continuation=' + video_data.id +
|
||||
'&format=html&hl=' + video_data.preferences.locale;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 10000;
|
||||
xhr.open('GET', plid_url, true);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
if (xhr.response.nextVideo) {
|
||||
player.on('ended', function () {
|
||||
var url = new URL('https://example.com/embed/' + xhr.response.nextVideo);
|
||||
|
||||
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('list', plid);
|
||||
location.assign(url.pathname + url.search);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (video_data.video_series.length !== 0) {
|
||||
url.searchParams.set('playlist', video_data.video_series.join(','))
|
||||
}
|
||||
|
||||
location.assign(url.pathname + url.search);
|
||||
});
|
||||
}
|
||||
139
assets/js/notifications.js
Normal file
139
assets/js/notifications.js
Normal file
@@ -0,0 +1,139 @@
|
||||
var notifications, delivered;
|
||||
|
||||
function get_subscriptions(callback, retries = 5) {
|
||||
if (retries <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
notifications = new SSE(
|
||||
'/api/v1/auth/notifications?fields=videoId,title,author,authorId,publishedText,published,authorThumbnails,liveNow', {
|
||||
withCredentials: true,
|
||||
payload: 'topics=' + subscriptions.map(function (subscription) { return subscription.authorId }).join(','),
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
});
|
||||
delivered = [];
|
||||
|
||||
var start_time = Math.round(new Date() / 1000);
|
||||
|
||||
notifications.onmessage = function (event) {
|
||||
if (!event.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
var notification = JSON.parse(event.data);
|
||||
console.log('Got notification:', notification);
|
||||
|
||||
if (start_time < notification.published && !delivered.includes(notification.videoId)) {
|
||||
if (Notification.permission === 'granted') {
|
||||
var system_notification =
|
||||
new Notification((notification.liveNow ? notification_data.live_now_text : notification_data.upload_text).replace('`x`', notification.author), {
|
||||
body: notification.title,
|
||||
icon: '/ggpht' + new URL(notification.authorThumbnails[2].url).pathname,
|
||||
img: '/ggpht' + new URL(notification.authorThumbnails[4].url).pathname,
|
||||
tag: notification.videoId
|
||||
});
|
||||
|
||||
system_notification.onclick = function (event) {
|
||||
window.open('/watch?v=' + event.currentTarget.tag, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
delivered.push(notification.videoId);
|
||||
localStorage.setItem('notification_count', parseInt(localStorage.getItem('notification_count') || '0') + 1);
|
||||
var notification_ticker = document.getElementById('notification_ticker');
|
||||
|
||||
if (parseInt(localStorage.getItem('notification_count')) > 0) {
|
||||
notification_ticker.innerHTML =
|
||||
'<span id="notification_count">' + localStorage.getItem('notification_count') + '</span> <i class="icon ion-ios-notifications"></i>';
|
||||
} else {
|
||||
notification_ticker.innerHTML =
|
||||
'<i class="icon ion-ios-notifications-outline"></i>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
if (localStorage.getItem('stream')) {
|
||||
localStorage.removeItem('stream');
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
if (!localStorage.getItem('stream')) {
|
||||
notifications = { close: function () { } };
|
||||
localStorage.setItem('stream', true);
|
||||
get_subscriptions(create_notification_stream);
|
||||
}
|
||||
}, Math.random() * 1000 + 50);
|
||||
}
|
||||
|
||||
window.addEventListener('storage', function (e) {
|
||||
if (e.key === 'stream' && !e.newValue) {
|
||||
if (notifications) {
|
||||
localStorage.setItem('stream', true);
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
if (!localStorage.getItem('stream')) {
|
||||
notifications = { close: function () { } };
|
||||
localStorage.setItem('stream', true);
|
||||
get_subscriptions(create_notification_stream);
|
||||
}
|
||||
}, Math.random() * 1000 + 50);
|
||||
}
|
||||
} else if (e.key === 'notification_count') {
|
||||
var notification_ticker = document.getElementById('notification_ticker');
|
||||
|
||||
if (parseInt(e.newValue) > 0) {
|
||||
notification_ticker.innerHTML =
|
||||
'<span id="notification_count">' + e.newValue + '</span> <i class="icon ion-ios-notifications"></i>';
|
||||
} else {
|
||||
notification_ticker.innerHTML =
|
||||
'<i class="icon ion-ios-notifications-outline"></i>';
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('unload', function (e) {
|
||||
if (notifications) {
|
||||
localStorage.removeItem('stream');
|
||||
}
|
||||
});
|
||||
258
assets/js/player.js
Normal file
258
assets/js/player.js
Normal file
@@ -0,0 +1,258 @@
|
||||
var options = {
|
||||
preload: 'auto',
|
||||
liveui: true,
|
||||
playbackRates: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0],
|
||||
controlBar: {
|
||||
children: [
|
||||
'playToggle',
|
||||
'volumePanel',
|
||||
'currentTimeDisplay',
|
||||
'timeDivider',
|
||||
'durationDisplay',
|
||||
'progressControl',
|
||||
'remainingTimeDisplay',
|
||||
'captionsButton',
|
||||
'qualitySelector',
|
||||
'playbackRateMenuButton',
|
||||
'fullscreenToggle'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (player_data.aspect_ratio) {
|
||||
options.aspectRatio = player_data.aspect_ratio;
|
||||
}
|
||||
|
||||
var embed_url = new URL(location);
|
||||
embed_url.searchParams.delete('v');
|
||||
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'],
|
||||
|
||||
url: short_url,
|
||||
title: player_data.title,
|
||||
description: player_data.description,
|
||||
image: player_data.thumbnail,
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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) {
|
||||
setInterval(setTimeout(function (event) {
|
||||
console.log('An error occured in the player, reloading...');
|
||||
|
||||
var currentTime = player.currentTime();
|
||||
var playbackRate = player.playbackRate();
|
||||
var paused = player.paused();
|
||||
|
||||
player.load();
|
||||
|
||||
if (currentTime > 0.5) {
|
||||
currentTime -= 0.5;
|
||||
}
|
||||
|
||||
player.currentTime(currentTime);
|
||||
player.playbackRate(playbackRate);
|
||||
|
||||
if (!paused) {
|
||||
player.play();
|
||||
}
|
||||
}, 5000), 5000);
|
||||
}
|
||||
});
|
||||
|
||||
// Add markers
|
||||
if (video_data.params.video_start > 0 || video_data.params.video_end > 0) {
|
||||
var markers = [{ time: video_data.params.video_start, text: 'Start' }];
|
||||
|
||||
if (video_data.params.video_end < 0) {
|
||||
markers.push({ time: video_data.length_seconds - 0.5, text: 'End' });
|
||||
} else {
|
||||
markers.push({ time: video_data.params.video_end, text: 'End' });
|
||||
}
|
||||
|
||||
player.markers({
|
||||
onMarkerReached: function (marker) {
|
||||
if (marker.text === 'End') {
|
||||
if (player.loop()) {
|
||||
player.markers.prev('Start');
|
||||
} else {
|
||||
player.pause();
|
||||
}
|
||||
}
|
||||
},
|
||||
markers: markers
|
||||
});
|
||||
|
||||
player.currentTime(video_data.params.video_start);
|
||||
}
|
||||
|
||||
player.volume(video_data.params.volume / 100);
|
||||
player.playbackRate(video_data.params.speed);
|
||||
|
||||
player.on('waiting', function () {
|
||||
if (player.playbackRate() > 1 && player.liveTracker.isLive() && player.liveTracker.atLiveEdge()) {
|
||||
console.log('Player has caught up to source, resetting playbackRate.')
|
||||
player.playbackRate(1);
|
||||
}
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
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 (!video_data.params.listen && video_data.params.quality === 'dash') {
|
||||
player.httpSourceSelector();
|
||||
}
|
||||
|
||||
player.vttThumbnails({
|
||||
src: location.origin + '/api/v1/storyboards/' + video_data.id + '?height=90'
|
||||
});
|
||||
|
||||
// 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.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);
|
||||
|
||||
if (path.href.startsWith('https://www.youtube.com/watch?') && seconds) {
|
||||
path.search += '&t=' + seconds;
|
||||
}
|
||||
|
||||
path = path.pathname + path.search;
|
||||
|
||||
if (target === 'current') {
|
||||
window.location.href = path;
|
||||
} else if (target === 'new') {
|
||||
window.open(path, '_blank');
|
||||
}
|
||||
});
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
// Since videojs-share can sometimes be blocked, we defer it until last
|
||||
player.share(shareOptions);
|
||||
200
assets/js/sse.js
Normal file
200
assets/js/sse.js
Normal file
@@ -0,0 +1,200 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Maxime Petazzoni <maxime.petazzoni@bulix.org>.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var SSE = function (url, options) {
|
||||
if (!(this instanceof SSE)) {
|
||||
return new SSE(url, options);
|
||||
}
|
||||
|
||||
this.INITIALIZING = -1;
|
||||
this.CONNECTING = 0;
|
||||
this.OPEN = 1;
|
||||
this.CLOSED = 2;
|
||||
|
||||
this.url = url;
|
||||
|
||||
options = options || {};
|
||||
this.headers = options.headers || {};
|
||||
this.payload = options.payload !== undefined ? options.payload : '';
|
||||
this.method = options.method || (this.payload && 'POST' || 'GET');
|
||||
|
||||
this.FIELD_SEPARATOR = ':';
|
||||
this.listeners = {};
|
||||
|
||||
this.xhr = null;
|
||||
this.readyState = this.INITIALIZING;
|
||||
this.progress = 0;
|
||||
this.chunk = '';
|
||||
|
||||
this.addEventListener = function(type, listener) {
|
||||
if (this.listeners[type] === undefined) {
|
||||
this.listeners[type] = [];
|
||||
}
|
||||
|
||||
if (this.listeners[type].indexOf(listener) === -1) {
|
||||
this.listeners[type].push(listener);
|
||||
}
|
||||
};
|
||||
|
||||
this.removeEventListener = function(type, listener) {
|
||||
if (this.listeners[type] === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var filtered = [];
|
||||
this.listeners[type].forEach(function(element) {
|
||||
if (element !== listener) {
|
||||
filtered.push(element);
|
||||
}
|
||||
});
|
||||
if (filtered.length === 0) {
|
||||
delete this.listeners[type];
|
||||
} else {
|
||||
this.listeners[type] = filtered;
|
||||
}
|
||||
};
|
||||
|
||||
this.dispatchEvent = function(e) {
|
||||
if (!e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
e.source = this;
|
||||
|
||||
var onHandler = 'on' + e.type;
|
||||
if (this.hasOwnProperty(onHandler)) {
|
||||
this[onHandler].call(this, e);
|
||||
if (e.defaultPrevented) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.listeners[e.type]) {
|
||||
return this.listeners[e.type].every(function(callback) {
|
||||
callback(e);
|
||||
return !e.defaultPrevented;
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
this._setReadyState = function (state) {
|
||||
var event = new CustomEvent('readystatechange');
|
||||
event.readyState = state;
|
||||
this.readyState = state;
|
||||
this.dispatchEvent(event);
|
||||
};
|
||||
|
||||
this._onStreamFailure = function(e) {
|
||||
this.dispatchEvent(new CustomEvent('error'));
|
||||
this.close();
|
||||
}
|
||||
|
||||
this._onStreamProgress = function(e) {
|
||||
if (this.xhr.status !== 200 && this.readyState !== this.CLOSED) {
|
||||
this._onStreamFailure(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.readyState == this.CONNECTING) {
|
||||
this.dispatchEvent(new CustomEvent('open'));
|
||||
this._setReadyState(this.OPEN);
|
||||
}
|
||||
|
||||
var data = this.xhr.responseText.substring(this.progress);
|
||||
this.progress += data.length;
|
||||
data.split(/(\r\n|\r|\n){2}/g).forEach(function(part) {
|
||||
if (part.trim().length === 0) {
|
||||
this.dispatchEvent(this._parseEventChunk(this.chunk.trim()));
|
||||
this.chunk = '';
|
||||
} else {
|
||||
this.chunk += part;
|
||||
}
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
this._onStreamLoaded = function(e) {
|
||||
this._onStreamProgress(e);
|
||||
|
||||
// Parse the last chunk.
|
||||
this.dispatchEvent(this._parseEventChunk(this.chunk));
|
||||
this.chunk = '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse a received SSE event chunk into a constructed event object.
|
||||
*/
|
||||
this._parseEventChunk = function(chunk) {
|
||||
if (!chunk || chunk.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var e = {'id': null, 'retry': null, 'data': '', 'event': 'message'};
|
||||
chunk.split(/\n|\r\n|\r/).forEach(function(line) {
|
||||
line = line.trimRight();
|
||||
var index = line.indexOf(this.FIELD_SEPARATOR);
|
||||
if (index <= 0) {
|
||||
// Line was either empty, or started with a separator and is a comment.
|
||||
// Either way, ignore.
|
||||
return;
|
||||
}
|
||||
|
||||
var field = line.substring(0, index);
|
||||
if (!(field in e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var value = line.substring(index + 1).trimLeft();
|
||||
if (field === 'data') {
|
||||
e[field] += value;
|
||||
} else {
|
||||
e[field] = value;
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
var event = new CustomEvent(e.event);
|
||||
event.data = e.data;
|
||||
event.id = e.id;
|
||||
return event;
|
||||
};
|
||||
|
||||
this._checkStreamClosed = function() {
|
||||
if (this.xhr.readyState === XMLHttpRequest.DONE) {
|
||||
this._setReadyState(this.CLOSED);
|
||||
}
|
||||
};
|
||||
|
||||
this.stream = function() {
|
||||
this._setReadyState(this.CONNECTING);
|
||||
|
||||
this.xhr = new XMLHttpRequest();
|
||||
this.xhr.addEventListener('progress', this._onStreamProgress.bind(this));
|
||||
this.xhr.addEventListener('load', this._onStreamLoaded.bind(this));
|
||||
this.xhr.addEventListener('readystatechange', this._checkStreamClosed.bind(this));
|
||||
this.xhr.addEventListener('error', this._onStreamFailure.bind(this));
|
||||
this.xhr.addEventListener('abort', this._onStreamFailure.bind(this));
|
||||
this.xhr.open(this.method, this.url);
|
||||
for (var header in this.headers) {
|
||||
this.xhr.setRequestHeader(header, this.headers[header]);
|
||||
}
|
||||
this.xhr.send(this.payload);
|
||||
};
|
||||
|
||||
this.close = function() {
|
||||
if (this.readyState === this.CLOSED) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.xhr.abort();
|
||||
this.xhr = null;
|
||||
this._setReadyState(this.CLOSED);
|
||||
};
|
||||
};
|
||||
|
||||
// Export our SSE module for npm.js
|
||||
if (typeof exports !== 'undefined') {
|
||||
exports.SSE = SSE;
|
||||
}
|
||||
@@ -7,21 +7,19 @@ 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;
|
||||
}
|
||||
|
||||
var url = '/subscription_ajax?action_create_subscription_to_channel=1&redirect=false' +
|
||||
'&c=' + subscribe_data.ucid +
|
||||
'&referer=' + location.pathname + location.search;
|
||||
'&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;
|
||||
@@ -36,27 +34,32 @@ function subscribe(timeouts = 0) {
|
||||
}
|
||||
}
|
||||
|
||||
xhr.onerror = function () {
|
||||
console.log('Subscribing failed... ' + retries + '/5');
|
||||
setTimeout(function () { subscribe(retries - 1) }, 1000);
|
||||
}
|
||||
|
||||
xhr.ontimeout = function () {
|
||||
console.log('Subscribing timed out.');
|
||||
subscribe(timeouts + 1);
|
||||
};
|
||||
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;
|
||||
}
|
||||
|
||||
var url = '/subscription_ajax?action_remove_subscriptions=1&redirect=false' +
|
||||
'&c=' + subscribe_data.ucid +
|
||||
'&referer=' + location.pathname + location.search;
|
||||
'&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;
|
||||
@@ -71,8 +74,15 @@ function unsubscribe(timeouts = 0) {
|
||||
}
|
||||
}
|
||||
|
||||
xhr.onerror = function () {
|
||||
console.log('Unsubscribing failed... ' + retries + '/5');
|
||||
setTimeout(function () { unsubscribe(retries - 1) }, 1000);
|
||||
}
|
||||
|
||||
xhr.ontimeout = function () {
|
||||
console.log('Unsubscribing timed out.');
|
||||
unsubscribe(timeouts + 1);
|
||||
};
|
||||
console.log('Unsubscribing failed... ' + retries + '/5');
|
||||
unsubscribe(retries - 1);
|
||||
}
|
||||
|
||||
xhr.send('csrf_token=' + subscribe_data.csrf_token);
|
||||
}
|
||||
|
||||
35
assets/js/themes.js
Normal file
35
assets/js/themes.js
Normal file
@@ -0,0 +1,35 @@
|
||||
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 url = '/toggle_theme?redirect=false';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 10000;
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
set_mode(dark_mode);
|
||||
localStorage.setItem('dark_mode', dark_mode);
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
|
||||
window.addEventListener('storage', function (e) {
|
||||
if (e.key == 'dark_mode') {
|
||||
var dark_mode = e.newValue === 'true';
|
||||
set_mode(dark_mode);
|
||||
}
|
||||
});
|
||||
|
||||
function set_mode(bool) {
|
||||
document.getElementById('dark_theme').media = !bool ? 'none' : '';
|
||||
document.getElementById('light_theme').media = bool ? 'none' : '';
|
||||
|
||||
if (bool) {
|
||||
toggle_theme.children[0].setAttribute('class', 'icon ion-ios-sunny');
|
||||
} else {
|
||||
toggle_theme.children[0].setAttribute('class', 'icon ion-ios-moon');
|
||||
}
|
||||
}
|
||||
2
assets/js/videojs-overlay.min.js
vendored
Normal file
2
assets/js/videojs-overlay.min.js
vendored
Normal 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});
|
||||
2
assets/js/videojs-vtt-thumbnails.min.js
vendored
2
assets/js/videojs-vtt-thumbnails.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,52 +1,446 @@
|
||||
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 toggle_parent(target) {
|
||||
body = target.parentNode.parentNode.children[1];
|
||||
if (body.style.display === null || body.style.display === "") {
|
||||
target.innerHTML = "[ + ]";
|
||||
body.style.display = "none";
|
||||
if (body.style.display === null || body.style.display === '') {
|
||||
target.innerHTML = '[ + ]';
|
||||
body.style.display = 'none';
|
||||
} else {
|
||||
target.innerHTML = "[ - ]";
|
||||
body.style.display = "";
|
||||
target.innerHTML = '[ - ]';
|
||||
body.style.display = '';
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_comments(target) {
|
||||
function toggle_comments(event) {
|
||||
var target = event.target;
|
||||
body = target.parentNode.parentNode.parentNode.children[1];
|
||||
if (body.style.display === null || body.style.display === "") {
|
||||
target.innerHTML = "[ + ]";
|
||||
body.style.display = "none";
|
||||
if (body.style.display === null || body.style.display === '') {
|
||||
target.innerHTML = '[ + ]';
|
||||
body.style.display = 'none';
|
||||
} else {
|
||||
target.innerHTML = "[ - ]";
|
||||
body.style.display = "";
|
||||
target.innerHTML = '[ - ]';
|
||||
body.style.display = '';
|
||||
}
|
||||
}
|
||||
|
||||
function swap_comments(source) {
|
||||
if (source == "youtube") {
|
||||
function swap_comments(event) {
|
||||
var source = event.target.getAttribute('data-comments');
|
||||
|
||||
if (source === 'youtube') {
|
||||
get_youtube_comments();
|
||||
} else if (source == "reddit") {
|
||||
} else if (source === 'reddit') {
|
||||
get_reddit_comments();
|
||||
}
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
function show_youtube_replies(target, inner_text, sub_text) {
|
||||
body = target.parentNode.parentNode.children[1];
|
||||
body.style.display = "";
|
||||
|
||||
target.innerHTML = inner_text;
|
||||
target.setAttribute("onclick", "hide_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')");
|
||||
}
|
||||
|
||||
function hide_youtube_replies(target, inner_text, sub_text) {
|
||||
body = target.parentNode.parentNode.children[1];
|
||||
body.style.display = "none";
|
||||
body.style.display = 'none';
|
||||
|
||||
target.innerHTML = sub_text;
|
||||
target.setAttribute("onclick", "show_youtube_replies(this, \'" + inner_text + "\', \'" + 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);
|
||||
}
|
||||
|
||||
var continue_button = document.getElementById('continue');
|
||||
if (continue_button) {
|
||||
continue_button.onclick = continue_autoplay;
|
||||
}
|
||||
|
||||
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);
|
||||
});
|
||||
} else {
|
||||
player.off('ended');
|
||||
}
|
||||
}
|
||||
|
||||
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_playlist(plid, retries = 5) {
|
||||
playlist = document.getElementById('playlist');
|
||||
|
||||
if (retries <= 0) {
|
||||
console.log('Failed to pull playlist');
|
||||
playlist.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
playlist.innerHTML = ' \
|
||||
<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3> \
|
||||
<hr>'
|
||||
|
||||
if (plid.startsWith('RD')) {
|
||||
var plid_url = '/api/v1/mixes/' + plid +
|
||||
'?continuation=' + video_data.id +
|
||||
'&format=html&hl=' + video_data.preferences.locale;
|
||||
} else {
|
||||
var plid_url = '/api/v1/playlists/' + plid +
|
||||
'?continuation=' + video_data.id +
|
||||
'&format=html&hl=' + video_data.preferences.locale;
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 10000;
|
||||
xhr.open('GET', plid_url, true);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
playlist.innerHTML = xhr.response.playlistHtml;
|
||||
|
||||
if (xhr.response.nextVideo) {
|
||||
player.on('ended', function () {
|
||||
var url = new URL('https://example.com/watch?v=' + xhr.response.nextVideo);
|
||||
|
||||
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('list', plid);
|
||||
location.assign(url.pathname + url.search);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
playlist.innerHTML = '';
|
||||
document.getElementById('continue').style.display = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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>';
|
||||
|
||||
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(retries = 5) {
|
||||
comments = document.getElementById('comments');
|
||||
|
||||
if (retries <= 0) {
|
||||
console.log('Failed to pull comments');
|
||||
comments.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
var fallback = comments.innerHTML;
|
||||
comments.innerHTML =
|
||||
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
||||
|
||||
var url = '/api/v1/comments/' + video_data.id +
|
||||
'?source=reddit&format=html' +
|
||||
'&hl=' + video_data.preferences.locale;
|
||||
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) {
|
||||
comments.innerHTML = ' \
|
||||
<div> \
|
||||
<h3> \
|
||||
<a href="javascript:void(0)">[ - ]</a> \
|
||||
{title} \
|
||||
</h3> \
|
||||
<p> \
|
||||
<b> \
|
||||
<a href="javascript:void(0)" data-comments="youtube"> \
|
||||
{youtubeCommentsText} \
|
||||
</a> \
|
||||
</b> \
|
||||
</p> \
|
||||
<b> \
|
||||
<a rel="noopener" target="_blank" href="https://reddit.com{permalink}">{redditPermalinkText}</a> \
|
||||
</b> \
|
||||
</div> \
|
||||
<div>{contentHtml}</div> \
|
||||
<hr>'.supplant({
|
||||
title: xhr.response.title,
|
||||
youtubeCommentsText: video_data.youtube_comments_text,
|
||||
redditPermalinkText: video_data.reddit_permalink_text,
|
||||
permalink: xhr.response.permalink,
|
||||
contentHtml: xhr.response.contentHtml
|
||||
});
|
||||
|
||||
comments.children[0].children[0].children[0].onclick = toggle_comments;
|
||||
comments.children[0].children[1].children[0].onclick = swap_comments;
|
||||
} else {
|
||||
if (video_data.params.comments[1] === 'youtube') {
|
||||
console.log('Pulling comments failed... ' + retries + '/5');
|
||||
setTimeout(function () { get_youtube_comments(retries - 1) }, 1000);
|
||||
} else {
|
||||
comments.innerHTML = fallback;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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(retries = 5) {
|
||||
comments = document.getElementById('comments');
|
||||
|
||||
if (retries <= 0) {
|
||||
console.log('Failed to pull comments');
|
||||
comments.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
var fallback = comments.innerHTML;
|
||||
comments.innerHTML =
|
||||
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
||||
|
||||
var url = '/api/v1/comments/' + video_data.id +
|
||||
'?format=html' +
|
||||
'&hl=' + video_data.preferences.locale +
|
||||
'&thin_mode=' + video_data.preferences.thin_mode;
|
||||
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) {
|
||||
comments.innerHTML = ' \
|
||||
<div> \
|
||||
<h3> \
|
||||
<a href="javascript:void(0)">[ - ]</a> \
|
||||
{commentsText} \
|
||||
</h3> \
|
||||
<b> \
|
||||
<a href="javascript:void(0)" data-comments="reddit"> \
|
||||
{redditComments} \
|
||||
</a> \
|
||||
</b> \
|
||||
</div> \
|
||||
<div>{contentHtml}</div> \
|
||||
<hr>'.supplant({
|
||||
contentHtml: xhr.response.contentHtml,
|
||||
redditComments: video_data.reddit_comments_text,
|
||||
commentsText: video_data.comments_text.supplant(
|
||||
{ commentCount: number_with_separator(xhr.response.commentCount) }
|
||||
)
|
||||
});
|
||||
|
||||
comments.children[0].children[0].children[0].onclick = toggle_comments;
|
||||
comments.children[0].children[1].children[0].onclick = swap_comments;
|
||||
} else {
|
||||
if (video_data.params.comments[1] === 'youtube') {
|
||||
setTimeout(function () { get_youtube_comments(retries - 1) }, 1000);
|
||||
} else {
|
||||
comments.innerHTML = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.onerror = 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');
|
||||
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) {
|
||||
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/comments/' + video_data.id +
|
||||
'?format=html' +
|
||||
'&hl=' + video_data.preferences.locale +
|
||||
'&thin_mode=' + video_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', video_data.hide_replies_text);
|
||||
a.setAttribute('data-inner-text', video_data.show_replies_text);
|
||||
a.innerText = video_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();
|
||||
}
|
||||
|
||||
if (video_data.play_next) {
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
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 = '';
|
||||
}
|
||||
|
||||
48
assets/js/watched_widget.js
Normal file
48
assets/js/watched_widget.js
Normal file
@@ -0,0 +1,48 @@
|
||||
function mark_watched(target) {
|
||||
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||
tile.style.display = 'none';
|
||||
|
||||
var url = '/watch_ajax?action_mark_watched=1&redirect=false' +
|
||||
'&id=' + target.getAttribute('data-id');
|
||||
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=' + watched_data.csrf_token);
|
||||
}
|
||||
|
||||
function mark_unwatched(target) {
|
||||
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||
tile.style.display = 'none';
|
||||
var count = document.getElementById('count')
|
||||
count.innerText = count.innerText - 1;
|
||||
|
||||
var url = '/watch_ajax?action_mark_unwatched=1&redirect=false' +
|
||||
'&id=' + target.getAttribute('data-id');
|
||||
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) {
|
||||
count.innerText = count.innerText - 1 + 2;
|
||||
tile.style.display = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.send('csrf_token=' + watched_data.csrf_token);
|
||||
}
|
||||
3
config/migrate-scripts/migrate-db-52cb239.sh
Executable file
3
config/migrate-scripts/migrate-db-52cb239.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN views bigint;"
|
||||
3
config/migrate-scripts/migrate-db-701b5ea.sh
Executable file
3
config/migrate-scripts/migrate-db-701b5ea.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
psql invidious kemal -c "ALTER TABLE users ADD COLUMN feed_needs_update boolean"
|
||||
@@ -13,6 +13,7 @@ CREATE TABLE public.channel_videos
|
||||
length_seconds integer,
|
||||
live_now boolean,
|
||||
premiere_timestamp timestamp with time zone,
|
||||
views bigint,
|
||||
CONSTRAINT channel_videos_id_key UNIQUE (id)
|
||||
);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ CREATE TABLE public.users
|
||||
password text,
|
||||
token text,
|
||||
watched text[],
|
||||
feed_needs_update boolean,
|
||||
CONSTRAINT users_email_key UNIQUE (email)
|
||||
);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ services:
|
||||
dockerfile: docker/Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "127.0.0.1:3000:3000"
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "إلغاء الإشتراك",
|
||||
"Subscribe": "إشتراك",
|
||||
"View channel on YouTube": "زيارة القناة على موقع يوتيوب",
|
||||
"View playlist on YouTube": "عرض قائمة التشغيل على اليوتيوب",
|
||||
"newest": "الأجدد",
|
||||
"oldest": "الأقدم",
|
||||
"popular": "الاكثر شعبية",
|
||||
@@ -52,8 +53,8 @@
|
||||
"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) ؟",
|
||||
"Default speed: ": "السرعة الإفتراضية: ",
|
||||
@@ -65,12 +66,12 @@
|
||||
"Default captions: ": "الترجمات الإفتراضية: ",
|
||||
"Fallback captions: ": "الترجمات المصاحبة: ",
|
||||
"Show related videos? ": "عرض مقاطع الفيديو ذات الصلة؟",
|
||||
"Show annotations by default? ": "",
|
||||
"Show annotations by default? ": "عرض الملاحظات فى الفيديو تلقائيا ؟",
|
||||
"Visual preferences": "التفضيلات المرئية",
|
||||
"Dark mode: ": "الوضع الليلى: ",
|
||||
"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: ": "ترتيب الفيديو بـ: ",
|
||||
@@ -84,6 +85,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` رفع فيديو",
|
||||
"`x` is live": "`x` فى بث مباشر",
|
||||
"Data preferences": "إعدادات التفضيلات",
|
||||
"Clear watch history": "حذف سجل المشاهدة",
|
||||
"Import/export data": "إضافة\\إستخراج البيانات",
|
||||
@@ -120,8 +124,8 @@
|
||||
"Trending": "الشائع",
|
||||
"Unlisted": "غير مصنف",
|
||||
"Watch on YouTube": "مشاهدة الفيديو على اليوتيوب",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Hide annotations": "إخفاء الملاحظات فى الفيديو",
|
||||
"Show annotations": "عرض الملاحظات فى الفيديو",
|
||||
"Genre: ": "النوع: ",
|
||||
"License: ": "التراخيص: ",
|
||||
"Family friendly? ": "محتوى عائلى? ",
|
||||
@@ -132,6 +136,7 @@
|
||||
"Shared `x`": "شارك منذ `x`",
|
||||
"`x` views": "`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.": "اهلا! يبدو ان الجافاسكريبت معطلة. اضغط هنا لعرض التعليقات, ضع فى إعتبارك انها ستأخذ وقت اطول للعرض.",
|
||||
"View YouTube comments": "عرض تعليقات اليوتيوب",
|
||||
"View more comments on Reddit": "عرض المزيد من التعليقات على\\من موقع Reddit",
|
||||
@@ -305,10 +310,12 @@
|
||||
"%A %B %-d, %Y": "",
|
||||
"(edited)": "(تم تعديلة)",
|
||||
"YouTube comment permalink": "رابط التعليق على اليوتيوب",
|
||||
"permalink": "",
|
||||
"`x` marked it with a ❤": "`x` اعجب بهذا",
|
||||
"Audio mode": "الوضع الصوتى",
|
||||
"Video mode": "وضع الفيديو",
|
||||
"Videos": "الفيديوهات",
|
||||
"Playlists": "قوائم التشغيل",
|
||||
"Community": "",
|
||||
"Current version: ": "الإصدار الحالى"
|
||||
}
|
||||
101
locales/de.json
101
locales/de.json
@@ -6,18 +6,19 @@
|
||||
"Unsubscribe": "Abbestellen",
|
||||
"Subscribe": "Abonnieren",
|
||||
"View channel on YouTube": "Kanal auf YouTube anzeigen",
|
||||
"View playlist on YouTube": "Wiedergabeliste auf YouTube anzeigen",
|
||||
"newest": "neueste",
|
||||
"oldest": "älteste",
|
||||
"popular": "beliebt",
|
||||
"last": "",
|
||||
"last": "letzte",
|
||||
"Next page": "Nächste Seite",
|
||||
"Previous page": "Vorherige Seite",
|
||||
"Clear watch history?": "Verlauf löschen?",
|
||||
"New password": "",
|
||||
"New passwords must match": "",
|
||||
"Cannot change password for Google accounts": "",
|
||||
"Authorize token?": "",
|
||||
"Authorize token for `x`?": "",
|
||||
"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",
|
||||
"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",
|
||||
@@ -52,10 +53,10 @@
|
||||
"Player preferences": "Playereinstellungen",
|
||||
"Always loop: ": "Immer wiederholen: ",
|
||||
"Autoplay: ": "Automatisch abspielen: ",
|
||||
"Play next by default: ": "",
|
||||
"Play next by default: ": "Standardmäßig als nächstes abspielen: ",
|
||||
"Autoplay next video: ": "nächstes Video automatisch abspielen: ",
|
||||
"Listen by default: ": "Nur Ton als Standard: ",
|
||||
"Proxy videos? ": "",
|
||||
"Proxy videos? ": "Proxy-Videos? ",
|
||||
"Default speed: ": "Standardgeschwindigkeit: ",
|
||||
"Preferred video quality: ": "Bevorzugte Videoqualität: ",
|
||||
"Player volume: ": "Playerlautstärke: ",
|
||||
@@ -65,12 +66,12 @@
|
||||
"Default captions: ": "Standarduntertitel: ",
|
||||
"Fallback captions: ": "Ersatzuntertitel: ",
|
||||
"Show related videos? ": "Ähnliche Videos anzeigen? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Show annotations by default? ": "Standardmäßig Anmerkungen anzeigen? ",
|
||||
"Visual preferences": "Anzeigeeinstellungen",
|
||||
"Dark mode: ": "Nachtmodus: ",
|
||||
"Thin mode: ": "Schlanker Modus: ",
|
||||
"Subscription preferences": "Abonnementeinstellungen",
|
||||
"Show annotations by default for subscribed channels? ": "",
|
||||
"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: ",
|
||||
@@ -84,31 +85,34 @@
|
||||
"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": "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",
|
||||
"Change password": "",
|
||||
"Change password": "Passwort ändern",
|
||||
"Manage subscriptions": "Abonnements verwalten",
|
||||
"Manage tokens": "",
|
||||
"Manage tokens": "Token verwalten",
|
||||
"Watch history": "Verlauf",
|
||||
"Delete account": "Account löschen",
|
||||
"Administrator preferences": "",
|
||||
"Default homepage: ": "",
|
||||
"Feed menu: ": "",
|
||||
"Top enabled? ": "",
|
||||
"CAPTCHA enabled? ": "",
|
||||
"Login enabled? ": "",
|
||||
"Registration enabled? ": "",
|
||||
"Report statistics? ": "",
|
||||
"Administrator preferences": "Administratoreinstellungen",
|
||||
"Default homepage: ": "Standard-Homepage: ",
|
||||
"Feed menu: ": "Feed-Menü: ",
|
||||
"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": "",
|
||||
"Token manager": "Token-Manager",
|
||||
"Token": "Token",
|
||||
"`x` subscriptions": "`x` Abonnements",
|
||||
"`x` tokens": "",
|
||||
"`x` tokens": "`x` Tokens",
|
||||
"Import/export": "Importieren/Exportieren",
|
||||
"unsubscribe": "abbestellen",
|
||||
"revoke": "",
|
||||
"revoke": "widerrufen",
|
||||
"Subscriptions": "Abonnements",
|
||||
"`x` unseen notifications": "`x` ungesehene Benachrichtigungen",
|
||||
"search": "Suchen",
|
||||
@@ -116,12 +120,12 @@
|
||||
"Released under the AGPLv3 by Omar Roth.": "Veröffentlicht unter AGPLv3 von Omar Roth.",
|
||||
"Source available here.": "Quellcode verfügbar hier.",
|
||||
"View JavaScript license information.": "Javascript Lizenzinformationen anzeigen.",
|
||||
"View privacy policy.": "",
|
||||
"View privacy policy.": "Datenschutzerklärung einsehen.",
|
||||
"Trending": "Trending",
|
||||
"Unlisted": "",
|
||||
"Unlisted": "Nicht aufgeführt",
|
||||
"Watch on YouTube": "Video auf YouTube ansehen",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Hide annotations": "Anmerkungen ausblenden",
|
||||
"Show annotations": "Anmerkungen anzeigen",
|
||||
"Genre: ": "Genre: ",
|
||||
"License: ": "Lizenz: ",
|
||||
"Family friendly? ": "Familienfreundlich? ",
|
||||
@@ -130,8 +134,9 @@
|
||||
"Whitelisted regions: ": "Erlaubte Regionen: ",
|
||||
"Blacklisted regions: ": "Unerlaubte Regionen: ",
|
||||
"Shared `x`": "Geteilt `x`",
|
||||
"`x` views": "",
|
||||
"Premieres in `x`": "",
|
||||
"`x` views": "`x` Ansichten",
|
||||
"Premieres in `x`": "Premieren 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.": "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",
|
||||
@@ -294,21 +299,23 @@
|
||||
"About": "Über",
|
||||
"Rating: ": "Bewertung: ",
|
||||
"Language: ": "Sprache: ",
|
||||
"View as playlist": "",
|
||||
"Default": "",
|
||||
"Music": "",
|
||||
"Gaming": "",
|
||||
"News": "",
|
||||
"Movies": "",
|
||||
"Download": "",
|
||||
"Download as: ": "",
|
||||
"%A %B %-d, %Y": "",
|
||||
"(edited)": "",
|
||||
"YouTube comment permalink": "",
|
||||
"`x` marked it with a ❤": "",
|
||||
"Audio mode": "",
|
||||
"Video mode": "",
|
||||
"Videos": "",
|
||||
"Playlists": "",
|
||||
"Current version: ": ""
|
||||
"View as playlist": "Als Wiedergabeliste anzeigen",
|
||||
"Default": "Standard",
|
||||
"Music": "Musik",
|
||||
"Gaming": "Videospiele",
|
||||
"News": "Neuigkeiten",
|
||||
"Movies": "Filme",
|
||||
"Download": "Herunterladen",
|
||||
"Download as: ": "Herunterladen als: ",
|
||||
"%A %B %-d, %Y": "%A %B %-d, %Y",
|
||||
"(edited)": "(editiert)",
|
||||
"YouTube comment permalink": "YouTube-Kommentar Permalink",
|
||||
"permalink": "",
|
||||
"`x` marked it with a ❤": "`x` markierte es mit einem ❤",
|
||||
"Audio mode": "Audiomodus",
|
||||
"Video mode": "Videomodus",
|
||||
"Videos": "Videos",
|
||||
"Playlists": "Wiedergabelisten",
|
||||
"Community": "",
|
||||
"Current version: ": "Aktuelle Version: "
|
||||
}
|
||||
366
locales/el.json
Normal file
366
locales/el.json
Normal file
@@ -0,0 +1,366 @@
|
||||
{
|
||||
"`x` subscribers": {
|
||||
"(\\D|^)1(\\D|$)": "`x` συνδρομητής",
|
||||
"": "`x` συνδρομητές"
|
||||
},
|
||||
"`x` videos": {
|
||||
"(\\D|^)1(\\D|$)": "`x` βίντεο",
|
||||
"": "`x` βίντεο"
|
||||
},
|
||||
"LIVE": "ΖΩΝΤΑΝΑ",
|
||||
"Shared `x` ago": "Μοιράστηκε πριν `x`",
|
||||
"Unsubscribe": "Απεγγραφή",
|
||||
"Subscribe": "Εγγραφή",
|
||||
"View channel on YouTube": "Προβολή καναλιού στο YouTube",
|
||||
"View playlist on 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": "Ταυτότητα χρήστη",
|
||||
"Password": "Κωδικός πρόσβασης",
|
||||
"Time (h:mm:ss):": "Ώρα (ω:λλ:δδ):",
|
||||
"Text CAPTCHA": "Κείμενο CAPTCHA",
|
||||
"Image CAPTCHA": "Εικόνα 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? ": "Αναπαραγωγή με διακομιστή μεσολάβησης (proxy): ",
|
||||
"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": "Προτιμήσεις εμφάνισης",
|
||||
"Dark mode: ": "Σκοτεινή λειτουργία: ",
|
||||
"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` is live": "",
|
||||
"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? ": "Ενεργοποίηση κορυφαίων; ",
|
||||
"CAPTCHA enabled? ": "Ενεργοποίηση CAPTCHA; ",
|
||||
"Login enabled? ": "Ενεργοποίηση σύνδεσης; ",
|
||||
"Registration enabled? ": "Ενεργοποίηση εγγραφής; ",
|
||||
"Report statistics? ": "Αναφορά στατιστικών; ",
|
||||
"Save preferences": "Αποθήκευση προτιμήσεων",
|
||||
"Subscription manager": "Διαχειριστής συνδρομών",
|
||||
"Token manager": "Διαχειριστής διασυνδέσεων",
|
||||
"Token": "Διασύνδεση",
|
||||
"`x` subscriptions": {
|
||||
"(\\D|^)1(\\D|$)": "`x` συνδρομή",
|
||||
"": "`x` συνδρομές"
|
||||
},
|
||||
"`x` tokens": {
|
||||
"(\\D|^)1(\\D|$)": "`x` διασύνδεση",
|
||||
"": "`x` διασυνδέσεις"
|
||||
},
|
||||
"Import/export": "Εισαγωγή/εξαγωγή",
|
||||
"unsubscribe": "κατάργηση συνδρομής",
|
||||
"revoke": "ανάκληση",
|
||||
"Subscriptions": "Συνδρομές",
|
||||
"`x` unseen notifications": {
|
||||
"(\\D|^)1(\\D|$)": "`x` καινούρια ειδοποίηση",
|
||||
"": "`x` καινούριες ειδοποιήσεις"
|
||||
},
|
||||
"search": "αναζήτηση",
|
||||
"Log out": "Αποσύνδεση",
|
||||
"Released under the AGPLv3 by Omar Roth.": "Κυκλοφορεί υπό την άδεια AGPLv3 από τον Omar Roth.",
|
||||
"Source available here.": "Προβολή πηγαίου κώδικα εδώ.",
|
||||
"View JavaScript license information.": "Προβολή πληροφοριών άδειας JavaScript.",
|
||||
"View privacy policy.": "Προβολή πολιτικής απορρήτου.",
|
||||
"Trending": "Τάσεις",
|
||||
"Unlisted": "Κρυφό",
|
||||
"Watch on YouTube": "Προβολή στο YouTube",
|
||||
"Hide annotations": "Απόκρυψη σημειώσεων",
|
||||
"Show annotations": "Προβολή σημειώσεων",
|
||||
"Genre: ": "Είδος: ",
|
||||
"License: ": "Άδεια: ",
|
||||
"Family friendly? ": "Φιλικό προς την οικογένεια; ",
|
||||
"Wilson score: ": "Wilson score: ",
|
||||
"Engagement: ": "Ενδιαφέρον: ",
|
||||
"Whitelisted regions: ": "Επιτρεπτές περιοχές: ",
|
||||
"Blacklisted regions: ": "Μη-επιτρεπτές περιοχές: ",
|
||||
"Shared `x`": "Μοιράστηκε το `x`",
|
||||
"`x` views": {
|
||||
"(\\D|^)1(\\D|$)": "`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",
|
||||
"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.": "Αδυναμία σύνδεσης, βεβαιωθείτε πως ο έλεγχος ταυτότητας δύο παραγόντων (με Authenticator ή SMS) είναι ενεργοποιημένος.",
|
||||
"Invalid TFA code": "Μη έγκυρος κωδικός ελέγχου ταυτότητας δύο παραγόντων",
|
||||
"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": "Η ταυτότητα χρήστη είναι απαιτούμενο πεδίο",
|
||||
"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`": "Ροή RSS του Invidious για το χρήστη `x`",
|
||||
"channel:`x`": "κανάλι:`x`",
|
||||
"Deleted or invalid channel": "Διαγραμμένο ή μη έγκυρο κανάλι",
|
||||
"This channel does not exist.": "Αυτό το κανάλι δεν υπάρχει.",
|
||||
"Could not get channel info.": "Αδύναμια εύρεσης πληροφοριών καναλιού.",
|
||||
"Could not fetch comments": "Αδυναμία λήψης σχολίων",
|
||||
"View `x` replies": {
|
||||
"(\\D|^)1(\\D|$)": "Προβολή `x` απάντησης",
|
||||
"": "Προβολή `x` απαντήσεων"
|
||||
},
|
||||
"`x` ago": "Πριν `x`",
|
||||
"Load more": "Φόρτωση περισσότερων",
|
||||
"`x` points": {
|
||||
"(\\D|^)1(\\D|$)": "`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": "Το Κρυφό πεδίο \"δοκιμασία\" είναι απαραίτητο",
|
||||
"Hidden field \"token\" is a required field": "Το κρυφό πεδίο \"αναγνωριστικό διασύνδεσης\" είναι απαραίτητο",
|
||||
"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": "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": "Xhosa",
|
||||
"Yiddish": "Γίντις",
|
||||
"Yoruba": "Γιορούμπα",
|
||||
"Zulu": "Ζουλού",
|
||||
"`x` years": {
|
||||
"(\\D|^)1(\\D|$)": "`x` χρόνο",
|
||||
"": "`x` χρόνια"
|
||||
},
|
||||
"`x` months": {
|
||||
"(\\D|^)1(\\D|$)": "`x` μήνα",
|
||||
"": "`x` μήνες"
|
||||
},
|
||||
"`x` weeks": {
|
||||
"(\\D|^)1(\\D|$)": "`x` εβδομάδα",
|
||||
"": "`x` εβδομάδες"
|
||||
},
|
||||
"`x` days": {
|
||||
"(\\D|^)1(\\D|$)": "`x` ημέρα",
|
||||
"": "`x` ημέρες"
|
||||
},
|
||||
"`x` hours": {
|
||||
"(\\D|^)1(\\D|$)": "`x` ώρα",
|
||||
"": "`x` ώρες"
|
||||
},
|
||||
"`x` minutes": {
|
||||
"(\\D|^)1(\\D|$)": "`x` λεπτό",
|
||||
"": "`x` λεπτά"
|
||||
},
|
||||
"`x` seconds": {
|
||||
"(\\D|^)1(\\D|$)": "`x` δευτερόλεπτο",
|
||||
"": "`x` δευτερόλεπτα"
|
||||
},
|
||||
"Fallback comments: ": "Εναλλακτικά σχόλια: ",
|
||||
"Popular": "Δημοφιλή",
|
||||
"Top": "Κορυφαία",
|
||||
"About": "Σχετικά",
|
||||
"Rating: ": "Aξιολόγηση: ",
|
||||
"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: ": "Τρέχουσα έκδοση: "
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
"Unsubscribe": "Unsubscribe",
|
||||
"Subscribe": "Subscribe",
|
||||
"View channel on YouTube": "View channel on YouTube",
|
||||
"View playlist on YouTube": "View playlist on YouTube",
|
||||
"newest": "newest",
|
||||
"oldest": "oldest",
|
||||
"popular": "popular",
|
||||
@@ -90,6 +91,9 @@
|
||||
"Only show latest unwatched video from channel: ": "Only show latest unwatched video from channel: ",
|
||||
"Only show unwatched: ": "Only show unwatched: ",
|
||||
"Only show notifications (if there are any): ": "Only show notifications (if there are any): ",
|
||||
"Enable web notifications": "Enable web notifications",
|
||||
"`x` uploaded a video": "`x` uploaded a video",
|
||||
"`x` is live": "`x` is live",
|
||||
"Data preferences": "Data preferences",
|
||||
"Clear watch history": "Clear watch history",
|
||||
"Import/export data": "Import/export data",
|
||||
@@ -150,6 +154,7 @@
|
||||
"": "`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",
|
||||
@@ -350,10 +355,12 @@
|
||||
"%A %B %-d, %Y": "%A %B %-d, %Y",
|
||||
"(edited)": "(edited)",
|
||||
"YouTube comment permalink": "YouTube comment 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: "
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "Malaboni",
|
||||
"Subscribe": "Aboni",
|
||||
"View channel on YouTube": "Vidi kanalon en YouTube",
|
||||
"View playlist on YouTube": "Vidi ludliston en YouTube",
|
||||
"newest": "pli novaj",
|
||||
"oldest": "pli malnovaj",
|
||||
"popular": "popularaj",
|
||||
@@ -84,6 +85,9 @@
|
||||
"Only show latest unwatched video from channel: ": "Nur montri pli novan malviditan videon el kanalo: ",
|
||||
"Only show unwatched: ": "Nur montri malviditajn: ",
|
||||
"Only show notifications (if there are any): ": "Nur montri sciigojn (se estas): ",
|
||||
"Enable web notifications": "Ebligi retejajn sciigojn",
|
||||
"`x` uploaded a video": "`x` alŝutis videon",
|
||||
"`x` is live": "`x` estas nuna",
|
||||
"Data preferences": "Datumagordoj",
|
||||
"Clear watch history": "Forigi vidohistorion",
|
||||
"Import/export data": "Importi/Eksporti datumojn",
|
||||
@@ -132,6 +136,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",
|
||||
@@ -305,10 +310,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: "
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "Desuscribirse",
|
||||
"Subscribe": "Suscribirse",
|
||||
"View channel on YouTube": "Ver el canal en YouTube",
|
||||
"View playlist on YouTube": "",
|
||||
"newest": "más nuevos",
|
||||
"oldest": "más viejos",
|
||||
"popular": "populares",
|
||||
@@ -13,11 +14,11 @@
|
||||
"Next page": "Página siguiente",
|
||||
"Previous page": "Página anterior",
|
||||
"Clear watch history?": "¿Quiere borrar el historial de reproducción?",
|
||||
"New password": "",
|
||||
"New passwords must match": "",
|
||||
"Cannot change password for Google accounts": "",
|
||||
"Authorize token?": "",
|
||||
"Authorize token for `x`?": "",
|
||||
"New password": "Nueva contraseña",
|
||||
"New passwords must match": "Las nuevas contraseñas deben coincidir",
|
||||
"Cannot change password for Google accounts": "No se puede cambiar la contraseña de la cuenta de Google",
|
||||
"Authorize token?": "¿Autorizar el token?",
|
||||
"Authorize token for `x`?": "¿Autorizar el token para `x`?",
|
||||
"Yes": "Sí",
|
||||
"No": "No",
|
||||
"Import and Export Data": "Importación y exportación de datos",
|
||||
@@ -52,7 +53,7 @@
|
||||
"Player preferences": "Preferencias del reproductor",
|
||||
"Always loop: ": "Repetir siempre: ",
|
||||
"Autoplay: ": "Reproducción automática: ",
|
||||
"Play next by default: ": "",
|
||||
"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? ",
|
||||
@@ -60,17 +61,17 @@
|
||||
"Preferred video quality: ": "Calidad de vídeo preferida: ",
|
||||
"Player volume: ": "Volumen del reproductor: ",
|
||||
"Default comments: ": "Comentarios por defecto: ",
|
||||
"youtube": "",
|
||||
"reddit": "",
|
||||
"youtube": "YouTube",
|
||||
"reddit": "Reddit",
|
||||
"Default captions: ": "Subtítulos por defecto: ",
|
||||
"Fallback captions: ": "Subtítulos alternativos: ",
|
||||
"Show related videos? ": "¿Mostrar vídeos relacionados? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Show annotations by default? ": "¿Mostrar anotaciones por defecto? ",
|
||||
"Visual preferences": "Preferencias visuales",
|
||||
"Dark mode: ": "Modo oscuro: ",
|
||||
"Thin mode: ": "Modo compacto: ",
|
||||
"Subscription preferences": "Preferencias de la suscripción",
|
||||
"Show annotations by default for subscribed channels? ": "",
|
||||
"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: ",
|
||||
@@ -84,12 +85,15 @@
|
||||
"Only show latest unwatched video from channel: ": "Mostrar solo el último vídeo sin ver del canal: ",
|
||||
"Only show unwatched: ": "Mostrar solo los no vistos: ",
|
||||
"Only show notifications (if there are any): ": "Mostrar solo notificaciones (si hay alguna): ",
|
||||
"Enable web notifications": "",
|
||||
"`x` uploaded a video": "",
|
||||
"`x` is live": "",
|
||||
"Data preferences": "Preferencias de los datos",
|
||||
"Clear watch history": "Borrar el historial de reproducción",
|
||||
"Import/export data": "Importar/Exportar datos",
|
||||
"Change password": "",
|
||||
"Change password": "Cambiar contraseña",
|
||||
"Manage subscriptions": "Gestionar las suscripciones",
|
||||
"Manage tokens": "",
|
||||
"Manage tokens": "Gestionar tokens",
|
||||
"Watch history": "Historial de reproducción",
|
||||
"Delete account": "Borrar cuenta",
|
||||
"Administrator preferences": "Preferencias de administrador",
|
||||
@@ -102,13 +106,13 @@
|
||||
"Report statistics? ": "¿Enviar estadísticas? ",
|
||||
"Save preferences": "Guardar las preferencias",
|
||||
"Subscription manager": "Gestor de suscripciones",
|
||||
"Token manager": "",
|
||||
"Token": "",
|
||||
"Token manager": "Gestor de tokens",
|
||||
"Token": "Token",
|
||||
"`x` subscriptions": "`x` suscripciones",
|
||||
"`x` tokens": "",
|
||||
"`x` tokens": "`x` tokens",
|
||||
"Import/export": "Importar/Exportar",
|
||||
"unsubscribe": "Desuscribirse",
|
||||
"revoke": "",
|
||||
"revoke": "revocar",
|
||||
"Subscriptions": "Suscripciones",
|
||||
"`x` unseen notifications": "`x` notificaciones sin ver",
|
||||
"search": "buscar",
|
||||
@@ -120,8 +124,8 @@
|
||||
"Trending": "Tendencias",
|
||||
"Unlisted": "No listado",
|
||||
"Watch on YouTube": "Ver el vídeo en Youtube",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Hide annotations": "Ocultar anotaciones",
|
||||
"Show annotations": "Mostrar anotaciones",
|
||||
"Genre: ": "Género: ",
|
||||
"License: ": "Licencia: ",
|
||||
"Family friendly? ": "¿Filtrar contenidos? ",
|
||||
@@ -132,6 +136,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",
|
||||
@@ -305,10 +310,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: "
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "Harpidetza kendu",
|
||||
"Subscribe": "Harpidetu",
|
||||
"View channel on YouTube": "Ikusi kanala YouTuben",
|
||||
"View playlist on YouTube": "",
|
||||
"newest": "berrienak",
|
||||
"oldest": "zaharrenak",
|
||||
"popular": "ospetsuenak",
|
||||
@@ -84,6 +85,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": "",
|
||||
"Data preferences": "",
|
||||
"Clear watch history": "",
|
||||
"Import/export data": "",
|
||||
@@ -305,8 +309,9 @@
|
||||
"%A %B %-d, %Y": "",
|
||||
"(edited)": "",
|
||||
"YouTube comment permalink": "",
|
||||
"permalink": "",
|
||||
"`x` marked it with a ❤": "",
|
||||
"Audio mode": "",
|
||||
"Video mode": "",
|
||||
"Videos": ""
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "Se désabonner",
|
||||
"Subscribe": "S'abonner",
|
||||
"View channel on YouTube": "Voir la chaîne sur YouTube",
|
||||
"View playlist on YouTube": "",
|
||||
"newest": "Date d'ajout (la plus récente)",
|
||||
"oldest": "Date d'ajout (la plus ancienne)",
|
||||
"popular": "Les plus populaires",
|
||||
@@ -13,11 +14,11 @@
|
||||
"Next page": "Page suivante",
|
||||
"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": "",
|
||||
"New passwords must match": "",
|
||||
"Cannot change password for Google accounts": "",
|
||||
"Authorize token?": "",
|
||||
"Authorize token for `x`?": "",
|
||||
"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é",
|
||||
"Authorize token?": "Autoriser le token ?",
|
||||
"Authorize token for `x`?": "Autoriser le token pour `x` ?",
|
||||
"Yes": "Oui",
|
||||
"No": "Non",
|
||||
"Import and Export Data": "Importer et exporter des données",
|
||||
@@ -52,7 +53,7 @@
|
||||
"Player preferences": "Préférences du lecteur",
|
||||
"Always loop: ": "Lire en boucle : ",
|
||||
"Autoplay: ": "Lire automatiquement : ",
|
||||
"Play next by default: ": "",
|
||||
"Play next by default: ": "Jouer suirvante par défaut : ",
|
||||
"Autoplay next video: ": "Lire automatiquement la vidéo suivante : ",
|
||||
"Listen by default: ": "Audio uniquement : ",
|
||||
"Proxy videos? ": "Charger les vidéos à travers un proxy ? ",
|
||||
@@ -60,22 +61,22 @@
|
||||
"Preferred video quality: ": "Qualité vidéo souhaitée : ",
|
||||
"Player volume: ": "Volume du lecteur : ",
|
||||
"Default comments: ": "Source des commentaires : ",
|
||||
"youtube": "",
|
||||
"reddit": "",
|
||||
"youtube": "YouTube",
|
||||
"reddit": "Reddit",
|
||||
"Default captions: ": "Sous-titres par défaut : ",
|
||||
"Fallback captions: ": "Fallback captions: ",
|
||||
"Fallback captions: ": "Sous-titres de repli : ",
|
||||
"Show related videos? ": "Voir les vidéos liées ? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Show annotations by default? ": "Voir les annotations par défaut ? ",
|
||||
"Visual preferences": "Préférences du site",
|
||||
"Dark mode: ": "Mode Sombre : ",
|
||||
"Thin mode: ": "Mode Simplifié : ",
|
||||
"Subscription preferences": "Préférences de la page d'abonnements",
|
||||
"Show annotations by default for subscribed channels? ": "",
|
||||
"Show annotations by default for subscribed channels? ": "Voir les annotations par défaut sur les chaînes suivies ? ",
|
||||
"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 : ",
|
||||
"Sort videos by: ": "Trier les vidéos par : ",
|
||||
"published": "publication",
|
||||
"published - reverse": "publication - inversé",
|
||||
"published": "date de publication",
|
||||
"published - reverse": "date de publication - inversé",
|
||||
"alphabetically": "alphabétiquement",
|
||||
"alphabetically - reverse": "alphabétiquement - inversé",
|
||||
"channel name": "nom de la chaîne",
|
||||
@@ -84,12 +85,15 @@
|
||||
"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 notifications (if there are any): ": "Afficher uniquement les notifications (s'il y en a) : ",
|
||||
"Enable web notifications": "",
|
||||
"`x` uploaded a video": "",
|
||||
"`x` is live": "",
|
||||
"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",
|
||||
"Change password": "",
|
||||
"Change password": "Modifier le mot de passe",
|
||||
"Manage subscriptions": "Gérer les abonnements",
|
||||
"Manage tokens": "",
|
||||
"Manage tokens": "Gérer les tokens",
|
||||
"Watch history": "Historique de visionnage",
|
||||
"Delete account": "Supprimer votre compte",
|
||||
"Administrator preferences": "Préferences d'Administrateur",
|
||||
@@ -102,13 +106,13 @@
|
||||
"Report statistics? ": "Télémétrie activé ? ",
|
||||
"Save preferences": "Enregistrer les préférences",
|
||||
"Subscription manager": "Gestionnaire d'abonnement",
|
||||
"Token manager": "",
|
||||
"Token": "",
|
||||
"Token manager": "Gestionnaire de tokens",
|
||||
"Token": "Token",
|
||||
"`x` subscriptions": "`x` abonnements",
|
||||
"`x` tokens": "",
|
||||
"`x` tokens": "`x` tokens",
|
||||
"Import/export": "Importer/Exporter",
|
||||
"unsubscribe": "se désabonner",
|
||||
"revoke": "",
|
||||
"revoke": "annuler",
|
||||
"Subscriptions": "Abonnements",
|
||||
"`x` unseen notifications": "`x` notifications non vues",
|
||||
"search": "Rechercher",
|
||||
@@ -116,12 +120,12 @@
|
||||
"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.": "Politique de confidentialité",
|
||||
"View privacy policy.": "Voir la politique de confidentialité.",
|
||||
"Trending": "Tendances",
|
||||
"Unlisted": "Non répertoriée",
|
||||
"Watch on YouTube": "Voir la vidéo sur Youtube",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Hide annotations": "Masquer les annotations",
|
||||
"Show annotations": "Afficher les annotations",
|
||||
"Genre: ": "Genre : ",
|
||||
"License: ": "Licence : ",
|
||||
"Family friendly? ": "Tout Public ? ",
|
||||
@@ -130,8 +134,9 @@
|
||||
"Whitelisted regions: ": "Régions en liste blanche : ",
|
||||
"Blacklisted regions: ": "Régions sur liste noire : ",
|
||||
"Shared `x`": "Ajoutée le `x`",
|
||||
"`x` views": "",
|
||||
"`x` views": "`x` vues",
|
||||
"Premieres in `x`": "Première dans `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.": "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",
|
||||
@@ -291,10 +296,10 @@
|
||||
"Fallback comments: ": "Fallback comments: ",
|
||||
"Popular": "Populaire",
|
||||
"Top": "Top",
|
||||
"About": "A Propos",
|
||||
"About": "À propos",
|
||||
"Rating: ": "Évaluation : ",
|
||||
"Language: ": "Langue : ",
|
||||
"View as playlist": "",
|
||||
"View as playlist": "Voir en tant que liste de lecture",
|
||||
"Default": "Défaut",
|
||||
"Music": "Musique",
|
||||
"Gaming": "Jeux Vidéo",
|
||||
@@ -305,10 +310,12 @@
|
||||
"%A %B %-d, %Y": "%A %-d %B %Y",
|
||||
"(edited)": "(modifié)",
|
||||
"YouTube comment permalink": "Lien YouTube permanent vers le commentaire",
|
||||
"permalink": "",
|
||||
"`x` marked it with a ❤": "`x` l'a marqué d'un ❤",
|
||||
"Audio mode": "Mode Audio",
|
||||
"Video mode": "Mode Vidéo",
|
||||
"Videos": "Vidéos",
|
||||
"Playlists": "Liste de lecture",
|
||||
"Current version: ": "Version :"
|
||||
"Community": "",
|
||||
"Current version: ": "Version actuelle : "
|
||||
}
|
||||
319
locales/is.json
Normal file
319
locales/is.json
Normal file
@@ -0,0 +1,319 @@
|
||||
{
|
||||
"`x` subscribers.": "`x` áskrifandar.",
|
||||
"`x` videos.": "`x` myndbönd.",
|
||||
"LIVE": "BEINT",
|
||||
"Shared `x` ago": "Deilt `x` síðan",
|
||||
"Unsubscribe": "Afskrá",
|
||||
"Subscribe": "Gerast áskrifandi",
|
||||
"View channel on YouTube": "Skoða rás á YouTube",
|
||||
"View playlist on YouTube": "Skoða spilunarlisti á YouTube",
|
||||
"newest": "nýjasta",
|
||||
"oldest": "elsta",
|
||||
"popular": "vinsællt",
|
||||
"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? ": "",
|
||||
"Default speed: ": "Sjálfgefinn hraði: ",
|
||||
"Preferred video quality: ": "Æskilegt myndbands gæði: ",
|
||||
"Player volume: ": "Spilara bindi: ",
|
||||
"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? ": "",
|
||||
"Visual preferences": "Sjónrænar stillingar",
|
||||
"Dark mode: ": "Myrkur ham: ",
|
||||
"Thin mode: ": "Þunnt ham: ",
|
||||
"Subscription preferences": "Áskriftarstillingar",
|
||||
"Show annotations by default for subscribed channels? ": "",
|
||||
"Redirect homepage to feed: ": "",
|
||||
"Number of videos shown in feed: ": "",
|
||||
"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": "",
|
||||
"Watch history": "",
|
||||
"Delete account": "",
|
||||
"Administrator preferences": "",
|
||||
"Default homepage: ": "",
|
||||
"Feed menu: ": "",
|
||||
"Top enabled? ": "",
|
||||
"CAPTCHA enabled? ": "",
|
||||
"Login enabled? ": "",
|
||||
"Registration enabled? ": "",
|
||||
"Report statistics? ": "",
|
||||
"Save preferences": "",
|
||||
"Subscription manager": "",
|
||||
"Token manager": "",
|
||||
"Token": "",
|
||||
"`x` subscriptions.": "",
|
||||
"`x` tokens.": "",
|
||||
"Import/export": "",
|
||||
"unsubscribe": "",
|
||||
"revoke": "",
|
||||
"Subscriptions": "",
|
||||
"`x` unseen notifications.": "",
|
||||
"search": "",
|
||||
"Log out": "",
|
||||
"Released under the AGPLv3 by Omar Roth.": "",
|
||||
"Source available here.": "",
|
||||
"View JavaScript license information.": "",
|
||||
"View privacy policy.": "",
|
||||
"Trending": "",
|
||||
"Unlisted": "",
|
||||
"Watch on YouTube": "",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Genre: ": "",
|
||||
"License: ": "",
|
||||
"Family friendly? ": "",
|
||||
"Wilson score: ": "",
|
||||
"Engagement: ": "",
|
||||
"Whitelisted regions: ": "",
|
||||
"Blacklisted regions: ": "",
|
||||
"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": "",
|
||||
"View `x` comments": "",
|
||||
"View Reddit comments": "",
|
||||
"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": "",
|
||||
"Please log in": "",
|
||||
"Invidious Private Feed for `x`": "",
|
||||
"channel:`x`": "",
|
||||
"Deleted or invalid channel": "",
|
||||
"This channel does not exist.": "",
|
||||
"Could not get channel info.": "",
|
||||
"Could not fetch comments": "",
|
||||
"View `x` replies.": "",
|
||||
"`x` ago": "",
|
||||
"Load more": "",
|
||||
"`x` points.": "",
|
||||
"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": "",
|
||||
"Hidden field \"token\" is a required field": "",
|
||||
"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.": "",
|
||||
"`x` months.": "",
|
||||
"`x` weeks.": "",
|
||||
"`x` days.": "",
|
||||
"`x` hours.": "",
|
||||
"`x` minutes.": "",
|
||||
"`x` seconds.": "",
|
||||
"Fallback comments: ": "",
|
||||
"Popular": "",
|
||||
"Top": "",
|
||||
"About": "",
|
||||
"Rating: ": "",
|
||||
"Language: ": "",
|
||||
"View as playlist": "",
|
||||
"Default": "",
|
||||
"Music": "",
|
||||
"Gaming": "",
|
||||
"News": "",
|
||||
"Movies": "",
|
||||
"Download": "",
|
||||
"Download as: ": "",
|
||||
"%A %B %-d, %Y": "",
|
||||
"(edited)": "",
|
||||
"YouTube comment permalink": "",
|
||||
"`x` marked it with a ❤": "",
|
||||
"Audio mode": "",
|
||||
"Video mode": "",
|
||||
"Videos": "",
|
||||
"Playlists": "",
|
||||
"Current version: ": ""
|
||||
}
|
||||
@@ -6,17 +6,18 @@
|
||||
"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)",
|
||||
"popular": "Tendenze",
|
||||
"last": "",
|
||||
"last": "durare",
|
||||
"Next page": "Pagina successiva",
|
||||
"Previous page": "Pagina precedente",
|
||||
"Clear watch history?": "Sei sicuro di voler cancellare la cronologia dei video guardati?",
|
||||
"New password": "",
|
||||
"New passwords must match": "",
|
||||
"Cannot change password for Google accounts": "",
|
||||
"Authorize token?": "",
|
||||
"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",
|
||||
"No": "No",
|
||||
@@ -52,7 +53,7 @@
|
||||
"Player preferences": "Preferenze del riproduttore",
|
||||
"Always loop: ": "Ripeti sempre: ",
|
||||
"Autoplay: ": "Riproduzione automatica: ",
|
||||
"Play next by default: ": "",
|
||||
"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? ": "",
|
||||
@@ -65,7 +66,7 @@
|
||||
"Default captions: ": "Sottotitoli predefiniti: ",
|
||||
"Fallback captions: ": "Sottotitoli alternativi: ",
|
||||
"Show related videos? ": "Mostra video correlati? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Show annotations by default? ": "Mostra le annotazioni per impostazione predefinita? ",
|
||||
"Visual preferences": "Preferenze grafiche",
|
||||
"Dark mode: ": "Tema scuro: ",
|
||||
"Thin mode: ": "Modalità per connessioni lente: ",
|
||||
@@ -84,6 +85,9 @@
|
||||
"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": "",
|
||||
"Data preferences": "Preferenze dati",
|
||||
"Clear watch history": "Cancella la cronologia dei video guardati",
|
||||
"Import/export data": "Importazione/esportazione dati",
|
||||
@@ -305,10 +309,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": "",
|
||||
"Community": "",
|
||||
"Current version: ": ""
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "Opphev abonnement",
|
||||
"Subscribe": "Abonner",
|
||||
"View channel on YouTube": "Vis kanal på YouTube",
|
||||
"View playlist on YouTube": "Vis spilleliste på YouTube",
|
||||
"newest": "nyeste",
|
||||
"oldest": "eldste",
|
||||
"popular": "populært",
|
||||
@@ -84,6 +85,9 @@
|
||||
"Only show latest unwatched video from channel: ": "Kun vis siste usette video fra kanal: ",
|
||||
"Only show unwatched: ": "Kun vis usette: ",
|
||||
"Only show notifications (if there are any): ": "Kun vis merknader (hvis det er noen): ",
|
||||
"Enable web notifications": "Skru på nettmerknader",
|
||||
"`x` uploaded a video": "`x` lastet opp en video",
|
||||
"`x` is live": "`x` er pålogget",
|
||||
"Data preferences": "Datainnstillinger",
|
||||
"Clear watch history": "Tøm visningshistorikk",
|
||||
"Import/export data": "Importer/eksporter data",
|
||||
@@ -132,6 +136,7 @@
|
||||
"Shared `x`": "Delt `x`",
|
||||
"`x` views": "`x` visninger",
|
||||
"Premieres in `x`": "Premiere om `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.": "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",
|
||||
@@ -305,10 +310,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": "",
|
||||
"Current version: ": "Nåværende versjon: "
|
||||
}
|
||||
|
||||
523
locales/nl.json
523
locales/nl.json
@@ -1,286 +1,291 @@
|
||||
{
|
||||
"`x` subscribers": "`x` abonnees",
|
||||
"`x` videos": "`x` videos",
|
||||
"`x` videos": "`x` video's",
|
||||
"LIVE": "LIVE",
|
||||
"Shared `x` ago": "Gedeeld `x` geleden",
|
||||
"Unsubscribe": "Abonnement opzeggen",
|
||||
"Shared `x` ago": "Gedeeld: `x` geleden",
|
||||
"Unsubscribe": "Deabonneren",
|
||||
"Subscribe": "Abonneren",
|
||||
"View channel on YouTube": "Bekijk kanaal op Youtube",
|
||||
"View channel on YouTube": "Bekijk kanaal op YouTube",
|
||||
"View playlist on YouTube": "Bekijk afspeellijst op YouTube",
|
||||
"newest": "nieuwste",
|
||||
"oldest": "oudste",
|
||||
"popular": "populair",
|
||||
"last": "",
|
||||
"last": "laatste",
|
||||
"Next page": "Volgende pagina",
|
||||
"Previous page": "Vorige pagina",
|
||||
"Clear watch history?": "Kijk geschiedenis wissen?",
|
||||
"New password": "",
|
||||
"New passwords must match": "",
|
||||
"Cannot change password for Google accounts": "",
|
||||
"Authorize token?": "",
|
||||
"Authorize token for `x`?": "",
|
||||
"Clear watch history?": "Wil je de kijkgeschiedenis wissen?",
|
||||
"New password": "Nieuw wachtwoord",
|
||||
"New passwords must match": "De nieuwe wachtwoorden moeten overeenkomen",
|
||||
"Cannot change password for Google accounts": "Kan het wachtwoord van Google-accounts niet wijzigen",
|
||||
"Authorize token?": "Wil je de toegangssleutel machtigen?",
|
||||
"Authorize token for `x`?": "Wil je de toegangssleutel machtigen voor `x`?",
|
||||
"Yes": "Ja",
|
||||
"No": "Nee",
|
||||
"Import and Export Data": "Importeer en Exporteer Gegevens",
|
||||
"Import and Export Data": "Gegevens im- en exporteren",
|
||||
"Import": "Importeren",
|
||||
"Import Invidious data": "Importeer Invidious gegevens",
|
||||
"Import YouTube subscriptions": "Importeer Youtube abonnees",
|
||||
"Import FreeTube subscriptions (.db)": "Importeer FreeTube abonnees (.db)",
|
||||
"Import NewPipe subscriptions (.json)": "Importeer NewPipe abonnees (.json)",
|
||||
"Import NewPipe data (.zip)": "Importeer NewPipe gegevens (.zip)",
|
||||
"Import Invidious data": "Invidious-gegevens importeren",
|
||||
"Import YouTube subscriptions": "YouTube-abonnementen importeren",
|
||||
"Import FreeTube subscriptions (.db)": "FreeTube-abonnementen importeren (.db)",
|
||||
"Import NewPipe subscriptions (.json)": "NewPipe-abonnementen importeren (.json)",
|
||||
"Import NewPipe data (.zip)": "NewPipe-gegevens importeren (.zip)",
|
||||
"Export": "Exporteren",
|
||||
"Export subscriptions as OPML": "Exporteer abonnees als OPML",
|
||||
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Exporteer abonnees als OPML (voor NewPipe & FreeTube)",
|
||||
"Export data as JSON": "Exporteer gegevens als JSON",
|
||||
"Delete account?": "Verwijder account?",
|
||||
"Export subscriptions as OPML": "Abonnementen exporteren als OPML",
|
||||
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Abonnementen exporteren als OPML (voor NewPipe en FreeTube)",
|
||||
"Export data as JSON": "Gegevens exporteren als JSON",
|
||||
"Delete account?": "Wil je je account verwijderen?",
|
||||
"History": "Geschiedenis",
|
||||
"An alternative front-end to YouTube": "Een alternatieve front-end voor YouTube",
|
||||
"JavaScript license information": "JavaScript licentie informatie",
|
||||
"An alternative front-end to YouTube": "Een alternatief front-end voor YouTube",
|
||||
"JavaScript license information": "JavaScript-licentieinformatie",
|
||||
"source": "bron",
|
||||
"Log in": "Inloggen",
|
||||
"Log in/register": "Inloggen/Registreren",
|
||||
"Log in with Google": "Inloggen op Google",
|
||||
"User ID": "Gebruiker ID",
|
||||
"Log in with Google": "Inloggen met Google",
|
||||
"User ID": "Gebruikers-id",
|
||||
"Password": "Wachtwoord",
|
||||
"Time (h:mm:ss):": "Tijd (h:mm:ss):",
|
||||
"Text CAPTCHA": "Tekst CAPTCHA",
|
||||
"Image CAPTCHA": "Afbeelding CAPTCHA",
|
||||
"Sign In": "Aanmelden",
|
||||
"Text CAPTCHA": "Tekst-CAPTCHA",
|
||||
"Image CAPTCHA": "Afbeelding-CAPTCHA",
|
||||
"Sign In": "Inloggen",
|
||||
"Register": "Registreren",
|
||||
"E-mail": "Email",
|
||||
"Google verification code": "Google verificatie code",
|
||||
"Preferences": "Voorkeuren",
|
||||
"Player preferences": "Afspeler voorkeuren",
|
||||
"E-mail": "E-mailadres",
|
||||
"Google verification code": "Google-verificatiecode",
|
||||
"Preferences": "Instellingen",
|
||||
"Player preferences": "Spelerinstellingen",
|
||||
"Always loop: ": "Altijd herhalen: ",
|
||||
"Autoplay: ": "Automatisch afspelen: ",
|
||||
"Play next by default: ": "",
|
||||
"Autoplay next video: ": "Automatisch volgende video afspelen: ",
|
||||
"Play next by default: ": "Standaard volgende video afspelen: ",
|
||||
"Autoplay next video: ": "Volgende video automatisch afspelen: ",
|
||||
"Listen by default: ": "Standaard luisteren: ",
|
||||
"Proxy videos? ": "",
|
||||
"Default speed: ": "Standaard snelheid: ",
|
||||
"Preferred video quality: ": "Video kwaliteit voorkeur: ",
|
||||
"Player volume: ": "Afspeler volume: ",
|
||||
"Default comments: ": "Standaard reacties: ",
|
||||
"youtube": "",
|
||||
"reddit": "",
|
||||
"Default captions: ": "Standaard ondertitels: ",
|
||||
"Fallback captions: ": "Alternatieve ondertitels: ",
|
||||
"Show related videos? ": "Laat gerelateerde videos zien? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Visual preferences": "Visuele voorkeuren",
|
||||
"Proxy videos? ": "Video's afspelen via proxy? ",
|
||||
"Default speed: ": "Standaard afspeelsnelheid: ",
|
||||
"Preferred video quality: ": "Voorkeurskwaliteit: ",
|
||||
"Player volume: ": "Spelervolume: ",
|
||||
"Default comments: ": "Reacties tonen van: ",
|
||||
"youtube": "YouTube",
|
||||
"reddit": "Reddit",
|
||||
"Default captions: ": "Standaard ondertiteling: ",
|
||||
"Fallback captions: ": "Alternatieve ondertiteling: ",
|
||||
"Show related videos? ": "Gerelateerde video's tonen? ",
|
||||
"Show annotations by default? ": "Standaard annotaties tonen? ",
|
||||
"Visual preferences": "Visuele instellingen",
|
||||
"Dark mode: ": "Donkere modus: ",
|
||||
"Thin mode: ": "Smalle modus: ",
|
||||
"Subscription preferences": "Abonnement voorkeuren",
|
||||
"Show annotations by default for subscribed channels? ": "",
|
||||
"Subscription preferences": "Abonnementsinstellingen",
|
||||
"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 videos te zien in feed: ",
|
||||
"Sort videos by: ": "Sorteer videos op: ",
|
||||
"published": "gepubliceerd",
|
||||
"published - reverse": "gepubliceerd - omgekeerd",
|
||||
"Number of videos shown in feed: ": "Aantal te tonen video's in feed: ",
|
||||
"Sort videos by: ": "Video's sorteren op: ",
|
||||
"published": "publicatiedatum",
|
||||
"published - reverse": "publicatiedatum - omgekeerd",
|
||||
"alphabetically": "alfabetische volgorde",
|
||||
"alphabetically - reverse": "alfabetisch - omgekeerd",
|
||||
"channel name": "kanaal naam",
|
||||
"channel name - reverse": "kanaal naam - omgekeerd",
|
||||
"Only show latest video from channel: ": "Laat alleen laatste video van kanaal zien: ",
|
||||
"Only show latest unwatched video from channel: ": "Laat alleen de laatste onbekeken video zien van kanaal: ",
|
||||
"Only show unwatched: ": "Laat alleen onbekeken videos zien: ",
|
||||
"Only show notifications (if there are any): ": "Laat alleen notificaties zien (als die er zijn): ",
|
||||
"Data preferences": "Gegevens voorkeuren",
|
||||
"alphabetically - reverse": "alfabetische volgorde - omgekeerd",
|
||||
"channel name": "kanaalnaam",
|
||||
"channel name - reverse": "kanaalnaam - omgekeerd",
|
||||
"Only show latest video from channel: ": "Alleen nieuwste video van kanaal tonen: ",
|
||||
"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": "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": "Importeer/Exporteer gegevens",
|
||||
"Change password": "",
|
||||
"Manage subscriptions": "Abonnees beheren",
|
||||
"Manage tokens": "",
|
||||
"Import/export data": "Gegevens im-/exporteren",
|
||||
"Change password": "Wachtwoord wijzigen",
|
||||
"Manage subscriptions": "Abonnementen beheren",
|
||||
"Manage tokens": "Toegangssleutels beheren",
|
||||
"Watch history": "Kijkgeschiedenis",
|
||||
"Delete account": "Account verwijderen",
|
||||
"Administrator preferences": "",
|
||||
"Default homepage: ": "",
|
||||
"Feed menu: ": "",
|
||||
"Top enabled? ": "",
|
||||
"CAPTCHA enabled? ": "",
|
||||
"Login enabled? ": "",
|
||||
"Registration enabled? ": "",
|
||||
"Report statistics? ": "",
|
||||
"Save preferences": "Opslaan voorkeuren",
|
||||
"Subscription manager": "Abonnees beheerder",
|
||||
"Token manager": "",
|
||||
"Token": "",
|
||||
"`x` subscriptions": "`x` abonnees",
|
||||
"`x` tokens": "",
|
||||
"Import/export": "Importeer/Exporteer",
|
||||
"unsubscribe": "abonnement opzeggen",
|
||||
"revoke": "",
|
||||
"Subscriptions": "Abonnees",
|
||||
"`x` unseen notifications": "`x` onbekeken notificaties",
|
||||
"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? ",
|
||||
"Save preferences": "Instellingen opslaan",
|
||||
"Subscription manager": "Abonnementen beheren",
|
||||
"Token manager": "Toegangssleutels beheren",
|
||||
"Token": "Toegangssleutel",
|
||||
"`x` subscriptions": "`x` abonnementen",
|
||||
"`x` tokens": "`x` toegangssleutels",
|
||||
"Import/export": "Importeren/Exporteren",
|
||||
"unsubscribe": "Deabonneren",
|
||||
"revoke": "Intrekken",
|
||||
"Subscriptions": "Abonnementen",
|
||||
"`x` unseen notifications": "`x` ongelezen meldingen",
|
||||
"search": "zoeken",
|
||||
"Log out": "Afmelden",
|
||||
"Released under the AGPLv3 by Omar Roth.": "Uitgegeven onder AGPLv3 door Omar Roth.",
|
||||
"Source available here.": "Bron beschikbaar hier.",
|
||||
"View JavaScript license information.": "Bekijk JavaScript licentie informatie.",
|
||||
"View privacy policy.": "",
|
||||
"Trending": "Trending",
|
||||
"Unlisted": "",
|
||||
"Watch on YouTube": "Bekijk video op Youtube",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Log out": "Uitloggen",
|
||||
"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",
|
||||
"Unlisted": "Verborgen",
|
||||
"Watch on YouTube": "Video bekijken op YouTube",
|
||||
"Hide annotations": "Annotaties verbergen",
|
||||
"Show annotations": "Annotaties tonen",
|
||||
"Genre: ": "Genre: ",
|
||||
"License: ": "Licentie: ",
|
||||
"Family friendly? ": "Gezinsvriendelijk? ",
|
||||
"Wilson score: ": "Wilson score: ",
|
||||
"Wilson score: ": "Wilson-score: ",
|
||||
"Engagement: ": "Betrokkenheid: ",
|
||||
"Whitelisted regions: ": "Toegestane regio's: ",
|
||||
"Blacklisted regions: ": "Geblokkeerde regio's: ",
|
||||
"Shared `x`": "`x` gedeeld",
|
||||
"`x` views": "",
|
||||
"Premieres in `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 uit hebt staan. Klik hier om de reacties te bekijken, hou er rekening mee dat het wat langer duurt om te laden.",
|
||||
"View YouTube comments": "Bekijk YouTube reacties",
|
||||
"View more comments on Reddit": "Bekijk meer reacties op Reddit",
|
||||
"View `x` comments": "`x` reacties zien",
|
||||
"View Reddit comments": "Bekijk Reddit reacties",
|
||||
"Hide replies": "Verberg antwoorden",
|
||||
"Show replies": "Laat antwoorden zien",
|
||||
"Incorrect password": "Onjuist wachtwoord",
|
||||
"Quota exceeded, try again in a few hours": "Quota overschreden, probeer het over een paar uur opnieuw",
|
||||
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "Niet in staat om in te loggen, zorg ervoor dat two-factor authentication (Authenticator of SMS) is ingeschakeld.",
|
||||
"Invalid TFA code": "Onjuiste TFA code",
|
||||
"Login failed. This may be because two-factor authentication is not turned on for your account.": "Aanmelden mislukt. Dit kan zijn omdat two-factor authentication niet is ingeschakeld voor uw account.",
|
||||
"`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",
|
||||
"View `x` comments": "`x` reacties tonen",
|
||||
"View Reddit comments": "Reddit-reacties tonen",
|
||||
"Hide replies": "Antwoorden verbergen",
|
||||
"Show replies": "Antwoorden tonen",
|
||||
"Incorrect password": "Wachtwoord is onjuist",
|
||||
"Quota exceeded, try again in a few hours": "Quota overschreden; probeer het over een paar uur opnieuw",
|
||||
"Unable to log in, make sure two-factor authentication (Authenticator or SMS) is turned on.": "Kan niet inloggen. Zorg ervoor dat authenticatie in twee stappen (Authenticator of sms) is ingeschakeld.",
|
||||
"Invalid TFA code": "Onjuiste TFA-code",
|
||||
"Login failed. This may be because two-factor authentication is not turned on for your account.": "Inloggen mislukt. Wellicht is authenticatie in twee stappen niet ingeschakeld op je account.",
|
||||
"Wrong answer": "Onjuist antwoord",
|
||||
"Erroneous CAPTCHA": "Onjuiste CAPTCHA",
|
||||
"CAPTCHA is a required field": "CAPTCHA is een vereist veld",
|
||||
"User ID is a required field": "Gebruiker ID is een vereist veld",
|
||||
"Password is a required field": "Wachtwoord is een vereist veld",
|
||||
"Wrong username or password": "Ongeldige gebruikersnaam of wachtwoord",
|
||||
"Please sign in using 'Log in with Google'": "Meld u aan met 'Aanmelden met Google'",
|
||||
"Password cannot be empty": "Wachtwoord mag niet leeg zijn",
|
||||
"Password cannot be longer than 55 characters": "Wachtwoord mag niet langer dan 55 tekens zijn",
|
||||
"Please log in": "Meld u aan",
|
||||
"Invidious Private Feed for `x`": "Invidious Privé Feed voor `x`",
|
||||
"CAPTCHA is a required field": "CAPTCHA is vereist",
|
||||
"User ID is a required field": "Gebruikers-id is vereist",
|
||||
"Password is a required field": "Wachtwoord is vereist",
|
||||
"Wrong username or password": "Onjuiste gebruikersnaam of wachtwoord",
|
||||
"Please sign in using 'Log in with Google'": "Log in via 'Inloggen met Google'",
|
||||
"Password cannot be empty": "Het wachtwoordveld mag niet leeg zijn",
|
||||
"Password cannot be longer than 55 characters": "Het wachtwoord mag niet langer dan 55 tekens zijn",
|
||||
"Please log in": "Log in",
|
||||
"Invidious Private Feed for `x`": "Invidious-privéfeed van `x`",
|
||||
"channel:`x`": "kanaal:`x`",
|
||||
"Deleted or invalid channel": "Verwijderd of ongeldig kanaal",
|
||||
"Deleted or invalid channel": "Verwijderd of niet-bestaand kanaal",
|
||||
"This channel does not exist.": "Dit kanaal bestaat niet.",
|
||||
"Could not get channel info.": "Kan kanaal informatie niet verkrijgen.",
|
||||
"Could not fetch comments": "Kan reacties niet verkrijgen",
|
||||
"View `x` replies": "`x` antwoorden zien",
|
||||
"Could not get channel info.": "Kan geen kanaalinformatie ophalen.",
|
||||
"Could not fetch comments": "Kan reacties niet ophalen",
|
||||
"View `x` replies": "`x` antwoorden tonen",
|
||||
"`x` ago": "`x` geleden",
|
||||
"Load more": "Meer laden",
|
||||
"`x` points": "`x` punten",
|
||||
"Could not create mix.": "Kon mix niet maken.",
|
||||
"Empty playlist": "Afspeellijst is leeg",
|
||||
"Could not create mix.": "Kan geen mix maken.",
|
||||
"Empty playlist": "Lege afspeellijst",
|
||||
"Not a playlist.": "Ongeldige afspeellijst.",
|
||||
"Playlist does not exist.": "Afspeellijst bestaat niet.",
|
||||
"Could not pull trending pages.": "Kon trending paginas niet verkrijgen.",
|
||||
"Hidden field \"challenge\" is a required field": "Verborgen veld \"uitdaging\" is een vereist veld",
|
||||
"Hidden field \"token\" is a required field": "Verborgen veld \"token\" is een vereist veld",
|
||||
"Could not pull trending pages.": "Kan uitgelichte pagina's niet ophalen.",
|
||||
"Hidden field \"challenge\" is a required field": "Verborgen veld \"uitdaging\" is vereist",
|
||||
"Hidden field \"token\" is a required field": "Verborgen veld \"toegangssleutel\" is vereist",
|
||||
"Erroneous challenge": "Ongeldige uitdaging",
|
||||
"Erroneous token": "Ongeldige token",
|
||||
"No such user": "Ongeldige gebruiker",
|
||||
"Token is expired, please try again": "Token is verlopen, probeer het opnieuw",
|
||||
"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": "",
|
||||
"Erroneous token": "Ongeldige toegangssleutel",
|
||||
"No such user": "Gebruiker bestaat niet",
|
||||
"Token is expired, please try again": "Toegangssleutel verlopen; probeer het opnieuw",
|
||||
"English": "Engels",
|
||||
"English (auto-generated)": "Engels (automatisch gegenereerd)",
|
||||
"Afrikaans": "Afrikaans",
|
||||
"Albanian": "Albanees",
|
||||
"Amharic": "Amhaars",
|
||||
"Arabic": "Arabisch",
|
||||
"Armenian": "Armeens",
|
||||
"Azerbaijani": "Azerbeidzjaans",
|
||||
"Bangla": "Bangla",
|
||||
"Basque": "Baskisch",
|
||||
"Belarusian": "Wit-Rrussisch",
|
||||
"Bosnian": "Bosnisch",
|
||||
"Bulgarian": "Bulgaars",
|
||||
"Burmese": "Birmaans",
|
||||
"Catalan": "Catalaans",
|
||||
"Cebuano": "Cebuano",
|
||||
"Chinese (Simplified)": "Chinees (Veereenvoudigd)",
|
||||
"Chinese (Traditional)": "Chinees (Traditioneel)",
|
||||
"Corsican": "Corsicaans",
|
||||
"Croatian": "Kroatisch",
|
||||
"Czech": "Tsjechisch",
|
||||
"Danish": "Deens",
|
||||
"Dutch": "Nederlands",
|
||||
"Esperanto": "Esperanto",
|
||||
"Estonian": "Ests",
|
||||
"Filipino": "Filipijns",
|
||||
"Finnish": "Fins",
|
||||
"French": "Frans",
|
||||
"Galician": "Galicisch",
|
||||
"Georgian": "Georgisch",
|
||||
"German": "Duits",
|
||||
"Greek": "Grieks",
|
||||
"Gujarati": "Gujarati",
|
||||
"Haitian Creole": "Creools",
|
||||
"Hausa": "Hausa",
|
||||
"Hawaiian": "Hawaïaans",
|
||||
"Hebrew": "Heebreeuws",
|
||||
"Hindi": "Hindi",
|
||||
"Hmong": "Hmong",
|
||||
"Hungarian": "Hongaars",
|
||||
"Icelandic": "IJslands",
|
||||
"Igbo": "Igbo",
|
||||
"Indonesian": "Indonesisch",
|
||||
"Irish": "Iers",
|
||||
"Italian": "Italiaans",
|
||||
"Japanese": "Japans",
|
||||
"Javanese": "Javaans",
|
||||
"Kannada": "Kannada",
|
||||
"Kazakh": "Kazachs",
|
||||
"Khmer": "Khmer",
|
||||
"Korean": "Koreaans",
|
||||
"Kurdish": "Koerdisch",
|
||||
"Kyrgyz": "Kirgizisch",
|
||||
"Lao": "Laotiaans",
|
||||
"Latin": "Latijns",
|
||||
"Latvian": "Lets",
|
||||
"Lithuanian": "Litouws",
|
||||
"Luxembourgish": "Luxemburgs",
|
||||
"Macedonian": "Macedonisch",
|
||||
"Malagasy": "Malagassisch",
|
||||
"Malay": "Maleisisch",
|
||||
"Malayalam": "Malayalam",
|
||||
"Maltese": "Maltees",
|
||||
"Maori": "Maorisch",
|
||||
"Marathi": "Marathi",
|
||||
"Mongolian": "Mongools",
|
||||
"Nepali": "Nepalees",
|
||||
"Norwegian Bokmål": "Noors (Bokmål)",
|
||||
"Nyanja": "Nyanja",
|
||||
"Pashto": "Pashto",
|
||||
"Persian": "Perzisch",
|
||||
"Polish": "Pools",
|
||||
"Portuguese": "Portugees",
|
||||
"Punjabi": "Punjabi",
|
||||
"Romanian": "Roemeens",
|
||||
"Russian": "Russisch",
|
||||
"Samoan": "Samoaans",
|
||||
"Scottish Gaelic": "Schots-Gaelisch",
|
||||
"Serbian": "Servisch",
|
||||
"Shona": "Shona",
|
||||
"Sindhi": "Sindhi",
|
||||
"Sinhala": "Sinhala",
|
||||
"Slovak": "Slowaaks",
|
||||
"Slovenian": "Sloveens",
|
||||
"Somali": "Somalisch",
|
||||
"Southern Sotho": "Zuid-Sotho",
|
||||
"Spanish": "Spaans",
|
||||
"Spanish (Latin America)": "Spaans (Latijns-Amerika)",
|
||||
"Sundanese": "Soedanees",
|
||||
"Swahili": "Swahili",
|
||||
"Swedish": "Zweeds",
|
||||
"Tajik": "Tajik",
|
||||
"Tamil": "Tamil",
|
||||
"Telugu": "Telugu",
|
||||
"Thai": "Thaïs",
|
||||
"Turkish": "Turks",
|
||||
"Ukrainian": "Oekraïens",
|
||||
"Urdu": "Urdu",
|
||||
"Uzbek": "Oezbeeks",
|
||||
"Vietnamese": "Vietnamees",
|
||||
"Welsh": "Welsh",
|
||||
"Western Frisian": "Fries",
|
||||
"Xhosa": "Xhosa",
|
||||
"Yiddish": "Joods",
|
||||
"Yoruba": "Yoruba",
|
||||
"Zulu": "Zulu",
|
||||
"`x` years": "`x` jaar",
|
||||
"`x` months": "`x` maanden",
|
||||
"`x` weeks": "`x` weken",
|
||||
@@ -288,27 +293,29 @@
|
||||
"`x` hours": "`x` uur",
|
||||
"`x` minutes": "`x` minuten",
|
||||
"`x` seconds": "`x` seconden",
|
||||
"Fallback comments: ": "",
|
||||
"Popular": "",
|
||||
"Top": "",
|
||||
"About": "",
|
||||
"Rating: ": "",
|
||||
"Language: ": "",
|
||||
"View as playlist": "",
|
||||
"Default": "",
|
||||
"Music": "",
|
||||
"Gaming": "",
|
||||
"News": "",
|
||||
"Movies": "",
|
||||
"Download": "",
|
||||
"Download as: ": "",
|
||||
"%A %B %-d, %Y": "",
|
||||
"(edited)": "",
|
||||
"YouTube comment permalink": "",
|
||||
"`x` marked it with a ❤": "",
|
||||
"Audio mode": "",
|
||||
"Video mode": "",
|
||||
"Videos": "",
|
||||
"Playlists": "",
|
||||
"Current version: ": ""
|
||||
"Fallback comments: ": "Terugvallen op",
|
||||
"Popular": "Populair",
|
||||
"Top": "Top",
|
||||
"About": "Over",
|
||||
"Rating: ": "Waardering",
|
||||
"Language: ": "Taal",
|
||||
"View as playlist": "Tonen als afspeellijst",
|
||||
"Default": "Standaard",
|
||||
"Music": "Muziek",
|
||||
"Gaming": "Gaming",
|
||||
"News": "Nieuws",
|
||||
"Movies": "Films",
|
||||
"Download": "Downloaden",
|
||||
"Download as: ": "Downloaden als: ",
|
||||
"%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: "
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unsubscribe": "Odsubskrybuj",
|
||||
"Subscribe": "Subskrybuj",
|
||||
"View channel on YouTube": "Wyświetl kanał na YouTube",
|
||||
"View playlist on YouTube": "",
|
||||
"newest": "najnowsze",
|
||||
"oldest": "najstarsze",
|
||||
"popular": "popularne",
|
||||
@@ -84,6 +85,9 @@
|
||||
"Only show latest unwatched video from channel: ": "Pokazuj tylko najnowszy nie obejrzany film z kanału: ",
|
||||
"Only show unwatched: ": "Pokazuj tylko nie obejrzane: ",
|
||||
"Only show notifications (if there are any): ": "Pokazuj tylko powiadomienia (jeśli są): ",
|
||||
"Enable web notifications": "",
|
||||
"`x` uploaded a video": "",
|
||||
"`x` is live": "",
|
||||
"Data preferences": "Preferencje danych",
|
||||
"Clear watch history": "Wyczyść historię",
|
||||
"Import/export data": "Import/Eksport danych",
|
||||
@@ -132,6 +136,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",
|
||||
@@ -305,10 +310,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: "
|
||||
}
|
||||
193
locales/ru.json
193
locales/ru.json
@@ -5,39 +5,40 @@
|
||||
"Shared `x` ago": "Опубликовано `x` назад",
|
||||
"Unsubscribe": "Отписаться",
|
||||
"Subscribe": "Подписаться",
|
||||
"View channel on YouTube": "Канал на YouTube",
|
||||
"newest": "новые",
|
||||
"oldest": "старые",
|
||||
"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": "",
|
||||
"Authorize token?": "",
|
||||
"Authorize token for `x`?": "",
|
||||
"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)",
|
||||
"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",
|
||||
"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",
|
||||
"JavaScript license information": "Информация о лицензиях JavaScript",
|
||||
"source": "источник",
|
||||
"Log in": "Войти",
|
||||
"Log in/register": "Войти/Регистрация",
|
||||
"Log in/register": "Войти или зарегистрироваться",
|
||||
"Log in with Google": "Войти через Google",
|
||||
"User ID": "ID пользователя",
|
||||
"Password": "Пароль",
|
||||
@@ -45,136 +46,140 @@
|
||||
"Text CAPTCHA": "Текст капчи",
|
||||
"Image CAPTCHA": "Изображение капчи",
|
||||
"Sign In": "Войти",
|
||||
"Register": "Регистрация",
|
||||
"E-mail": "Эл. почта",
|
||||
"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: ": "Скорость по умолчанию: ",
|
||||
"Play next by default: ": "Всегда включать следующее видео? ",
|
||||
"Autoplay next video: ": "Автопроигрывание следующего видео: ",
|
||||
"Listen by default: ": "Режим «только аудио» по умолчанию: ",
|
||||
"Proxy videos? ": "Проигрывать видео через прокси? ",
|
||||
"Default speed: ": "Скорость видео по умолчанию: ",
|
||||
"Preferred video quality: ": "Предпочтительное качество видео: ",
|
||||
"Player volume: ": "Громкость воспроизведения: ",
|
||||
"Player volume: ": "Громкость видео: ",
|
||||
"Default comments: ": "Источник комментариев: ",
|
||||
"youtube": "YouTube",
|
||||
"reddit": "Reddit",
|
||||
"Default captions: ": "Субтитры по умолчанию: ",
|
||||
"Fallback captions: ": "Резервные субтитры: ",
|
||||
"Default captions: ": "Основной язык субтитров: ",
|
||||
"Fallback captions: ": "Дополнительный язык субтитров: ",
|
||||
"Show related videos? ": "Показывать похожие видео? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Visual preferences": "Визуальные настройки",
|
||||
"Dark mode: ": "Темная тема: ",
|
||||
"Thin mode: ": "Облегченный режим: ",
|
||||
"Show annotations by default? ": "Всегда показывать аннотации? ",
|
||||
"Visual preferences": "Настройки сайта",
|
||||
"Dark mode: ": "Тёмное оформление: ",
|
||||
"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): ": "Отображать только оповещения (если есть): ",
|
||||
"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": "Очистить историю просмотра",
|
||||
"Clear watch history": "Очистить историю просмотров",
|
||||
"Import/export data": "Импорт/Экспорт данных",
|
||||
"Change password": "",
|
||||
"Manage subscriptions": "Управление подписками",
|
||||
"Manage tokens": "",
|
||||
"Change password": "Изменить пароль",
|
||||
"Manage subscriptions": "Управлять подписками",
|
||||
"Manage tokens": "Управлять токенами",
|
||||
"Watch history": "История просмотров",
|
||||
"Delete account": "Удалить аккаунт",
|
||||
"Administrator preferences": "Настройки администратора",
|
||||
"Administrator preferences": "Администраторские настройки",
|
||||
"Default homepage: ": "Главная страница по умолчанию: ",
|
||||
"Feed menu: ": "Меню ленты: ",
|
||||
"Top enabled? ": "Включить топ? ",
|
||||
"Feed menu: ": "Меню ленты видео: ",
|
||||
"Top enabled? ": "Включить топ видео? ",
|
||||
"CAPTCHA enabled? ": "Включить капчу? ",
|
||||
"Login enabled? ": "Включить логин? ",
|
||||
"Login enabled? ": "Включить авторизацию? ",
|
||||
"Registration enabled? ": "Включить регистрацию? ",
|
||||
"Report statistics? ": "Отображать статистику? ",
|
||||
"Report statistics? ": "Сообщать статистику? ",
|
||||
"Save preferences": "Сохранить настройки",
|
||||
"Subscription manager": "Менеджер подписок",
|
||||
"Token manager": "",
|
||||
"Token": "",
|
||||
"Token manager": "Менеджер токенов",
|
||||
"Token": "Токен",
|
||||
"`x` subscriptions": "`x` подписок",
|
||||
"`x` tokens": "",
|
||||
"Import/export": "Импорт/Экспорт",
|
||||
"`x` tokens": "`x` токенов",
|
||||
"Import/export": "Импорт и экспорт",
|
||||
"unsubscribe": "отписаться",
|
||||
"revoke": "",
|
||||
"revoke": "отозвать",
|
||||
"Subscriptions": "Подписки",
|
||||
"`x` unseen notifications": "`x` новых оповещений",
|
||||
"`x` unseen notifications": "`x` непросмотренных оповещений",
|
||||
"search": "поиск",
|
||||
"Log out": "Выйти",
|
||||
"Released under the AGPLv3 by Omar Roth.": "Распространяется Omar Roth по AGPLv3.",
|
||||
"Released under the AGPLv3 by Omar Roth.": "Реализовано Омаром Ротом по лицензии AGPLv3.",
|
||||
"Source available here.": "Исходный код доступен здесь.",
|
||||
"View JavaScript license information.": "Посмотреть лицензии JavaScript кода.",
|
||||
"View privacy policy.": "См. политику конфиденциальности.",
|
||||
"View JavaScript license information.": "Посмотреть информацию по лицензии JavaScript.",
|
||||
"View privacy policy.": "Посмотреть политику конфиденциальности.",
|
||||
"Trending": "В тренде",
|
||||
"Unlisted": "Доступно по ссылке",
|
||||
"Unlisted": "Нет в списке",
|
||||
"Watch on YouTube": "Смотреть на YouTube",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Hide annotations": "Скрыть аннотации",
|
||||
"Show annotations": "Показать аннотации",
|
||||
"Genre: ": "Жанр: ",
|
||||
"License: ": "Лицензия: ",
|
||||
"Family friendly? ": "Семейный просмотр: ",
|
||||
"Wilson score: ": "Рейтинг Уилсона: ",
|
||||
"Engagement: ": "Вовлеченность: ",
|
||||
"Whitelisted regions: ": "Доступно для: ",
|
||||
"Blacklisted regions: ": "Недоступно для: ",
|
||||
"Engagement: ": "Вовлечённость: ",
|
||||
"Whitelisted regions: ": "Доступно в регионах: ",
|
||||
"Blacklisted regions: ": "Недоступно в регионах: ",
|
||||
"Shared `x`": "Опубликовано `x`",
|
||||
"`x` views": "`x` просмотров / просмотр / просмотра",
|
||||
"`x` views": "`x` просмотров",
|
||||
"Premieres in `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. Нажмите сюда, чтобы увидеть комментарии (учтите, что они могут загружаться дольше).",
|
||||
"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 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 is a required field": "Необходимо ввести капчу",
|
||||
"User ID is a required field": "Необходимо ввести идентификатор пользователя",
|
||||
"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": "Необходимо ввести ID пользователя",
|
||||
"Password is a required field": "Необходимо ввести пароль",
|
||||
"Wrong username or password": "Недопустимый пароль или имя пользователя",
|
||||
"Please sign in using 'Log in with Google'": "Пожалуйста войдите через Google",
|
||||
"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`": "Приватная лента Invidious для `x`",
|
||||
"channel:`x`": "канал: `x`",
|
||||
"Deleted or invalid channel": "Канал удален или не найден",
|
||||
"This channel does not exist.": "Такой канал не существует.",
|
||||
"Could not get channel info.": "Невозможно получить информацию о канале.",
|
||||
"Could not fetch comments": "Невозможно получить комментарии",
|
||||
"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.": "Невозможно создать \"микс\".",
|
||||
"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": "Необходимо заполнить скрытое поле \"токен\"",
|
||||
"Erroneous challenge": "Неправильный ответ в \"challenge\"",
|
||||
"Could not pull trending pages.": "Не удаётся загрузить страницы «в тренде».",
|
||||
"Hidden field \"challenge\" is a required field": "Необходимо заполнить скрытое поле «challenge»",
|
||||
"Hidden field \"token\" is a required field": "Необходимо заполнить скрытое поле «токен»",
|
||||
"Erroneous challenge": "Неправильный ответ в «challenge»",
|
||||
"Erroneous token": "Неправильный токен",
|
||||
"No such user": "Недопустимое имя пользователя",
|
||||
"Token is expired, please try again": "Срок действия токена истек, попробуйте позже",
|
||||
"Token is expired, please try again": "Срок действия токена истёк, попробуйте позже",
|
||||
"English": "Английский",
|
||||
"English (auto-generated)": "Английский (созданы автоматически)",
|
||||
"Afrikaans": "Африкаанс",
|
||||
@@ -305,10 +310,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: ": "Текущая версия: "
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"`x` subscribers": "`x` підписник / підписників / підписника",
|
||||
"`x` subscribers": "`x` підписників",
|
||||
"`x` videos": "`x` відео",
|
||||
"LIVE": "ПРЯМИЙ ЕФІР",
|
||||
"Shared `x` ago": "Розміщено `x` назад",
|
||||
"Unsubscribe": "Відписатися",
|
||||
"Subscribe": "Підписатися",
|
||||
"View channel on YouTube": "Подивитися канал на YouTube",
|
||||
"View playlist on YouTube": "Подивитися плейлист на YouTube",
|
||||
"newest": "найновіше",
|
||||
"oldest": "найстаріше",
|
||||
"popular": "популярне",
|
||||
@@ -13,11 +14,11 @@
|
||||
"Next page": "Наступна сторінка",
|
||||
"Previous page": "Попередня сторінка",
|
||||
"Clear watch history?": "Очистити історію переглядів?",
|
||||
"New password": "",
|
||||
"New passwords must match": "",
|
||||
"Cannot change password for Google accounts": "",
|
||||
"Authorize token?": "",
|
||||
"Authorize token for `x`?": "",
|
||||
"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": "Імпорт і експорт даних",
|
||||
@@ -52,7 +53,7 @@
|
||||
"Player preferences": "Налаштування програвача",
|
||||
"Always loop: ": "Завжди повторювати: ",
|
||||
"Autoplay: ": "Автовідтворення: ",
|
||||
"Play next by default: ": "",
|
||||
"Play next by default: ": "Завжди вмикати наступне відео: ",
|
||||
"Autoplay next video: ": "Автовідтворення наступного відео: ",
|
||||
"Listen by default: ": "Режим «тільки звук» як усталений: ",
|
||||
"Proxy videos? ": "Програвати відео через проксі? ",
|
||||
@@ -60,17 +61,17 @@
|
||||
"Preferred video quality: ": "Пріорітетна якість відео: ",
|
||||
"Player volume: ": "Гучність відео: ",
|
||||
"Default comments: ": "Джерело коментарів: ",
|
||||
"youtube": "",
|
||||
"reddit": "",
|
||||
"youtube": "YouTube",
|
||||
"reddit": "Reddit",
|
||||
"Default captions: ": "Основна мова субтитрів: ",
|
||||
"Fallback captions: ": "Запасна мова субтитрів: ",
|
||||
"Show related videos? ": "Показувати схожі відео? ",
|
||||
"Show annotations by default? ": "",
|
||||
"Show annotations by default? ": "Завжди показувати анотації? ",
|
||||
"Visual preferences": "Налаштування сайту",
|
||||
"Dark mode: ": "Темне оформлення: ",
|
||||
"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: ": "Сортувати відео: ",
|
||||
@@ -84,12 +85,15 @@
|
||||
"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": "",
|
||||
"Change password": "Змінити пароль",
|
||||
"Manage subscriptions": "Керування підписками",
|
||||
"Manage tokens": "",
|
||||
"Manage tokens": "Керувати токенами",
|
||||
"Watch history": "Історія переглядів",
|
||||
"Delete account": "Видалити обліківку",
|
||||
"Administrator preferences": "Адміністраторські налаштування",
|
||||
@@ -102,13 +106,13 @@
|
||||
"Report statistics? ": "Повідомляти статистику? ",
|
||||
"Save preferences": "Зберегти налаштування",
|
||||
"Subscription manager": "Менеджер підписок",
|
||||
"Token manager": "",
|
||||
"Token": "",
|
||||
"Token manager": "Менеджер токенів",
|
||||
"Token": "Токен",
|
||||
"`x` subscriptions": "`x` підписка / підписок / підписки",
|
||||
"`x` tokens": "",
|
||||
"`x` tokens": "`x` токенів",
|
||||
"Import/export": "Імпорт і експорт",
|
||||
"unsubscribe": "відписатися",
|
||||
"revoke": "",
|
||||
"revoke": "скасувати",
|
||||
"Subscriptions": "Підписки",
|
||||
"`x` unseen notifications": "`x` непереглянуте сповіщення / непереглянутих сповіщень / непереглянутих сповіщення",
|
||||
"search": "пошук",
|
||||
@@ -118,10 +122,10 @@
|
||||
"View JavaScript license information.": "Переглянути інформацію щодо ліцензії JavaScript.",
|
||||
"View privacy policy.": "Переглянути політику приватності.",
|
||||
"Trending": "У тренді",
|
||||
"Unlisted": "Відсутнє у листі",
|
||||
"Watch on YouTube": "Дивитися відео на YouTube",
|
||||
"Hide annotations": "",
|
||||
"Show annotations": "",
|
||||
"Unlisted": "Немає в списку",
|
||||
"Watch on YouTube": "Дивитися на YouTube",
|
||||
"Hide annotations": "Приховати анотації",
|
||||
"Show annotations": "Показати анотації",
|
||||
"Genre: ": "Жанр: ",
|
||||
"License: ": "Ліцензія: ",
|
||||
"Family friendly? ": "Перегляд із родиною? ",
|
||||
@@ -130,8 +134,9 @@
|
||||
"Whitelisted regions: ": "Доступно у регіонах: ",
|
||||
"Blacklisted regions: ": "Недоступно у регіонах: ",
|
||||
"Shared `x`": "Розміщено `x`",
|
||||
"`x` views": "",
|
||||
"`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",
|
||||
@@ -150,7 +155,7 @@
|
||||
"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»",
|
||||
"Please sign in using 'Log in with Google'": "Будь ласка, натисніть «Увійти через Google»",
|
||||
"Password cannot be empty": "Пароль не може бути порожнім",
|
||||
"Password cannot be longer than 55 characters": "Пароль не може бути довшим за 55 знаків",
|
||||
"Please log in": "Будь ласка, увійдіть",
|
||||
@@ -281,20 +286,20 @@
|
||||
"Yiddish": "Їдиш",
|
||||
"Yoruba": "Йоруба",
|
||||
"Zulu": "Зулу",
|
||||
"`x` years": "`x` років / рік / роки",
|
||||
"`x` months": "`x` місяців / місяць / місяці",
|
||||
"`x` weeks": "`x` тижнів / тиждень / тижні",
|
||||
"`x` days": "`x` днів / день / дні",
|
||||
"`x` hours": "`x` годин / година / години",
|
||||
"`x` minutes": "`x` хвилин / хвилина / хвилини",
|
||||
"`x` seconds": "`x` секунд / секунду / секунди",
|
||||
"`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": "",
|
||||
"View as playlist": "Дивитися як плейлист",
|
||||
"Default": "Усталено",
|
||||
"Music": "Музика",
|
||||
"Gaming": "Ігри",
|
||||
@@ -305,10 +310,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: ": "Поточна версія: "
|
||||
}
|
||||
321
locales/zh-CN.json
Normal file
321
locales/zh-CN.json
Normal file
@@ -0,0 +1,321 @@
|
||||
{
|
||||
"`x` subscribers": "`x` 订阅者",
|
||||
"`x` videos": "`x` 视频",
|
||||
"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": "视觉选项",
|
||||
"Dark mode: ": "暗色模式:",
|
||||
"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": "时下流行",
|
||||
"Unlisted": "不公开",
|
||||
"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: ": "当前版本:"
|
||||
}
|
||||
BIN
screenshots/native_notification.png
Normal file
BIN
screenshots/native_notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -1,5 +1,5 @@
|
||||
name: invidious
|
||||
version: 0.17.0
|
||||
version: 0.19.0
|
||||
|
||||
authors:
|
||||
- Omar Roth <omarroth@protonmail.com>
|
||||
@@ -9,13 +9,13 @@ targets:
|
||||
main: src/invidious.cr
|
||||
|
||||
dependencies:
|
||||
kemal:
|
||||
github: kemalcr/kemal
|
||||
pg:
|
||||
github: will/crystal-pg
|
||||
sqlite3:
|
||||
github: crystal-lang/crystal-sqlite3
|
||||
kemal:
|
||||
github: kemalcr/kemal
|
||||
|
||||
crystal: 0.28.0
|
||||
crystal: 0.29.0
|
||||
|
||||
license: AGPLv3
|
||||
|
||||
@@ -10,7 +10,7 @@ require "../src/invidious/playlists"
|
||||
require "../src/invidious/search"
|
||||
require "../src/invidious/users"
|
||||
|
||||
describe "Helpers" do
|
||||
describe "Helper" do
|
||||
describe "#produce_channel_videos_url" do
|
||||
it "correctly produces url for requesting page `x` of a channel's videos" do
|
||||
produce_channel_videos_url(ucid: "UCXuqSBlHAE6Xw-yeJA0Tunw").should eq("/browse_ajax?continuation=4qmFsgI8EhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaIEVnWjJhV1JsYjNNd0FqZ0JZQUZxQUxnQkFDQUFlZ0V4&gl=US&hl=en")
|
||||
@@ -93,7 +93,7 @@ describe "Helpers" do
|
||||
":subscriptions/*",
|
||||
"GET:tokens*",
|
||||
],
|
||||
"signature" => "f//2hS20th8pALF305PJFK+D2aVtvefNnQheILHD2vU=",
|
||||
"signature" => "f__2hS20th8pALF305PJFK-D2aVtvefNnQheILHD2vU=",
|
||||
}
|
||||
sign_token("SECRET_KEY", token).should eq(token["signature"])
|
||||
|
||||
|
||||
2579
src/invidious.cr
2579
src/invidious.cr
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,8 @@ end
|
||||
struct ChannelVideo
|
||||
def to_json(locale, config, kemal_config, json : JSON::Builder)
|
||||
json.object do
|
||||
json.field "type", "shortVideo"
|
||||
|
||||
json.field "title", self.title
|
||||
json.field "videoId", self.id
|
||||
json.field "videoThumbnails" do
|
||||
@@ -24,6 +26,8 @@ struct ChannelVideo
|
||||
json.field "authorUrl", "/channel/#{self.ucid}"
|
||||
json.field "published", self.published.to_unix
|
||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale))
|
||||
|
||||
json.field "viewCount", self.views
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,6 +41,48 @@ struct ChannelVideo
|
||||
end
|
||||
end
|
||||
|
||||
def to_xml(locale, host_url, 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
|
||||
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?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("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,
|
||||
@@ -47,6 +93,37 @@ struct ChannelVideo
|
||||
length_seconds: {type: Int32, default: 0},
|
||||
live_now: {type: Bool, default: false},
|
||||
premiere_timestamp: {type: Time?, default: nil},
|
||||
views: {type: Int64?, default: nil},
|
||||
})
|
||||
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: Int64,
|
||||
joined: Time,
|
||||
is_family_friendly: Bool,
|
||||
allowed_regions: Array(String),
|
||||
related_channels: Array(AboutRelatedChannel),
|
||||
tabs: Array(String),
|
||||
})
|
||||
end
|
||||
|
||||
@@ -88,10 +165,8 @@ 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)
|
||||
@@ -155,6 +230,8 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
|
||||
updated = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content)
|
||||
author = entry.xpath_node("author/name").not_nil!.content
|
||||
ucid = entry.xpath_node("channelid").not_nil!.content
|
||||
views = entry.xpath_node("group/community/statistics").try &.["views"]?.try &.to_i64?
|
||||
views ||= 0_i64
|
||||
|
||||
channel_video = videos.select { |video| video.id == video_id }[0]?
|
||||
|
||||
@@ -170,26 +247,37 @@ 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,
|
||||
live_now: live_now,
|
||||
premiere_timestamp: premiere_timestamp
|
||||
premiere_timestamp: premiere_timestamp,
|
||||
views: views,
|
||||
)
|
||||
|
||||
db.exec("UPDATE users SET notifications = notifications || $1 \
|
||||
WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications)", video.id, video.published, ucid)
|
||||
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, ucid, as: String)
|
||||
|
||||
video_array = video.to_a
|
||||
args = arg_array(video_array)
|
||||
|
||||
# We don't include the 'premire_timestamp' here because channel pages don't include them,
|
||||
# We don't include the 'premiere_timestamp' here because channel pages don't include them,
|
||||
# meaning the above timestamp is always null
|
||||
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", video_array)
|
||||
live_now = $8, views = $10", video_array)
|
||||
|
||||
# Update all users affected by insert
|
||||
if emails.empty?
|
||||
values = "'{}'"
|
||||
else
|
||||
values = "VALUES #{emails.map { |id| %(('#{id}')) }.join(",")}"
|
||||
end
|
||||
|
||||
db.exec("UPDATE users SET feed_needs_update = true WHERE email = ANY(#{values})")
|
||||
end
|
||||
|
||||
if pull_all_videos
|
||||
@@ -222,29 +310,42 @@ 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,
|
||||
live_now: video.live_now,
|
||||
premiere_timestamp: video.premiere_timestamp
|
||||
premiere_timestamp: video.premiere_timestamp,
|
||||
views: video.views
|
||||
) }
|
||||
|
||||
videos.each do |video|
|
||||
ids << video.id
|
||||
|
||||
# FIXME: Red videos don't provide published date, so the best we can do is ignore them
|
||||
if Time.now - video.published > 1.minute
|
||||
db.exec("UPDATE users SET notifications = notifications || $1 \
|
||||
WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications)", video.id, video.published, video.ucid)
|
||||
# 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.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)
|
||||
|
||||
video_array = video.to_a
|
||||
args = arg_array(video_array)
|
||||
|
||||
# We don't update the 'premire_timestamp' here because channel pages don't include them
|
||||
db.exec("INSERT INTO channel_videos VALUES (#{args}) \
|
||||
ON CONFLICT (id) DO UPDATE SET title = $2, updated = $4, \
|
||||
ucid = $5, author = $6, length_seconds = $7, live_now = $8", video_array)
|
||||
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)
|
||||
|
||||
# Update all users affected by insert
|
||||
if emails.empty?
|
||||
values = "'{}'"
|
||||
else
|
||||
values = "VALUES #{emails.map { |id| %(('#{id}')) }.join(",")}"
|
||||
end
|
||||
|
||||
db.exec("UPDATE users SET feed_needs_update = true WHERE email = ANY(#{values})")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -259,31 +360,11 @@ 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)
|
||||
|
||||
@@ -347,7 +428,7 @@ def produce_channel_videos_url(ucid, page = 1, auto_generated = nil, sort_by = "
|
||||
if auto_generated
|
||||
seed = Time.unix(1525757349)
|
||||
|
||||
until seed >= Time.now
|
||||
until seed >= Time.utc
|
||||
seed += 1.month
|
||||
end
|
||||
timestamp = seed - (page - 1).months
|
||||
@@ -536,6 +617,307 @@ def extract_channel_playlists_cursor(url, auto_generated)
|
||||
return cursor
|
||||
end
|
||||
|
||||
# TODO: Add "sort_by"
|
||||
def fetch_channel_community(ucid, continuation, locale, config, kemal_config, format, thin_mode)
|
||||
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/68.0.3440.106 Safari/537.36"
|
||||
|
||||
response = client.get("/channel/#{ucid}/community?gl=US&hl=en", headers)
|
||||
if response.status_code == 404
|
||||
response = client.get("/user/#{ucid}/community?gl=US&hl=en", headers)
|
||||
end
|
||||
|
||||
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["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 = 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)
|
||||
|
||||
qualities = {320, 560, 640, 1280, 2000}
|
||||
|
||||
qualities.each do |quality|
|
||||
json.object do
|
||||
json.field "url", thumbnail["url"].as_s.gsub("=s640-", "=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)
|
||||
cursor = URI.escape(cursor)
|
||||
continuation = IO::Memory.new
|
||||
|
||||
continuation.write(Bytes[0xe2, 0xa9, 0x85, 0xb2, 0x02])
|
||||
continuation.write(write_var_int(3 + ucid.size + write_var_int(cursor.size).size + cursor.size))
|
||||
|
||||
continuation.write(Bytes[0x12, ucid.size])
|
||||
continuation.print(ucid)
|
||||
|
||||
continuation.write(Bytes[0x1a])
|
||||
continuation.write(write_var_int(cursor.size))
|
||||
continuation.print(cursor)
|
||||
continuation.rewind
|
||||
|
||||
continuation = Base64.urlsafe_encode(continuation.to_slice)
|
||||
continuation = URI.escape(continuation)
|
||||
|
||||
return continuation
|
||||
end
|
||||
|
||||
def extract_channel_community_cursor(continuation)
|
||||
continuation = URI.unescape(continuation)
|
||||
continuation = Base64.decode(continuation)
|
||||
|
||||
# 0xe2 0xa9 0x85 0xb2 0x02
|
||||
continuation += 5
|
||||
|
||||
total_size = read_var_int(continuation[0, 4])
|
||||
continuation += write_var_int(total_size).size
|
||||
|
||||
# 0x12
|
||||
continuation += 1
|
||||
ucid_size = continuation[0]
|
||||
continuation += 1
|
||||
ucid = continuation[0, ucid_size]
|
||||
continuation += ucid_size
|
||||
|
||||
# 0x1a
|
||||
continuation += 1
|
||||
until continuation[0] == 'E'.ord
|
||||
continuation += 1
|
||||
end
|
||||
|
||||
return String.new(continuation)
|
||||
end
|
||||
|
||||
def get_about_info(ucid, locale)
|
||||
client = make_client(YT_URL)
|
||||
|
||||
@@ -548,14 +930,12 @@ def get_about_info(ucid, locale)
|
||||
|
||||
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
|
||||
|
||||
@@ -566,8 +946,63 @@ def get_about_info(ucid, locale)
|
||||
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 || ""
|
||||
|
||||
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
|
||||
|
||||
total_views = 0_i64
|
||||
sub_count = 0_i64
|
||||
|
||||
joined = Time.unix(0)
|
||||
metadata = about.xpath_nodes(%q(//span[@class="about-stat"]))
|
||||
metadata.each do |item|
|
||||
case item.content
|
||||
when .includes? "views"
|
||||
total_views = item.content.gsub(/\D/, "").to_i64
|
||||
when .includes? "subscribers"
|
||||
sub_count = item.content.delete("subscribers").gsub(/\D/, "").to_i64
|
||||
when .includes? "Joined"
|
||||
joined = Time.parse(item.content.lchop("Joined "), "%b %-d, %Y", Time::Location.local)
|
||||
end
|
||||
end
|
||||
|
||||
# Auto-generated channels
|
||||
# https://support.google.com/youtube/answer/2579942
|
||||
auto_generated = false
|
||||
@@ -576,10 +1011,28 @@ 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 }
|
||||
|
||||
return 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
|
||||
|
||||
@@ -601,7 +1054,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
|
||||
|
||||
@@ -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,14 @@ 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, continuation, 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
|
||||
|
||||
if !continuation || !session_token
|
||||
if !continuation || continuation.empty? || !session_token
|
||||
if format == "json"
|
||||
return {"comments" => [] of String}.to_json
|
||||
else
|
||||
@@ -72,11 +73,10 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
|
||||
end
|
||||
|
||||
post_req = {
|
||||
"session_token" => session_token,
|
||||
session_token: session_token,
|
||||
}
|
||||
post_req = HTTP::Params.encode(post_req)
|
||||
|
||||
client = make_client(YT_URL, proxies, video.info["region"]?)
|
||||
client = make_client(YT_URL, video.info["region"]?)
|
||||
headers = HTTP::Headers.new
|
||||
|
||||
headers["content-type"] = "application/x-www-form-urlencoded"
|
||||
@@ -89,7 +89,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 = client.post("/comment_service_ajax?action_get_comments=1&ctoken=#{continuation}&continuation=#{continuation}&hl=en&gl=US", headers, form: post_req)
|
||||
response = JSON.parse(response.body)
|
||||
|
||||
if !response["response"]["continuationContents"]?
|
||||
@@ -112,10 +112,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 +142,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 +176,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 +197,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 ||= ""
|
||||
@@ -230,15 +223,15 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m
|
||||
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 +239,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 +276,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"]?}' 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 +388,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,7 +558,7 @@ def content_to_comment_html(content)
|
||||
end
|
||||
|
||||
text
|
||||
end.join.rchop('\ufeff')
|
||||
end.join("").delete('\ufeff')
|
||||
|
||||
return comment_html
|
||||
end
|
||||
|
||||
@@ -63,7 +63,7 @@ end
|
||||
|
||||
class FilteredCompressHandler < Kemal::Handler
|
||||
exclude ["/videoplayback", "/videoplayback/*", "/vi/*", "/ggpht/*", "/api/v1/auth/notifications"]
|
||||
exclude ["/data_control"], "POST"
|
||||
exclude ["/api/v1/auth/notifications", "/data_control"], "POST"
|
||||
|
||||
def call(env)
|
||||
return call_next env if exclude_match? env
|
||||
@@ -139,7 +139,8 @@ class APIHandler < Kemal::Handler
|
||||
{% for method in %w(GET POST PUT HEAD DELETE PATCH OPTIONS) %}
|
||||
only ["/api/v1/*"], {{method}}
|
||||
{% end %}
|
||||
exclude ["/api/v1/auth/notifications"]
|
||||
exclude ["/api/v1/auth/notifications"], "GET"
|
||||
exclude ["/api/v1/auth/notifications"], "POST"
|
||||
|
||||
def call(env)
|
||||
return call_next env unless only_match? env
|
||||
@@ -224,3 +225,41 @@ class HTTP::Client
|
||||
response
|
||||
end
|
||||
end
|
||||
|
||||
# https://github.com/will/crystal-pg/pull/171
|
||||
class PG::Statement < ::DB::Statement
|
||||
protected def perform_query(args : Enumerable) : ResultSet
|
||||
params = args.map { |arg| PQ::Param.encode(arg) }
|
||||
conn = self.conn
|
||||
conn.send_parse_message(@sql)
|
||||
conn.send_bind_message params
|
||||
conn.send_describe_portal_message
|
||||
conn.send_execute_message
|
||||
conn.send_sync_message
|
||||
conn.expect_frame PQ::Frame::ParseComplete
|
||||
conn.expect_frame PQ::Frame::BindComplete
|
||||
frame = conn.read
|
||||
case frame
|
||||
when PQ::Frame::RowDescription
|
||||
fields = frame.fields
|
||||
when PQ::Frame::NoData
|
||||
fields = nil
|
||||
else
|
||||
raise "expected RowDescription or NoData, got #{frame}"
|
||||
end
|
||||
ResultSet.new(self, fields)
|
||||
rescue IO::Error
|
||||
raise DB::ConnectionLost.new(connection)
|
||||
end
|
||||
|
||||
protected def perform_exec(args : Enumerable) : ::DB::ExecResult
|
||||
result = perform_query(args)
|
||||
result.each { }
|
||||
::DB::ExecResult.new(
|
||||
rows_affected: result.rows_affected,
|
||||
last_insert_id: 0_i64 # postgres doesn't support this
|
||||
)
|
||||
rescue IO::Error
|
||||
raise DB::ConnectionLost.new(connection)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -96,16 +96,23 @@ struct Config
|
||||
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
|
||||
|
||||
YAML.mapping({
|
||||
channel_threads: Int32, # Number of threads to use for crawling videos from channels (for updating subscriptions)
|
||||
feed_threads: Int32, # Number of threads to use for updating feeds
|
||||
db: NamedTuple( # Database configuration
|
||||
user: String,
|
||||
password: String,
|
||||
host: String,
|
||||
port: Int32,
|
||||
dbname: String,
|
||||
),
|
||||
channel_threads: Int32, # Number of threads to use for crawling videos from channels (for updating subscriptions)
|
||||
feed_threads: Int32, # Number of threads to use for updating feeds
|
||||
db: DBConfig, # Database configuration
|
||||
full_refresh: Bool, # Used for crawling channels: threads should check all videos uploaded by a channel
|
||||
https_only: Bool?, # Used to tell Invidious it is behind a proxy, so links to resources should be https://
|
||||
hmac_key: String?, # HMAC signing key for CSRF tokens and verifying pubsub subscriptions
|
||||
@@ -124,10 +131,22 @@ user: String,
|
||||
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.
|
||||
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'
|
||||
})
|
||||
end
|
||||
|
||||
struct DBConfig
|
||||
yaml_mapping({
|
||||
user: String,
|
||||
password: String,
|
||||
host: String,
|
||||
port: Int32,
|
||||
dbname: String,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -141,7 +160,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
|
||||
@@ -155,40 +174,42 @@ 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)
|
||||
@@ -225,8 +246,7 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
|
||||
author ||= ""
|
||||
author_id ||= ""
|
||||
|
||||
description_html = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-description")]))
|
||||
description_html, description = html_to_content(description_html)
|
||||
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
|
||||
@@ -325,7 +345,6 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
|
||||
author_thumbnail: author_thumbnail,
|
||||
subscriber_count: subscriber_count,
|
||||
video_count: video_count,
|
||||
description: description,
|
||||
description_html: description_html
|
||||
)
|
||||
else
|
||||
@@ -341,7 +360,7 @@ def extract_items(nodeset, ucid = nil, author_name = nil)
|
||||
published ||= Time.unix(metadata[0].xpath_node(%q(.//span)).not_nil!["data-timestamp"].to_i64)
|
||||
rescue ex
|
||||
end
|
||||
published ||= Time.now
|
||||
published ||= Time.utc
|
||||
|
||||
begin
|
||||
view_count = metadata[0].content.rchop(" watching").delete(",").try &.to_i64?
|
||||
@@ -391,7 +410,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,
|
||||
@@ -517,7 +535,7 @@ def analyze_table(db, logger, table_name, struct_type = nil)
|
||||
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"))
|
||||
@@ -541,7 +559,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
|
||||
@@ -559,26 +577,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
|
||||
@@ -628,3 +649,188 @@ def cache_annotation(db, id, annotations)
|
||||
db.exec("INSERT INTO annotations VALUES ($1, $2) ON CONFLICT DO NOTHING", id, annotations)
|
||||
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
|
||||
|
||||
def create_notification_stream(env, config, kemal_config, decrypt_function, topics, connection_channel)
|
||||
connection = Channel(PQ::Notification).new(8)
|
||||
connection_channel.send({true, connection})
|
||||
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
||||
since = env.params.query["since"]?.try &.to_i?
|
||||
id = 0
|
||||
|
||||
if topics.includes? "debug"
|
||||
spawn do
|
||||
begin
|
||||
loop do
|
||||
time_span = [0, 0, 0, 0]
|
||||
time_span[rand(4)] = rand(30) + 5
|
||||
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)
|
||||
video.published = published
|
||||
response = JSON.parse(video.to_json(locale, config, kemal_config, decrypt_function))
|
||||
|
||||
if fields_text = env.params.query["fields"]?
|
||||
begin
|
||||
JSONFilter.filter(response, fields_text)
|
||||
rescue ex
|
||||
env.response.status_code = 400
|
||||
response = {"error" => ex.message}
|
||||
end
|
||||
end
|
||||
|
||||
env.response.puts "id: #{id}"
|
||||
env.response.puts "data: #{response.to_json}"
|
||||
env.response.puts
|
||||
env.response.flush
|
||||
|
||||
id += 1
|
||||
|
||||
sleep 1.minute
|
||||
Fiber.yield
|
||||
end
|
||||
rescue ex
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
spawn do
|
||||
begin
|
||||
if since
|
||||
topics.try &.each do |topic|
|
||||
case topic
|
||||
when .match(/UC[A-Za-z0-9_-]{22}/)
|
||||
PG_DB.query_all("SELECT * FROM channel_videos WHERE ucid = $1 AND published > $2 ORDER BY published DESC LIMIT 15",
|
||||
topic, Time.unix(since.not_nil!), as: ChannelVideo).each do |video|
|
||||
response = JSON.parse(video.to_json(locale, config, Kemal.config))
|
||||
|
||||
if fields_text = env.params.query["fields"]?
|
||||
begin
|
||||
JSONFilter.filter(response, fields_text)
|
||||
rescue ex
|
||||
env.response.status_code = 400
|
||||
response = {"error" => ex.message}
|
||||
end
|
||||
end
|
||||
|
||||
env.response.puts "id: #{id}"
|
||||
env.response.puts "data: #{response.to_json}"
|
||||
env.response.puts
|
||||
env.response.flush
|
||||
|
||||
id += 1
|
||||
end
|
||||
else
|
||||
# TODO
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
spawn do
|
||||
begin
|
||||
loop do
|
||||
event = connection.receive
|
||||
|
||||
notification = JSON.parse(event.payload)
|
||||
topic = notification["topic"].as_s
|
||||
video_id = notification["videoId"].as_s
|
||||
published = notification["published"].as_i64
|
||||
|
||||
if !topics.try &.includes? topic
|
||||
next
|
||||
end
|
||||
|
||||
video = get_video(video_id, PG_DB)
|
||||
video.published = Time.unix(published)
|
||||
response = JSON.parse(video.to_json(locale, config, Kemal.config, decrypt_function))
|
||||
|
||||
if fields_text = env.params.query["fields"]?
|
||||
begin
|
||||
JSONFilter.filter(response, fields_text)
|
||||
rescue ex
|
||||
env.response.status_code = 400
|
||||
response = {"error" => ex.message}
|
||||
end
|
||||
end
|
||||
|
||||
env.response.puts "id: #{id}"
|
||||
env.response.puts "data: #{response.to_json}"
|
||||
env.response.puts
|
||||
env.response.flush
|
||||
|
||||
id += 1
|
||||
end
|
||||
rescue ex
|
||||
ensure
|
||||
connection_channel.send({false, connection})
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
# Send heartbeat
|
||||
loop do
|
||||
env.response.puts ":keepalive #{Time.utc.to_unix}"
|
||||
env.response.puts
|
||||
env.response.flush
|
||||
sleep (20 + rand(11)).seconds
|
||||
end
|
||||
rescue ex
|
||||
ensure
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
def refresh_channels(db, logger, max_threads = 1, full_refresh = false)
|
||||
def refresh_channels(db, logger, config)
|
||||
max_channel = Channel(Int32).new
|
||||
|
||||
spawn do
|
||||
@@ -20,14 +20,14 @@ def refresh_channels(db, logger, max_threads = 1, full_refresh = false)
|
||||
active_threads += 1
|
||||
spawn do
|
||||
begin
|
||||
channel = fetch_channel(id, db, full_refresh)
|
||||
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,22 +36,22 @@ def refresh_channels(db, logger, max_threads = 1, full_refresh = false)
|
||||
end
|
||||
|
||||
sleep 1.minute
|
||||
Fiber.yield
|
||||
end
|
||||
end
|
||||
|
||||
max_channel.send(max_threads)
|
||||
max_channel.send(config.channel_threads)
|
||||
end
|
||||
|
||||
def refresh_feeds(db, logger, max_threads = 1)
|
||||
def refresh_feeds(db, logger, config)
|
||||
max_channel = Channel(Int32).new
|
||||
|
||||
spawn do
|
||||
max_threads = max_channel.receive
|
||||
active_threads = 0
|
||||
active_channel = Channel(Bool).new
|
||||
|
||||
loop do
|
||||
db.query("SELECT email FROM users") do |rs|
|
||||
db.query("SELECT email FROM users WHERE feed_needs_update = true OR feed_needs_update IS NULL") do |rs|
|
||||
rs.each do
|
||||
email = rs.read(String)
|
||||
view_name = "subscriptions_#{sha256(email)}"
|
||||
@@ -69,33 +69,37 @@ def refresh_feeds(db, logger, max_threads = 1)
|
||||
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? "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
|
||||
|
||||
db.exec("REFRESH MATERIALIZED VIEW #{view_name}")
|
||||
db.exec("UPDATE users SET feed_needs_update = false WHERE email = $1", email)
|
||||
rescue ex
|
||||
# Rename old views
|
||||
begin
|
||||
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 = ANY ((SELECT subscriptions FROM users WHERE email = E'#{email.gsub("'", "\\'")}')::text[]) \
|
||||
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
|
||||
@@ -105,11 +109,12 @@ def refresh_feeds(db, logger, max_threads = 1)
|
||||
end
|
||||
end
|
||||
|
||||
sleep 1.minute
|
||||
sleep 5.seconds
|
||||
Fiber.yield
|
||||
end
|
||||
end
|
||||
|
||||
max_channel.send(max_threads)
|
||||
max_channel.send(config.feed_threads)
|
||||
end
|
||||
|
||||
def subscribe_to_feeds(db, logger, key, config)
|
||||
@@ -145,7 +150,7 @@ def subscribe_to_feeds(db, logger, key, config)
|
||||
response = subscribe_pubsub(ucid, key, config)
|
||||
|
||||
if response.status_code >= 400
|
||||
logger.write("#{ucid} : #{response.body}\n")
|
||||
logger.puts("#{ucid} : #{response.body}")
|
||||
end
|
||||
rescue ex
|
||||
end
|
||||
@@ -156,6 +161,7 @@ def subscribe_to_feeds(db, logger, key, config)
|
||||
end
|
||||
|
||||
sleep 1.minute
|
||||
Fiber.yield
|
||||
end
|
||||
end
|
||||
|
||||
@@ -168,12 +174,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
|
||||
|
||||
@@ -188,22 +198,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
|
||||
|
||||
@@ -211,12 +222,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
|
||||
|
||||
@@ -231,5 +243,6 @@ def find_working_proxies(regions)
|
||||
end
|
||||
|
||||
sleep 1.minute
|
||||
Fiber.yield
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
macro db_mapping(mapping)
|
||||
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
||||
end
|
||||
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
||||
end
|
||||
|
||||
def to_a
|
||||
return [ {{*mapping.keys.map { |id| "@#{id}".id }}} ]
|
||||
end
|
||||
def to_a
|
||||
return [ {{*mapping.keys.map { |id| "@#{id}".id }}} ]
|
||||
end
|
||||
|
||||
def self.to_type_tuple
|
||||
return { {{*mapping.keys.map { |id| "#{id}" }}} }
|
||||
end
|
||||
def self.to_type_tuple
|
||||
return { {{*mapping.keys.map { |id| "#{id}" }}} }
|
||||
end
|
||||
|
||||
DB.mapping( {{mapping}} )
|
||||
DB.mapping( {{mapping}} )
|
||||
end
|
||||
|
||||
macro json_mapping(mapping)
|
||||
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
||||
end
|
||||
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
||||
end
|
||||
|
||||
def to_a
|
||||
return [ {{*mapping.keys.map { |id| "@#{id}".id }}} ]
|
||||
end
|
||||
def to_a
|
||||
return [ {{*mapping.keys.map { |id| "@#{id}".id }}} ]
|
||||
end
|
||||
|
||||
JSON.mapping( {{mapping}} )
|
||||
YAML.mapping( {{mapping}} )
|
||||
patched_json_mapping( {{mapping}} )
|
||||
YAML.mapping( {{mapping}} )
|
||||
end
|
||||
|
||||
macro yaml_mapping(mapping)
|
||||
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
||||
end
|
||||
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
||||
end
|
||||
|
||||
def to_a
|
||||
return [ {{*mapping.keys.map { |id| "@#{id}".id }}} ]
|
||||
end
|
||||
def to_a
|
||||
return [ {{*mapping.keys.map { |id| "@#{id}".id }}} ]
|
||||
end
|
||||
|
||||
def to_tuple
|
||||
return { {{*mapping.keys.map { |id| "@#{id}".id }}} }
|
||||
end
|
||||
def to_tuple
|
||||
return { {{*mapping.keys.map { |id| "@#{id}".id }}} }
|
||||
end
|
||||
|
||||
YAML.mapping({{mapping}})
|
||||
YAML.mapping({{mapping}})
|
||||
end
|
||||
|
||||
macro templated(filename, template = "template")
|
||||
render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/#{{{template}}}.ecr"
|
||||
render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/#{{{template}}}.ecr"
|
||||
end
|
||||
|
||||
macro rendered(filename)
|
||||
render "src/invidious/views/#{{{filename}}}.ecr"
|
||||
render "src/invidious/views/#{{{filename}}}.ecr"
|
||||
end
|
||||
|
||||
166
src/invidious/helpers/patch_mapping.cr
Normal file
166
src/invidious/helpers/patch_mapping.cr
Normal file
@@ -0,0 +1,166 @@
|
||||
# Overloads https://github.com/crystal-lang/crystal/blob/0.28.0/src/json/from_json.cr#L24
|
||||
def Object.from_json(string_or_io, default) : self
|
||||
parser = JSON::PullParser.new(string_or_io)
|
||||
new parser, default
|
||||
end
|
||||
|
||||
# Adds configurable 'default' to
|
||||
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) %}
|
||||
{% end %}
|
||||
|
||||
{% for key, value in _properties_ %}
|
||||
{% _properties_[key][:key_id] = key.id.gsub(/\?$/, "") %}
|
||||
{% end %}
|
||||
|
||||
{% for key, value in _properties_ %}
|
||||
@{{value[:key_id]}} : {{value[:type]}}{{ (value[:nilable] ? "?" : "").id }}
|
||||
|
||||
{% if value[:setter] == nil ? true : value[:setter] %}
|
||||
def {{value[:key_id]}}=(_{{value[:key_id]}} : {{value[:type]}}{{ (value[:nilable] ? "?" : "").id }})
|
||||
@{{value[:key_id]}} = _{{value[:key_id]}}
|
||||
end
|
||||
{% end %}
|
||||
|
||||
{% if value[:getter] == nil ? true : value[:getter] %}
|
||||
def {{key.id}} : {{value[:type]}}{{ (value[:nilable] ? "?" : "").id }}
|
||||
@{{value[:key_id]}}
|
||||
end
|
||||
{% end %}
|
||||
|
||||
{% if value[:presence] %}
|
||||
@{{value[:key_id]}}_present : Bool = false
|
||||
|
||||
def {{value[:key_id]}}_present?
|
||||
@{{value[:key_id]}}_present
|
||||
end
|
||||
{% end %}
|
||||
{% end %}
|
||||
|
||||
def initialize(%pull : ::JSON::PullParser, default = nil)
|
||||
{% for key, value in _properties_ %}
|
||||
%var{key.id} = nil
|
||||
%found{key.id} = false
|
||||
{% end %}
|
||||
|
||||
%location = %pull.location
|
||||
begin
|
||||
%pull.read_begin_object
|
||||
rescue exc : ::JSON::ParseException
|
||||
raise ::JSON::MappingError.new(exc.message, self.class.to_s, nil, *%location, exc)
|
||||
end
|
||||
while %pull.kind != :end_object
|
||||
%key_location = %pull.location
|
||||
key = %pull.read_object_key
|
||||
case key
|
||||
{% for key, value in _properties_ %}
|
||||
when {{value[:key] || value[:key_id].stringify}}
|
||||
%found{key.id} = true
|
||||
begin
|
||||
%var{key.id} =
|
||||
{% if value[:nilable] || value[:default] != nil %} %pull.read_null_or { {% end %}
|
||||
|
||||
{% if value[:root] %}
|
||||
%pull.on_key!({{value[:root]}}) do
|
||||
{% end %}
|
||||
|
||||
{% if value[:converter] %}
|
||||
{{value[:converter]}}.from_json(%pull)
|
||||
{% elsif value[:type].is_a?(Path) || value[:type].is_a?(Generic) %}
|
||||
{{value[:type]}}.new(%pull)
|
||||
{% else %}
|
||||
::Union({{value[:type]}}).new(%pull)
|
||||
{% end %}
|
||||
|
||||
{% if value[:root] %}
|
||||
end
|
||||
{% end %}
|
||||
|
||||
{% if value[:nilable] || value[:default] != nil %} } {% end %}
|
||||
rescue exc : ::JSON::ParseException
|
||||
raise ::JSON::MappingError.new(exc.message, self.class.to_s, {{value[:key] || value[:key_id].stringify}}, *%key_location, exc)
|
||||
end
|
||||
{% end %}
|
||||
else
|
||||
{% if strict %}
|
||||
raise ::JSON::MappingError.new("Unknown JSON attribute: #{key}", self.class.to_s, nil, *%key_location, nil)
|
||||
{% else %}
|
||||
%pull.skip
|
||||
{% end %}
|
||||
end
|
||||
end
|
||||
%pull.read_next
|
||||
|
||||
{% for key, value in _properties_ %}
|
||||
{% unless value[:nilable] || value[:default] != nil %}
|
||||
if %var{key.id}.nil? && !%found{key.id} && !::Union({{value[:type]}}).nilable?
|
||||
raise ::JSON::MappingError.new("Missing JSON attribute: {{(value[:key] || value[:key_id]).id}}", self.class.to_s, nil, *%location, nil)
|
||||
end
|
||||
{% end %}
|
||||
|
||||
{% if value[:nilable] %}
|
||||
{% if value[:default] != nil %}
|
||||
@{{value[:key_id]}} = %found{key.id} ? %var{key.id} : (default.responds_to?(:{{value[:key_id]}}) ? default.{{value[:key_id]}} : {{value[:default]}})
|
||||
{% else %}
|
||||
@{{value[:key_id]}} = %var{key.id}
|
||||
{% end %}
|
||||
{% elsif value[:default] != nil %}
|
||||
@{{value[:key_id]}} = %var{key.id}.nil? ? (default.responds_to?(:{{value[:key_id]}}) ? default.{{value[:key_id]}} : {{value[:default]}}) : %var{key.id}
|
||||
{% else %}
|
||||
@{{value[:key_id]}} = (%var{key.id}).as({{value[:type]}})
|
||||
{% end %}
|
||||
|
||||
{% if value[:presence] %}
|
||||
@{{value[:key_id]}}_present = %found{key.id}
|
||||
{% end %}
|
||||
{% end %}
|
||||
end
|
||||
|
||||
def to_json(json : ::JSON::Builder)
|
||||
json.object do
|
||||
{% for key, value in _properties_ %}
|
||||
_{{value[:key_id]}} = @{{value[:key_id]}}
|
||||
|
||||
{% unless value[:emit_null] %}
|
||||
unless _{{value[:key_id]}}.nil?
|
||||
{% end %}
|
||||
|
||||
json.field({{value[:key] || value[:key_id].stringify}}) do
|
||||
{% if value[:root] %}
|
||||
{% if value[:emit_null] %}
|
||||
if _{{value[:key_id]}}.nil?
|
||||
nil.to_json(json)
|
||||
else
|
||||
{% end %}
|
||||
|
||||
json.object do
|
||||
json.field({{value[:root]}}) do
|
||||
{% end %}
|
||||
|
||||
{% if value[:converter] %}
|
||||
if _{{value[:key_id]}}
|
||||
{{ value[:converter] }}.to_json(_{{value[:key_id]}}, json)
|
||||
else
|
||||
nil.to_json(json)
|
||||
end
|
||||
{% else %}
|
||||
_{{value[:key_id]}}.to_json(json)
|
||||
{% end %}
|
||||
|
||||
{% if value[:root] %}
|
||||
{% if value[:emit_null] %}
|
||||
end
|
||||
{% end %}
|
||||
end
|
||||
end
|
||||
{% end %}
|
||||
end
|
||||
|
||||
{% unless value[:emit_null] %}
|
||||
end
|
||||
{% end %}
|
||||
{% end %}
|
||||
end
|
||||
end
|
||||
end
|
||||
194
src/invidious/helpers/static_file_handler.cr
Normal file
194
src/invidious/helpers/static_file_handler.cr
Normal 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.unescape(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
|
||||
@@ -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,
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -18,24 +18,13 @@ def elapsed_text(elapsed)
|
||||
"#{(millis * 1000).round(2)}µs"
|
||||
end
|
||||
|
||||
def make_client(url : URI, proxies = {} of String => Array({ip: String, port: Int32}), region = nil)
|
||||
context = nil
|
||||
|
||||
if url.scheme == "https"
|
||||
context = OpenSSL::SSL::Context::Client.new
|
||||
context.add_options(
|
||||
OpenSSL::SSL::Options::ALL |
|
||||
OpenSSL::SSL::Options::NO_SSL_V2 |
|
||||
OpenSSL::SSL::Options::NO_SSL_V3
|
||||
)
|
||||
end
|
||||
|
||||
client = HTTPClient.new(url, context)
|
||||
client.read_timeout = 10.seconds
|
||||
client.connect_timeout = 10.seconds
|
||||
def make_client(url : URI, region = nil)
|
||||
client = HTTPClient.new(url)
|
||||
client.read_timeout = 15.seconds
|
||||
client.connect_timeout = 15.seconds
|
||||
|
||||
if region
|
||||
proxies[region]?.try &.sample(40).each do |proxy|
|
||||
PROXY_LIST[region]?.try &.sample(40).each do |proxy|
|
||||
begin
|
||||
proxy = HTTPProxy.new(proxy_host: proxy[:ip], proxy_port: proxy[:port])
|
||||
client.set_proxy(proxy)
|
||||
@@ -64,8 +53,8 @@ def recode_length_seconds(time)
|
||||
time = time.seconds
|
||||
text = "#{time.minutes.to_s.rjust(2, '0')}:#{time.seconds.to_s.rjust(2, '0')}"
|
||||
|
||||
if time.hours > 0
|
||||
text = "#{time.hours.to_s.rjust(2, '0')}:#{text}"
|
||||
if time.total_hours.to_i > 0
|
||||
text = "#{time.total_hours.to_i.to_s.rjust(2, '0')}:#{text}"
|
||||
end
|
||||
|
||||
text = text.lchop('0')
|
||||
@@ -90,7 +79,7 @@ def decode_time(string)
|
||||
millis = /(?<millis>\d+)ms/.match(string).try &.["millis"].try &.to_f
|
||||
millis ||= 0
|
||||
|
||||
time = hours * 3600 + minutes * 60 + seconds + millis / 1000
|
||||
time = hours * 3600 + minutes * 60 + seconds + millis // 1000
|
||||
end
|
||||
|
||||
return time
|
||||
@@ -99,7 +88,7 @@ end
|
||||
def decode_date(string : String)
|
||||
# String matches 'YYYY'
|
||||
if string.match(/^\d{4}/)
|
||||
return Time.new(string.to_i, 1, 1)
|
||||
return Time.utc(string.to_i, 1, 1)
|
||||
end
|
||||
|
||||
# Try to parse as format Jul 10, 2000
|
||||
@@ -110,9 +99,9 @@ def decode_date(string : String)
|
||||
|
||||
case string
|
||||
when "today"
|
||||
return Time.now
|
||||
return Time.utc
|
||||
when "yesterday"
|
||||
return Time.now - 1.day
|
||||
return Time.utc - 1.day
|
||||
end
|
||||
|
||||
# String matches format "20 hours ago", "4 months ago"...
|
||||
@@ -138,18 +127,18 @@ def decode_date(string : String)
|
||||
raise "Could not parse #{string}"
|
||||
end
|
||||
|
||||
return Time.now - delta
|
||||
return Time.utc - delta
|
||||
end
|
||||
|
||||
def recode_date(time : Time, locale)
|
||||
span = Time.now - time
|
||||
span = Time.utc - time
|
||||
|
||||
if span.total_days > 365.0
|
||||
span = translate(locale, "`x` years", (span.total_days.to_i / 365).to_s)
|
||||
span = translate(locale, "`x` years", (span.total_days.to_i // 365).to_s)
|
||||
elsif span.total_days > 30.0
|
||||
span = translate(locale, "`x` months", (span.total_days.to_i / 30).to_s)
|
||||
span = translate(locale, "`x` months", (span.total_days.to_i // 30).to_s)
|
||||
elsif span.total_days > 7.0
|
||||
span = translate(locale, "`x` weeks", (span.total_days.to_i / 7).to_s)
|
||||
span = translate(locale, "`x` weeks", (span.total_days.to_i // 7).to_s)
|
||||
elsif span.total_hours > 24.0
|
||||
span = translate(locale, "`x` days", (span.total_days.to_i).to_s)
|
||||
elsif span.total_minutes > 60.0
|
||||
@@ -194,11 +183,11 @@ def number_to_short_text(number)
|
||||
|
||||
text = text.rchop(".0")
|
||||
|
||||
if number / 1_000_000_000 != 0
|
||||
if number // 1_000_000_000 != 0
|
||||
text += "B"
|
||||
elsif number / 1_000_000 != 0
|
||||
elsif number // 1_000_000 != 0
|
||||
text += "M"
|
||||
elsif number / 1000 != 0
|
||||
elsif number // 1000 != 0
|
||||
text += "K"
|
||||
end
|
||||
|
||||
@@ -243,7 +232,7 @@ def make_host_url(config, kemal_config)
|
||||
return "#{scheme}#{host}#{port}"
|
||||
end
|
||||
|
||||
def get_referer(env, fallback = "/")
|
||||
def get_referer(env, fallback = "/", unroll = true)
|
||||
referer = env.params.query["referer"]?
|
||||
referer ||= env.request.headers["referer"]?
|
||||
referer ||= fallback
|
||||
@@ -251,16 +240,18 @@ def get_referer(env, fallback = "/")
|
||||
referer = URI.parse(referer)
|
||||
|
||||
# "Unroll" nested referrers
|
||||
loop do
|
||||
if referer.query
|
||||
params = HTTP::Params.parse(referer.query.not_nil!)
|
||||
if params["referer"]?
|
||||
referer = URI.parse(URI.unescape(params["referer"]))
|
||||
if unroll
|
||||
loop do
|
||||
if referer.query
|
||||
params = HTTP::Params.parse(referer.query.not_nil!)
|
||||
if params["referer"]?
|
||||
referer = URI.parse(URI.unescape(params["referer"]))
|
||||
else
|
||||
break
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
@@ -325,3 +316,52 @@ def sha256(text)
|
||||
digest << text
|
||||
return digest.hexdigest
|
||||
end
|
||||
|
||||
def subscribe_pubsub(topic, key, config)
|
||||
case topic
|
||||
when .match(/^UC[A-Za-z0-9_-]{22}$/)
|
||||
topic = "channel_id=#{topic}"
|
||||
when .match(/^(PL|LL|EC|UU|FL|UL|OLAK5uy_)[0-9A-Za-z-_]{10,}$/)
|
||||
# There's a couple missing from the above regex, namely TL and RD, which
|
||||
# don't have feeds
|
||||
topic = "playlist_id=#{topic}"
|
||||
else
|
||||
# TODO
|
||||
end
|
||||
|
||||
client = make_client(PUBSUB_URL)
|
||||
time = Time.utc.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?#{topic}",
|
||||
"hub.verify" => "async",
|
||||
"hub.mode" => "subscribe",
|
||||
"hub.lease_seconds" => "432000",
|
||||
"hub.secret" => key.to_s,
|
||||
}
|
||||
|
||||
return client.post("/subscribe", form: body)
|
||||
end
|
||||
|
||||
def parse_range(range)
|
||||
if !range
|
||||
return 0_i64, nil
|
||||
end
|
||||
|
||||
ranges = range.lchop("bytes=").split(',')
|
||||
ranges.each do |range|
|
||||
start_range, end_range = range.split('-')
|
||||
|
||||
start_range = start_range.to_i64? || 0_i64
|
||||
end_range = end_range.to_i64?
|
||||
|
||||
return start_range, end_range
|
||||
end
|
||||
|
||||
return 0_i64, nil
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ struct MixVideo
|
||||
ucid: String,
|
||||
length_seconds: Int32,
|
||||
index: Int32,
|
||||
mixes: Array(String),
|
||||
rdid: String,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -28,18 +28,13 @@ def fetch_mix(rdid, video_id, cookies = nil, locale = nil)
|
||||
end
|
||||
response = 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 +65,7 @@ def fetch_mix(rdid, video_id, cookies = nil, locale = nil)
|
||||
ucid,
|
||||
length_seconds,
|
||||
index,
|
||||
[rdid]
|
||||
rdid
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
struct PlaylistVideo
|
||||
def to_json(locale, config, kemal_config, json : JSON::Builder)
|
||||
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
|
||||
|
||||
json.field "index", self.index
|
||||
json.field "lengthSeconds", self.length_seconds
|
||||
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 +34,7 @@ struct PlaylistVideo
|
||||
ucid: String,
|
||||
length_seconds: Int32,
|
||||
published: Time,
|
||||
playlists: Array(String),
|
||||
plid: String,
|
||||
index: Int32,
|
||||
live_now: Bool,
|
||||
})
|
||||
@@ -19,7 +47,6 @@ struct Playlist
|
||||
author: String,
|
||||
author_thumbnail: String,
|
||||
ucid: String,
|
||||
description: String,
|
||||
description_html: String,
|
||||
video_count: Int32,
|
||||
views: Int64,
|
||||
@@ -114,8 +141,8 @@ def extract_playlist(plid, nodeset, index)
|
||||
author: author,
|
||||
ucid: ucid,
|
||||
length_seconds: length_seconds,
|
||||
published: Time.now,
|
||||
playlists: [plid],
|
||||
published: Time.utc,
|
||||
plid: plid,
|
||||
index: index + offset,
|
||||
live_now: live_now
|
||||
)
|
||||
@@ -186,9 +213,8 @@ 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 || ""
|
||||
|
||||
# YouTube allows anonymous playlists, so most of this can be empty or optional
|
||||
anchor = document.xpath_node(%q(//ul[@class="pl-header-details"]))
|
||||
@@ -208,7 +234,7 @@ def fetch_playlist(plid, locale)
|
||||
if updated
|
||||
updated = decode_date(updated)
|
||||
else
|
||||
updated = Time.now
|
||||
updated = Time.utc
|
||||
end
|
||||
|
||||
playlist = Playlist.new(
|
||||
@@ -217,7 +243,6 @@ 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,
|
||||
|
||||
@@ -1,4 +1,92 @@
|
||||
struct SearchVideo
|
||||
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")
|
||||
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, xml : XML::Builder | Nil = 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)
|
||||
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 +94,6 @@ struct SearchVideo
|
||||
ucid: String,
|
||||
published: Time,
|
||||
views: Int64,
|
||||
description: String,
|
||||
description_html: String,
|
||||
length_seconds: Int32,
|
||||
live_now: Bool,
|
||||
@@ -25,6 +112,45 @@ 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 "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,
|
||||
@@ -37,13 +163,50 @@ struct SearchPlaylist
|
||||
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("=s176-", "=s#{quality}-")
|
||||
json.field "width", quality
|
||||
json.field "height", quality
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
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,
|
||||
})
|
||||
end
|
||||
@@ -93,8 +256,8 @@ 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)
|
||||
client = make_client(YT_URL, region)
|
||||
if query.empty?
|
||||
return {0, [] of SearchItem}
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
def fetch_trending(trending_type, proxies, region, locale)
|
||||
def fetch_trending(trending_type, region, locale)
|
||||
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/68.0.3440.106 Safari/537.36"
|
||||
@@ -14,14 +14,9 @@ def fetch_trending(trending_type, proxies, region, locale)
|
||||
|
||||
response = 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
|
||||
|
||||
@@ -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)
|
||||
@@ -20,9 +23,10 @@ struct User
|
||||
type: Preferences,
|
||||
converter: PreferencesConverter,
|
||||
},
|
||||
password: String?,
|
||||
token: String,
|
||||
watched: Array(String),
|
||||
password: String?,
|
||||
token: String,
|
||||
watched: Array(String),
|
||||
feed_needs_update: Bool?,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -40,10 +44,10 @@ struct Preferences
|
||||
begin
|
||||
result = [] of String
|
||||
value.read_array do
|
||||
result << value.read_string
|
||||
result << HTML.escape(value.read_string[0, 100])
|
||||
end
|
||||
rescue ex
|
||||
result = [value.read_string, ""]
|
||||
result = [HTML.escape(value.read_string[0, 100]), ""]
|
||||
end
|
||||
|
||||
result
|
||||
@@ -69,11 +73,11 @@ struct Preferences
|
||||
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
|
||||
@@ -83,6 +87,42 @@ struct Preferences
|
||||
end
|
||||
end
|
||||
|
||||
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[0, 100])
|
||||
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
|
||||
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
|
||||
|
||||
json_mapping({
|
||||
annotations: {type: Bool, default: CONFIG.default_user_preferences.annotations},
|
||||
annotations_subscribed: {type: Bool, default: CONFIG.default_user_preferences.annotations_subscribed},
|
||||
@@ -95,13 +135,13 @@ struct Preferences
|
||||
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},
|
||||
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},
|
||||
quality: {type: String, default: CONFIG.default_user_preferences.quality, converter: ProcessString},
|
||||
redirect_feed: {type: Bool, default: CONFIG.default_user_preferences.redirect_feed},
|
||||
related_videos: {type: Bool, default: CONFIG.default_user_preferences.related_videos},
|
||||
sort: {type: String, default: CONFIG.default_user_preferences.sort},
|
||||
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},
|
||||
@@ -114,7 +154,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
|
||||
|
||||
@@ -125,14 +165,11 @@ def get_user(sid, headers, db, refresh = true)
|
||||
ON CONFLICT (email) DO UPDATE SET updated = $1, subscriptions = $3", 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 = ANY ((SELECT subscriptions FROM users WHERE email = E'#{user.email.gsub("'", "\\'")}')::text[]) \
|
||||
ORDER BY published DESC;")
|
||||
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS #{MATERIALIZED_VIEW_SQL.call(user.email)}")
|
||||
rescue ex
|
||||
end
|
||||
end
|
||||
@@ -147,14 +184,11 @@ def get_user(sid, headers, db, refresh = true)
|
||||
ON CONFLICT (email) DO UPDATE SET updated = $1, subscriptions = $3", 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 = ANY ((SELECT subscriptions FROM users WHERE email = E'#{user.email.gsub("'", "\\'")}')::text[]) \
|
||||
ORDER BY published DESC;")
|
||||
db.exec("CREATE MATERIALIZED VIEW #{view_name} AS #{MATERIALIZED_VIEW_SQL.call(user.email)}")
|
||||
rescue ex
|
||||
end
|
||||
end
|
||||
@@ -187,7 +221,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)
|
||||
user = User.new(Time.utc, [] of String, channels, email, CONFIG.default_user_preferences, nil, token, [] of String, true)
|
||||
return user, sid
|
||||
end
|
||||
|
||||
@@ -195,7 +229,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)
|
||||
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
|
||||
@@ -269,3 +303,134 @@ def generate_text_captcha(key, db)
|
||||
tokens: tokens,
|
||||
}
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
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 = {
|
||||
session_token: session_token,
|
||||
}
|
||||
post_url = "/subscription_ajax?#{action}=1&c=#{channel_id}"
|
||||
|
||||
client.post(post_url, headers, form: post_req)
|
||||
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", 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
|
||||
|
||||
if !limit
|
||||
videos = videos[0..max_results]
|
||||
end
|
||||
|
||||
return videos, notifications
|
||||
end
|
||||
|
||||
@@ -182,7 +182,7 @@ VIDEO_FORMATS = {
|
||||
"135" => {"ext" => "mp4", "height" => 480, "format" => "DASH video", "vcodec" => "h264"},
|
||||
"136" => {"ext" => "mp4", "height" => 720, "format" => "DASH video", "vcodec" => "h264"},
|
||||
"137" => {"ext" => "mp4", "height" => 1080, "format" => "DASH video", "vcodec" => "h264"},
|
||||
"138" => {"ext" => "mp4", "format" => "DASH video", "vcodec" => "h264"}, # Height can vary (https=>//github.com/rg3/youtube-dl/issues/4559)
|
||||
"138" => {"ext" => "mp4", "format" => "DASH video", "vcodec" => "h264"}, # Height can vary (https://github.com/ytdl-org/youtube-dl/issues/4559)
|
||||
"160" => {"ext" => "mp4", "height" => 144, "format" => "DASH video", "vcodec" => "h264"},
|
||||
"212" => {"ext" => "mp4", "height" => 480, "format" => "DASH video", "vcodec" => "h264"},
|
||||
"264" => {"ext" => "mp4", "height" => 1440, "format" => "DASH video", "vcodec" => "h264"},
|
||||
@@ -239,12 +239,19 @@ VIDEO_FORMATS = {
|
||||
"249" => {"ext" => "webm", "format" => "DASH audio", "acodec" => "opus", "abr" => 50},
|
||||
"250" => {"ext" => "webm", "format" => "DASH audio", "acodec" => "opus", "abr" => 70},
|
||||
"251" => {"ext" => "webm", "format" => "DASH audio", "acodec" => "opus", "abr" => 160},
|
||||
|
||||
# av01 video only formats sometimes served with "unknown" codecs
|
||||
"394" => {"ext" => "mp4", "height" => 144, "vcodec" => "av01.0.05M.08"},
|
||||
"395" => {"ext" => "mp4", "height" => 240, "vcodec" => "av01.0.05M.08"},
|
||||
"396" => {"ext" => "mp4", "height" => 360, "vcodec" => "av01.0.05M.08"},
|
||||
"397" => {"ext" => "mp4", "height" => 480, "vcodec" => "av01.0.05M.08"},
|
||||
}
|
||||
|
||||
struct VideoPreferences
|
||||
json_mapping({
|
||||
annotations: Bool,
|
||||
autoplay: Bool,
|
||||
comments: Array(String),
|
||||
continue: Bool,
|
||||
continue_autoplay: Bool,
|
||||
controls: Bool,
|
||||
@@ -272,190 +279,209 @@ struct Video
|
||||
end
|
||||
end
|
||||
|
||||
def to_json(locale, config, kemal_config, decrypt_function)
|
||||
JSON.build do |json|
|
||||
json.object do
|
||||
json.field "title", self.title
|
||||
json.field "videoId", self.id
|
||||
json.field "videoThumbnails" do
|
||||
generate_thumbnails(json, self.id, config, kemal_config)
|
||||
end
|
||||
json.field "storyboards" do
|
||||
generate_storyboards(json, self.id, self.storyboards, config, kemal_config)
|
||||
end
|
||||
def to_json(locale, config, kemal_config, decrypt_function, json : JSON::Builder)
|
||||
json.object do
|
||||
json.field "type", "video"
|
||||
|
||||
description_html, description = html_to_content(self.description)
|
||||
json.field "title", self.title
|
||||
json.field "videoId", self.id
|
||||
json.field "videoThumbnails" do
|
||||
generate_thumbnails(json, self.id, config, kemal_config)
|
||||
end
|
||||
json.field "storyboards" do
|
||||
generate_storyboards(json, self.id, self.storyboards, config, kemal_config)
|
||||
end
|
||||
|
||||
json.field "description", description
|
||||
json.field "descriptionHtml", description_html
|
||||
json.field "published", self.published.to_unix
|
||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale))
|
||||
json.field "keywords", self.keywords
|
||||
json.field "description", html_to_content(self.description_html)
|
||||
json.field "descriptionHtml", self.description_html
|
||||
json.field "published", self.published.to_unix
|
||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale))
|
||||
json.field "keywords", self.keywords
|
||||
|
||||
json.field "viewCount", self.views
|
||||
json.field "likeCount", self.likes
|
||||
json.field "dislikeCount", self.dislikes
|
||||
json.field "viewCount", self.views
|
||||
json.field "likeCount", self.likes
|
||||
json.field "dislikeCount", self.dislikes
|
||||
|
||||
json.field "paid", self.paid
|
||||
json.field "premium", self.premium
|
||||
json.field "isFamilyFriendly", self.is_family_friendly
|
||||
json.field "allowedRegions", self.allowed_regions
|
||||
json.field "genre", self.genre
|
||||
json.field "genreUrl", self.genre_url
|
||||
json.field "paid", self.paid
|
||||
json.field "premium", self.premium
|
||||
json.field "isFamilyFriendly", self.is_family_friendly
|
||||
json.field "allowedRegions", self.allowed_regions
|
||||
json.field "genre", self.genre
|
||||
json.field "genreUrl", self.genre_url
|
||||
|
||||
json.field "author", self.author
|
||||
json.field "authorId", self.ucid
|
||||
json.field "authorUrl", "/channel/#{self.ucid}"
|
||||
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}
|
||||
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("=s48-", "=s#{quality}-")
|
||||
json.field "width", quality
|
||||
json.field "height", quality
|
||||
end
|
||||
qualities.each do |quality|
|
||||
json.object do
|
||||
json.field "url", self.author_thumbnail.gsub("=s48-", "=s#{quality}-")
|
||||
json.field "width", quality
|
||||
json.field "height", quality
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.field "subCountText", self.sub_count_text
|
||||
json.field "subCountText", self.sub_count_text
|
||||
|
||||
json.field "lengthSeconds", self.info["length_seconds"].to_i
|
||||
json.field "allowRatings", self.allow_ratings
|
||||
json.field "rating", self.info["avg_rating"].to_f32
|
||||
json.field "isListed", self.is_listed
|
||||
json.field "liveNow", self.live_now
|
||||
json.field "isUpcoming", self.is_upcoming
|
||||
json.field "lengthSeconds", self.info["length_seconds"].to_i
|
||||
json.field "allowRatings", self.allow_ratings
|
||||
json.field "rating", self.info["avg_rating"].to_f32
|
||||
json.field "isListed", self.is_listed
|
||||
json.field "liveNow", self.live_now
|
||||
json.field "isUpcoming", self.is_upcoming
|
||||
|
||||
if self.premiere_timestamp
|
||||
json.field "premiereTimestamp", self.premiere_timestamp.not_nil!.to_unix
|
||||
end
|
||||
if self.premiere_timestamp
|
||||
json.field "premiereTimestamp", self.premiere_timestamp.not_nil!.to_unix
|
||||
end
|
||||
|
||||
if self.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
|
||||
host_url = make_host_url(config, kemal_config)
|
||||
if self.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
|
||||
host_url = make_host_url(config, kemal_config)
|
||||
|
||||
hlsvp = self.player_response["streamingData"]["hlsManifestUrl"].as_s
|
||||
hlsvp = hlsvp.gsub("https://manifest.googlevideo.com", host_url)
|
||||
hlsvp = self.player_response["streamingData"]["hlsManifestUrl"].as_s
|
||||
hlsvp = hlsvp.gsub("https://manifest.googlevideo.com", host_url)
|
||||
|
||||
json.field "hlsUrl", hlsvp
|
||||
end
|
||||
json.field "hlsUrl", hlsvp
|
||||
end
|
||||
|
||||
json.field "dashUrl", "#{make_host_url(config, kemal_config)}/api/manifest/dash/id/#{id}"
|
||||
json.field "dashUrl", "#{make_host_url(config, kemal_config)}/api/manifest/dash/id/#{id}"
|
||||
|
||||
json.field "adaptiveFormats" do
|
||||
json.array do
|
||||
self.adaptive_fmts(decrypt_function).each do |fmt|
|
||||
json.object do
|
||||
json.field "index", fmt["index"]
|
||||
json.field "bitrate", fmt["bitrate"]
|
||||
json.field "init", fmt["init"]
|
||||
json.field "url", fmt["url"]
|
||||
json.field "itag", fmt["itag"]
|
||||
json.field "type", fmt["type"]
|
||||
json.field "clen", fmt["clen"]
|
||||
json.field "lmt", fmt["lmt"]
|
||||
json.field "projectionType", fmt["projection_type"]
|
||||
json.field "adaptiveFormats" do
|
||||
json.array do
|
||||
self.adaptive_fmts(decrypt_function).each do |fmt|
|
||||
json.object do
|
||||
json.field "index", fmt["index"]
|
||||
json.field "bitrate", fmt["bitrate"]
|
||||
json.field "init", fmt["init"]
|
||||
json.field "url", fmt["url"]
|
||||
json.field "itag", fmt["itag"]
|
||||
json.field "type", fmt["type"]
|
||||
json.field "clen", fmt["clen"]
|
||||
json.field "lmt", fmt["lmt"]
|
||||
json.field "projectionType", fmt["projection_type"]
|
||||
|
||||
fmt_info = itag_to_metadata?(fmt["itag"])
|
||||
if fmt_info
|
||||
fps = fmt_info["fps"]?.try &.to_i || fmt["fps"]?.try &.to_i || 30
|
||||
json.field "fps", fps
|
||||
json.field "container", fmt_info["ext"]
|
||||
json.field "encoding", fmt_info["vcodec"]? || fmt_info["acodec"]
|
||||
fmt_info = itag_to_metadata?(fmt["itag"])
|
||||
if fmt_info
|
||||
fps = fmt_info["fps"]?.try &.to_i || fmt["fps"]?.try &.to_i || 30
|
||||
json.field "fps", fps
|
||||
json.field "container", fmt_info["ext"]
|
||||
json.field "encoding", fmt_info["vcodec"]? || fmt_info["acodec"]
|
||||
|
||||
if fmt_info["height"]?
|
||||
json.field "resolution", "#{fmt_info["height"]}p"
|
||||
if fmt_info["height"]?
|
||||
json.field "resolution", "#{fmt_info["height"]}p"
|
||||
|
||||
quality_label = "#{fmt_info["height"]}p"
|
||||
if fps > 30
|
||||
quality_label += "60"
|
||||
end
|
||||
json.field "qualityLabel", quality_label
|
||||
|
||||
if fmt_info["width"]?
|
||||
json.field "size", "#{fmt_info["width"]}x#{fmt_info["height"]}"
|
||||
end
|
||||
quality_label = "#{fmt_info["height"]}p"
|
||||
if fps > 30
|
||||
quality_label += "60"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
json.field "qualityLabel", quality_label
|
||||
|
||||
json.field "formatStreams" do
|
||||
json.array do
|
||||
self.fmt_stream(decrypt_function).each do |fmt|
|
||||
json.object do
|
||||
json.field "url", fmt["url"]
|
||||
json.field "itag", fmt["itag"]
|
||||
json.field "type", fmt["type"]
|
||||
json.field "quality", fmt["quality"]
|
||||
|
||||
fmt_info = itag_to_metadata?(fmt["itag"])
|
||||
if fmt_info
|
||||
fps = fmt_info["fps"]?.try &.to_i || fmt["fps"]?.try &.to_i || 30
|
||||
json.field "fps", fps
|
||||
json.field "container", fmt_info["ext"]
|
||||
json.field "encoding", fmt_info["vcodec"]? || fmt_info["acodec"]
|
||||
|
||||
if fmt_info["height"]?
|
||||
json.field "resolution", "#{fmt_info["height"]}p"
|
||||
|
||||
quality_label = "#{fmt_info["height"]}p"
|
||||
if fps > 30
|
||||
quality_label += "60"
|
||||
end
|
||||
json.field "qualityLabel", quality_label
|
||||
|
||||
if fmt_info["width"]?
|
||||
json.field "size", "#{fmt_info["width"]}x#{fmt_info["height"]}"
|
||||
end
|
||||
if fmt_info["width"]?
|
||||
json.field "size", "#{fmt_info["width"]}x#{fmt_info["height"]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.field "captions" do
|
||||
json.array do
|
||||
self.captions.each do |caption|
|
||||
json.object do
|
||||
json.field "label", caption.name.simpleText
|
||||
json.field "languageCode", caption.languageCode
|
||||
json.field "url", "/api/v1/captions/#{id}?label=#{URI.escape(caption.name.simpleText)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.field "recommendedVideos" do
|
||||
json.array do
|
||||
self.info["rvs"]?.try &.split(",").each do |rv|
|
||||
rv = HTTP::Params.parse(rv)
|
||||
|
||||
if rv["id"]?
|
||||
json.object do
|
||||
json.field "videoId", rv["id"]
|
||||
json.field "title", rv["title"]
|
||||
json.field "videoThumbnails" do
|
||||
generate_thumbnails(json, rv["id"], config, kemal_config)
|
||||
end
|
||||
json.field "author", rv["author"]
|
||||
json.field "lengthSeconds", rv["length_seconds"].to_i
|
||||
json.field "viewCountText", rv["short_view_count_text"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.field "formatStreams" do
|
||||
json.array do
|
||||
self.fmt_stream(decrypt_function).each do |fmt|
|
||||
json.object do
|
||||
json.field "url", fmt["url"]
|
||||
json.field "itag", fmt["itag"]
|
||||
json.field "type", fmt["type"]
|
||||
json.field "quality", fmt["quality"]
|
||||
|
||||
fmt_info = itag_to_metadata?(fmt["itag"])
|
||||
if fmt_info
|
||||
fps = fmt_info["fps"]?.try &.to_i || fmt["fps"]?.try &.to_i || 30
|
||||
json.field "fps", fps
|
||||
json.field "container", fmt_info["ext"]
|
||||
json.field "encoding", fmt_info["vcodec"]? || fmt_info["acodec"]
|
||||
|
||||
if fmt_info["height"]?
|
||||
json.field "resolution", "#{fmt_info["height"]}p"
|
||||
|
||||
quality_label = "#{fmt_info["height"]}p"
|
||||
if fps > 30
|
||||
quality_label += "60"
|
||||
end
|
||||
json.field "qualityLabel", quality_label
|
||||
|
||||
if fmt_info["width"]?
|
||||
json.field "size", "#{fmt_info["width"]}x#{fmt_info["height"]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.field "captions" do
|
||||
json.array do
|
||||
self.captions.each do |caption|
|
||||
json.object do
|
||||
json.field "label", caption.name.simpleText
|
||||
json.field "languageCode", caption.languageCode
|
||||
json.field "url", "/api/v1/captions/#{id}?label=#{URI.escape(caption.name.simpleText)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.field "recommendedVideos" do
|
||||
json.array do
|
||||
self.info["rvs"]?.try &.split(",").each do |rv|
|
||||
rv = HTTP::Params.parse(rv)
|
||||
|
||||
if rv["id"]?
|
||||
json.object do
|
||||
json.field "videoId", rv["id"]
|
||||
json.field "title", rv["title"]
|
||||
json.field "videoThumbnails" do
|
||||
generate_thumbnails(json, rv["id"], config, kemal_config)
|
||||
end
|
||||
json.field "author", rv["author"]
|
||||
json.field "lengthSeconds", rv["length_seconds"].to_i
|
||||
json.field "viewCountText", rv["short_view_count_text"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def to_json(locale, config, kemal_config, decrypt_function, json : JSON::Builder | Nil = nil)
|
||||
if json
|
||||
to_json(locale, config, kemal_config, decrypt_function, json)
|
||||
else
|
||||
JSON.build do |json|
|
||||
to_json(locale, config, kemal_config, decrypt_function, json)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# `description_html` is stored in DB as `description`, which can be
|
||||
# quite confusing. Since it currently isn't very practical to rename
|
||||
# it, we instead define a getter and setter here.
|
||||
def description_html
|
||||
self.description
|
||||
end
|
||||
|
||||
def description_html=(other : String)
|
||||
self.description = other
|
||||
end
|
||||
|
||||
def allow_ratings
|
||||
allow_ratings = player_response["videoDetails"]?.try &.["allowRatings"]?.try &.as_bool
|
||||
|
||||
@@ -721,10 +747,13 @@ struct Video
|
||||
return items
|
||||
end
|
||||
|
||||
url = storyboards.shift
|
||||
url = URI.parse(storyboards.shift)
|
||||
params = HTTP::Params.parse(url.query || "")
|
||||
|
||||
storyboards.each_with_index do |storyboard, i|
|
||||
width, height, count, storyboard_width, storyboard_height, interval, _, sigh = storyboard.split("#")
|
||||
params["sigh"] = sigh
|
||||
url.query = params.to_s
|
||||
|
||||
width = width.to_i
|
||||
height = height.to_i
|
||||
@@ -734,7 +763,7 @@ struct Video
|
||||
storyboard_height = storyboard_height.to_i
|
||||
|
||||
items << {
|
||||
url: "#{url}&sigh=#{sigh}".sub("$L", i).sub("$N", "M$M"),
|
||||
url: url.to_s.sub("$L", i).sub("$N", "M$M"),
|
||||
width: width,
|
||||
height: height,
|
||||
count: count,
|
||||
@@ -782,14 +811,19 @@ struct Video
|
||||
end
|
||||
|
||||
def short_description
|
||||
description = self.description.gsub("<br>", " ")
|
||||
description = description.gsub("<br/>", " ")
|
||||
description = XML.parse_html(description).content[0..200].gsub('"', """).gsub("\n", " ").strip(" ")
|
||||
if description.empty?
|
||||
description = " "
|
||||
short_description = self.description_html.gsub(/(<br>)|(<br\/>|"|\n)/, {
|
||||
"<br>": " ",
|
||||
"<br/>": " ",
|
||||
"\"": """,
|
||||
"\n": " ",
|
||||
})
|
||||
short_description = XML.parse_html(short_description).content[0..200].strip(" ")
|
||||
|
||||
if short_description.empty?
|
||||
short_description = " "
|
||||
end
|
||||
|
||||
return description
|
||||
return short_description
|
||||
end
|
||||
|
||||
def length_seconds
|
||||
@@ -825,30 +859,32 @@ struct Video
|
||||
end
|
||||
|
||||
struct Caption
|
||||
JSON.mapping(
|
||||
name: CaptionName,
|
||||
baseUrl: String,
|
||||
languageCode: String
|
||||
)
|
||||
json_mapping({
|
||||
name: CaptionName,
|
||||
baseUrl: String,
|
||||
languageCode: String,
|
||||
})
|
||||
end
|
||||
|
||||
struct CaptionName
|
||||
JSON.mapping(
|
||||
json_mapping({
|
||||
simpleText: String,
|
||||
)
|
||||
})
|
||||
end
|
||||
|
||||
class VideoRedirect < Exception
|
||||
end
|
||||
|
||||
def get_video(id, db, proxies = {} of String => Array({ip: String, port: Int32}), refresh = true, region = nil, force_refresh = false)
|
||||
if db.query_one?("SELECT EXISTS (SELECT true FROM videos WHERE id = $1)", id, as: Bool) && !region
|
||||
video = db.query_one("SELECT * FROM videos WHERE id = $1", id, as: Video)
|
||||
|
||||
# If record was last updated over 10 minutes ago, refresh (expire param in response lasts for 6 hours)
|
||||
if (refresh && Time.now - video.updated > 10.minutes) || force_refresh
|
||||
def get_video(id, db, refresh = true, region = nil, force_refresh = false)
|
||||
if (video = db.query_one?("SELECT * FROM videos WHERE id = $1", id, as: Video)) && !region
|
||||
# If record was last updated over 10 minutes ago, or video has since premiered,
|
||||
# refresh (expire param in response lasts for 6 hours)
|
||||
if (refresh &&
|
||||
(Time.utc - video.updated > 10.minutes) ||
|
||||
(video.premiere_timestamp && video.premiere_timestamp.as(Time) < Time.utc)) ||
|
||||
force_refresh
|
||||
begin
|
||||
video = fetch_video(id, proxies, region)
|
||||
video = fetch_video(id, region)
|
||||
video_array = video.to_a
|
||||
|
||||
args = arg_array(video_array[1..-1], 2)
|
||||
@@ -863,7 +899,7 @@ def get_video(id, db, proxies = {} of String => Array({ip: String, port: Int32})
|
||||
end
|
||||
end
|
||||
else
|
||||
video = fetch_video(id, proxies, region)
|
||||
video = fetch_video(id, region)
|
||||
video_array = video.to_a
|
||||
|
||||
args = arg_array(video_array)
|
||||
@@ -889,7 +925,7 @@ def extract_polymer_config(body, html)
|
||||
end
|
||||
end
|
||||
|
||||
initial_data = JSON.parse(body.match(/window\["ytInitialData"\] = (?<info>.*?);\n/).try &.["info"] || "{}")
|
||||
initial_data = extract_initial_data(body)
|
||||
|
||||
primary_results = initial_data["contents"]?
|
||||
.try &.["twoColumnWatchNextResults"]?
|
||||
@@ -967,7 +1003,7 @@ def extract_polymer_config(body, html)
|
||||
if published
|
||||
params["published"] = Time.parse(published, "%b %-d, %Y", Time::Location.local).to_unix.to_s
|
||||
else
|
||||
params["published"] = Time.new(1990, 1, 1).to_unix.to_s
|
||||
params["published"] = Time.utc(1990, 1, 1).to_unix.to_s
|
||||
end
|
||||
|
||||
params["description_html"] = "<p></p>"
|
||||
@@ -1067,8 +1103,8 @@ def extract_player_config(body, html)
|
||||
return params
|
||||
end
|
||||
|
||||
def fetch_video(id, proxies, region)
|
||||
client = make_client(YT_URL, proxies, region)
|
||||
def fetch_video(id, region)
|
||||
client = make_client(YT_URL, region)
|
||||
response = client.get("/watch?v=#{id}&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999")
|
||||
|
||||
if md = response.headers["location"]?.try &.match(/v=(?<id>[a-zA-Z0-9_-]{11})/)
|
||||
@@ -1083,9 +1119,9 @@ def fetch_video(id, proxies, region)
|
||||
if info["reason"]? && info["reason"].includes? "your country"
|
||||
bypass_channel = Channel({XML::Node, HTTP::Params} | Nil).new
|
||||
|
||||
proxies.each do |proxy_region, list|
|
||||
PROXY_LIST.each do |proxy_region, list|
|
||||
spawn do
|
||||
client = make_client(YT_URL, proxies, proxy_region)
|
||||
client = make_client(YT_URL, proxy_region)
|
||||
proxy_response = client.get("/watch?v=#{id}&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999")
|
||||
|
||||
proxy_html = XML.parse_html(proxy_response.body)
|
||||
@@ -1101,7 +1137,7 @@ def fetch_video(id, proxies, region)
|
||||
end
|
||||
end
|
||||
|
||||
proxies.size.times do
|
||||
PROXY_LIST.size.times do
|
||||
response = bypass_channel.receive
|
||||
if response
|
||||
html, info = response
|
||||
@@ -1130,37 +1166,32 @@ def fetch_video(id, proxies, region)
|
||||
raise "Video unavailable."
|
||||
end
|
||||
|
||||
if !info["title"]?
|
||||
if !info["title"]? || info["title"].empty?
|
||||
raise "Video unavailable."
|
||||
end
|
||||
|
||||
title = info["title"]
|
||||
author = info["author"]
|
||||
ucid = info["ucid"]
|
||||
author = info["author"]? || ""
|
||||
ucid = info["ucid"]? || ""
|
||||
|
||||
views = html.xpath_node(%q(//meta[@itemprop="interactionCount"]))
|
||||
views = views.try &.["content"].to_i64?
|
||||
views ||= 0_i64
|
||||
.try &.["content"].to_i64? || 0_i64
|
||||
|
||||
likes = html.xpath_node(%q(//button[@title="I like this"]/span))
|
||||
likes = likes.try &.content.delete(",").try &.to_i?
|
||||
likes ||= 0
|
||||
.try &.content.delete(",").try &.to_i? || 0
|
||||
|
||||
dislikes = html.xpath_node(%q(//button[@title="I dislike this"]/span))
|
||||
dislikes = dislikes.try &.content.delete(",").try &.to_i?
|
||||
dislikes ||= 0
|
||||
.try &.content.delete(",").try &.to_i? || 0
|
||||
|
||||
avg_rating = (likes.to_f/(likes.to_f + dislikes.to_f) * 4 + 1)
|
||||
avg_rating = avg_rating.nan? ? 0.0 : avg_rating
|
||||
info["avg_rating"] = "#{avg_rating}"
|
||||
|
||||
description = html.xpath_node(%q(//p[@id="eow-description"]))
|
||||
description = description ? description.to_xml(options: XML::SaveOptions::NO_DECL) : ""
|
||||
|
||||
description_html = html.xpath_node(%q(//p[@id="eow-description"])).try &.to_xml(options: XML::SaveOptions::NO_DECL) || ""
|
||||
wilson_score = ci_lower_bound(likes, likes + dislikes)
|
||||
|
||||
published = html.xpath_node(%q(//meta[@itemprop="datePublished"])).try &.["content"]
|
||||
published ||= Time.now.to_s("%Y-%m-%d")
|
||||
published ||= Time.utc.to_s("%Y-%m-%d")
|
||||
published = Time.parse(published, "%Y-%m-%d", Time::Location.local)
|
||||
|
||||
allowed_regions = html.xpath_node(%q(//meta[@itemprop="regionsAllowed"])).try &.["content"].split(",")
|
||||
@@ -1172,10 +1203,13 @@ def fetch_video(id, proxies, region)
|
||||
genre = html.xpath_node(%q(//meta[@itemprop="genre"])).try &.["content"]
|
||||
genre ||= ""
|
||||
|
||||
genre_url = html.xpath_node(%(//ul[contains(@class, "watch-info-tag-list")]/li/a[text()="#{genre}"])).try &.["href"]
|
||||
genre_url = html.xpath_node(%(//ul[contains(@class, "watch-info-tag-list")]/li/a[text()="#{genre}"])).try &.["href"]?
|
||||
genre_url ||= ""
|
||||
|
||||
# Sometimes YouTube tries to link to invalid/missing channels, so we fix that here
|
||||
# YouTube provides invalid URLs for some genres, so we fix that here
|
||||
case genre
|
||||
when "Comedy"
|
||||
genre_url = "/channel/UCQZ43c4dAA9eXCQuXWu9aTw"
|
||||
when "Education"
|
||||
genre_url = "/channel/UCdxpofrI-dO6oYfsqHDHphw"
|
||||
when "Gaming"
|
||||
@@ -1187,30 +1221,12 @@ def fetch_video(id, proxies, region)
|
||||
when "Trailers"
|
||||
genre_url = "/channel/UClgRkhTL3_hImCAmdLfDE4g"
|
||||
end
|
||||
genre_url ||= ""
|
||||
|
||||
license = html.xpath_node(%q(//h4[contains(text(),"License")]/parent::*/ul/li))
|
||||
if license
|
||||
license = license.content
|
||||
else
|
||||
license = ""
|
||||
end
|
||||
license = html.xpath_node(%q(//h4[contains(text(),"License")]/parent::*/ul/li)).try &.content || ""
|
||||
sub_count_text = html.xpath_node(%q(//span[contains(@class, "yt-subscriber-count")])).try &.["title"]? || "0"
|
||||
author_thumbnail = html.xpath_node(%(//span[@class="yt-thumb-clip"]/img)).try &.["data-thumb"]?.try &.gsub(/^\/\//, "https://") || ""
|
||||
|
||||
sub_count_text = html.xpath_node(%q(//span[contains(@class, "yt-subscriber-count")]))
|
||||
if sub_count_text
|
||||
sub_count_text = sub_count_text["title"]
|
||||
else
|
||||
sub_count_text = "0"
|
||||
end
|
||||
|
||||
author_thumbnail = html.xpath_node(%(//span[@class="yt-thumb-clip"]/img))
|
||||
if author_thumbnail
|
||||
author_thumbnail = author_thumbnail["data-thumb"]
|
||||
else
|
||||
author_thumbnail = ""
|
||||
end
|
||||
|
||||
video = Video.new(id, info, Time.now, title, views, likes, dislikes, wilson_score, published, description,
|
||||
video = Video.new(id, info, Time.utc, title, views, likes, dislikes, wilson_score, published, description_html,
|
||||
nil, author, ucid, allowed_regions, is_family_friendly, genre, genre_url, license, sub_count_text, author_thumbnail)
|
||||
|
||||
return video
|
||||
@@ -1223,15 +1239,16 @@ end
|
||||
def process_video_params(query, preferences)
|
||||
annotations = query["iv_load_policy"]?.try &.to_i?
|
||||
autoplay = query["autoplay"]?.try &.to_i?
|
||||
comments = query["comments"]?.try &.split(",").map { |a| a.downcase }
|
||||
continue = query["continue"]?.try &.to_i?
|
||||
continue_autoplay = query["continue_autoplay"]?.try &.to_i?
|
||||
listen = query["listen"]? && (query["listen"] == "true" || query["listen"] == "1").to_unsafe
|
||||
local = query["local"]? && (query["local"] == "true").to_unsafe
|
||||
local = query["local"]? && (query["local"] == "true" || query["local"] == "1").to_unsafe
|
||||
preferred_captions = query["subtitles"]?.try &.split(",").map { |a| a.downcase }
|
||||
quality = query["quality"]?
|
||||
region = query["region"]?
|
||||
related_videos = query["related_videos"]?
|
||||
speed = query["speed"]?.try &.to_f?
|
||||
related_videos = query["related_videos"]? && (query["related_videos"] == "true" || query["related_videos"] == "1").to_unsafe
|
||||
speed = query["speed"]?.try &.rchop("x").to_f?
|
||||
video_loop = query["loop"]?.try &.to_i?
|
||||
volume = query["volume"]?.try &.to_i?
|
||||
|
||||
@@ -1239,6 +1256,7 @@ def process_video_params(query, preferences)
|
||||
# region ||= preferences.region
|
||||
annotations ||= preferences.annotations.to_unsafe
|
||||
autoplay ||= preferences.autoplay.to_unsafe
|
||||
comments ||= preferences.comments
|
||||
continue ||= preferences.continue.to_unsafe
|
||||
continue_autoplay ||= preferences.continue_autoplay.to_unsafe
|
||||
listen ||= preferences.listen.to_unsafe
|
||||
@@ -1253,6 +1271,7 @@ def process_video_params(query, preferences)
|
||||
|
||||
annotations ||= CONFIG.default_user_preferences.annotations.to_unsafe
|
||||
autoplay ||= CONFIG.default_user_preferences.autoplay.to_unsafe
|
||||
comments ||= CONFIG.default_user_preferences.comments
|
||||
continue ||= CONFIG.default_user_preferences.continue.to_unsafe
|
||||
continue_autoplay ||= CONFIG.default_user_preferences.continue_autoplay.to_unsafe
|
||||
listen ||= CONFIG.default_user_preferences.listen.to_unsafe
|
||||
@@ -1273,6 +1292,14 @@ def process_video_params(query, preferences)
|
||||
related_videos = related_videos == 1
|
||||
video_loop = video_loop == 1
|
||||
|
||||
if CONFIG.disabled?("dash") && quality == "dash"
|
||||
quality = "high"
|
||||
end
|
||||
|
||||
if CONFIG.disabled?("local") && local
|
||||
local = false
|
||||
end
|
||||
|
||||
if query["t"]?
|
||||
video_start = decode_time(query["t"])
|
||||
end
|
||||
@@ -1301,6 +1328,7 @@ def process_video_params(query, preferences)
|
||||
params = VideoPreferences.new(
|
||||
annotations: annotations,
|
||||
autoplay: autoplay,
|
||||
comments: comments,
|
||||
continue: continue,
|
||||
continue_autoplay: continue_autoplay,
|
||||
controls: controls,
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="pure-u-1">
|
||||
<ul>
|
||||
<% scopes.each do |scope| %>
|
||||
<li><%= scope %></li>
|
||||
<li><%= HTML.escape(scope) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,37 +1,57 @@
|
||||
<% 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) %>
|
||||
<% 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 +63,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 +87,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 +96,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 %>
|
||||
|
||||
80
src/invidious/views/community.ecr
Normal file
80
src/invidious/views/community.ecr
Normal file
@@ -0,0 +1,80 @@
|
||||
<% 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">
|
||||
<% 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>
|
||||
@@ -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,7 +52,7 @@
|
||||
</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"/>
|
||||
@@ -72,16 +72,16 @@
|
||||
</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>
|
||||
<% end %>
|
||||
|
||||
<div class="pure-u-1-3" style="text-align:right">
|
||||
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
||||
<%= item.responds_to?(:views) && item.views ? translate(locale, "`x` views", number_to_short_text(item.views || 0)) : "" %>
|
||||
</div>
|
||||
</h5>
|
||||
<% else %>
|
||||
@@ -93,7 +93,7 @@
|
||||
<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) || "") %>">
|
||||
<p class="watched">
|
||||
<a onclick="mark_watched(this)" data-id="<%= item.id %>" href="#">
|
||||
<a onclick="mark_watched(this)" data-id="<%= item.id %>" href="javascript:void(0)">
|
||||
<button type="submit" style="all:unset">
|
||||
<i onmouseenter='this.setAttribute("class", "icon ion-ios-eye-off")'
|
||||
onmouseleave='this.setAttribute("class", "icon ion-ios-eye")'
|
||||
@@ -121,16 +121,16 @@
|
||||
</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>
|
||||
<% end %>
|
||||
|
||||
<div class="pure-u-1-3" style="text-align:right">
|
||||
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
||||
<%= item.responds_to?(:views) && item.views ? translate(locale, "`x` views", number_to_short_text(item.views || 0)) : "" %>
|
||||
</div>
|
||||
</h5>
|
||||
<% end %>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<% 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 %>
|
||||
@@ -40,228 +40,11 @@
|
||||
</video>
|
||||
|
||||
<script>
|
||||
var options = {
|
||||
<% if aspect_ratio %>
|
||||
aspectRatio: "<%= aspect_ratio %>",
|
||||
<% end %>
|
||||
preload: "auto",
|
||||
playbackRates: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0],
|
||||
controlBar: {
|
||||
children: [
|
||||
"playToggle",
|
||||
"volumePanel",
|
||||
"currentTimeDisplay",
|
||||
"timeDivider",
|
||||
"durationDisplay",
|
||||
"progressControl",
|
||||
"remainingTimeDisplay",
|
||||
"captionsButton",
|
||||
"qualitySelector",
|
||||
"playbackRateMenuButton",
|
||||
"fullscreenToggle"
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var shareOptions = {
|
||||
socials: ["fbFeed", "tw", "reddit", "email"],
|
||||
|
||||
url: window.location.href,
|
||||
var player_data = {
|
||||
aspect_ratio: '<%= aspect_ratio %>',
|
||||
title: "<%= video.title.dump_unquoted %>",
|
||||
description: "<%= description %>",
|
||||
image: "<%= thumbnail %>",
|
||||
embedCode: "<iframe id='ivplayer' type='text/html' width='640' height='360' \
|
||||
src='<%= host_url %>/embed/<%= video.id %>?<%= host_params %>' 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
player.on('error', function(event) {
|
||||
if (player.error().code === 2 || player.error().code === 4) {
|
||||
setInterval(setTimeout(function (event) {
|
||||
console.log('An error occured in the player, reloading...');
|
||||
|
||||
var currentTime = player.currentTime();
|
||||
var playbackRate = player.playbackRate();
|
||||
var paused = player.paused();
|
||||
|
||||
player.load();
|
||||
|
||||
if (currentTime > 0.5) {
|
||||
currentTime -= 0.5;
|
||||
}
|
||||
|
||||
player.currentTime(currentTime);
|
||||
player.playbackRate(playbackRate);
|
||||
|
||||
if (!paused) {
|
||||
player.play();
|
||||
}
|
||||
}, 5000), 5000);
|
||||
}
|
||||
});
|
||||
|
||||
<% if params.video_start > 0 || params.video_end > 0 %>
|
||||
player.markers({
|
||||
onMarkerReached: function(marker) {
|
||||
if (marker.text === 'End') {
|
||||
if (player.loop()) {
|
||||
player.markers.prev('Start');
|
||||
} else {
|
||||
player.pause();
|
||||
}
|
||||
}
|
||||
},
|
||||
markers: [
|
||||
{ time: <%= params.video_start %>, text: 'Start' },
|
||||
<% if params.video_end < 0 %>
|
||||
{ time: <%= video.info["length_seconds"].to_f - 0.5 %>, text: 'End' }
|
||||
<% else %>
|
||||
{ time: <%= params.video_end %>, text: 'End' }
|
||||
<% end %>
|
||||
]
|
||||
});
|
||||
|
||||
player.currentTime(<%= params.video_start %>);
|
||||
<% end %>
|
||||
|
||||
player.volume(<%= params.volume.to_f / 100 %>);
|
||||
player.playbackRate(<%= params.speed %>);
|
||||
|
||||
<% if params.autoplay %>
|
||||
var bpb = player.getChild('bigPlayButton');
|
||||
|
||||
if (bpb) {
|
||||
bpb.hide();
|
||||
|
||||
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();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
description: "<%= HTML.escape(video.short_description) %>",
|
||||
thumbnail: "<%= thumbnail %>"
|
||||
}
|
||||
<% end %>
|
||||
|
||||
<% if !params.listen && params.quality == "dash" %>
|
||||
player.httpSourceSelector();
|
||||
<% end %>
|
||||
|
||||
player.vttThumbnails({
|
||||
src: 'api/v1/storyboards/<%= video.id %>?height=90'
|
||||
});
|
||||
|
||||
<% if !params.listen && 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.id %>', true);
|
||||
xhr.send();
|
||||
|
||||
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);
|
||||
|
||||
if (path.href.startsWith('https://www.youtube.com/watch?') && seconds) {
|
||||
path.search += '&t=' + seconds;
|
||||
}
|
||||
|
||||
path = path.pathname + path.search;
|
||||
|
||||
if (target === 'current') {
|
||||
window.location.href = path;
|
||||
} else if (target === 'new') {
|
||||
window.open(path, '_blank');
|
||||
}
|
||||
});
|
||||
<% end %>
|
||||
|
||||
// Since videojs-share can sometimes be blocked, we try to load it last
|
||||
player.share(shareOptions);
|
||||
</script>
|
||||
<script src="/js/player.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<link rel="stylesheet" href="/css/video-js.min.css">
|
||||
<link rel="stylesheet" href="/css/videojs-http-source-selector.css">
|
||||
<link rel="stylesheet" href="/css/videojs.markers.min.css">
|
||||
<link rel="stylesheet" href="/css/videojs-share.css">
|
||||
<link rel="stylesheet" href="/css/videojs-vtt-thumbnails.css">
|
||||
<script src="/js/video.min.js"></script>
|
||||
<script src="/js/videojs-contrib-quality-levels.min.js"></script>
|
||||
<script src="/js/videojs-http-source-selector.min.js"></script>
|
||||
<script src="/js/videojs.hotkeys.min.js"></script>
|
||||
<script src="/js/videojs-markers.min.js"></script>
|
||||
<script src="/js/videojs-share.min.js"></script>
|
||||
<script src="/js/videojs-vtt-thumbnails.min.js"></script>
|
||||
<link rel="stylesheet" href="/css/video-js.min.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/videojs-http-source-selector.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/videojs.markers.min.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/videojs-share.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/videojs-vtt-thumbnails.css?v=<%= ASSET_COMMIT %>">
|
||||
<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>
|
||||
|
||||
<% if params.annotations %>
|
||||
<link rel="stylesheet" href="/css/videojs-youtube-annotations.min.css">
|
||||
<script src="/js/videojs-youtube-annotations.min.js"></script>
|
||||
<link rel="stylesheet" href="/css/videojs-youtube-annotations.min.css?v=<%= ASSET_COMMIT %>">
|
||||
<script src="/js/videojs-youtube-annotations.min.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<% end %>
|
||||
|
||||
<% if params.listen || params.quality != "dash" %>
|
||||
<link rel="stylesheet" href="/css/quality-selector.css">
|
||||
<script src="/js/silvermine-videojs-quality-selector.min.js"></script>
|
||||
<link rel="stylesheet" href="/css/quality-selector.css?v=<%= ASSET_COMMIT %>">
|
||||
<script src="/js/silvermine-videojs-quality-selector.min.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<% end %>
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
<script>
|
||||
var subscribe_data = {
|
||||
ucid: '<%= ucid %>',
|
||||
author: '<%= author %>',
|
||||
sub_count_text: '<%= sub_count_text %>',
|
||||
author: '<%= HTML.escape(author) %>',
|
||||
sub_count_text: '<%= HTML.escape(sub_count_text) %>',
|
||||
csrf_token: '<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>',
|
||||
subscribe_text: '<%= translate(locale, "Subscribe").gsub("'", "\\'") %>',
|
||||
unsubscribe_text: '<%= translate(locale, "Unsubscribe").gsub("'", "\\'") %>'
|
||||
subscribe_text: '<%= HTML.escape(translate(locale, "Subscribe")) %>',
|
||||
unsubscribe_text: '<%= HTML.escape(translate(locale, "Unsubscribe")) %>'
|
||||
}
|
||||
</script>
|
||||
<script src="/js/subscribe_widget.js"></script>
|
||||
<script src="/js/subscribe_widget.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<% else %>
|
||||
<p>
|
||||
<a id="subscribe" class="pure-button pure-button-primary"
|
||||
|
||||
@@ -2,103 +2,43 @@
|
||||
<html lang="<%= env.get("preferences").as(Preferences).locale %>">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="thumbnail" content="<%= thumbnail %>">
|
||||
<%= rendered "components/player_sources" %>
|
||||
<link rel="stylesheet" href="/css/default.css">
|
||||
<title><%= HTML.escape(video.title) %> - Invidious</title>
|
||||
<style>
|
||||
#player {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
min-width: 100%;
|
||||
min-height: 100%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: -100;
|
||||
}
|
||||
</style>
|
||||
<meta charset="utf-8">
|
||||
<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 {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
min-width: 100%;
|
||||
min-height: 100%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: -100;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= rendered "components/player" %>
|
||||
|
||||
<script>
|
||||
<% if plid %>
|
||||
function get_playlist(plid, timeouts = 0) {
|
||||
if (timeouts > 10) {
|
||||
console.log('Failed to pull playlist');
|
||||
return;
|
||||
}
|
||||
|
||||
if (plid.startsWith('RD')) {
|
||||
var plid_url = '/api/v1/mixes/' + plid +
|
||||
'?continuation=<%= video.id %>' +
|
||||
'&format=html&hl=<%= env.get("preferences").as(Preferences).locale %>';
|
||||
} else {
|
||||
var plid_url = '/api/v1/playlists/' + plid +
|
||||
'?continuation=<%= video.id %>' +
|
||||
'&format=html&hl=<%= env.get("preferences").as(Preferences).locale %>';
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('GET', plid_url, true);
|
||||
xhr.send();
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
if (xhr.response.nextVideo) {
|
||||
player.on('ended', function() {
|
||||
location.assign('/watch?v=' + xhr.response.nextVideo +
|
||||
'&list=' + plid +
|
||||
<% if params.listen != preferences.listen %>
|
||||
'&listen=<%= params.listen %>' +
|
||||
<% end %>
|
||||
<% if params.autoplay || params.continue_autoplay %>
|
||||
'&autoplay=1' +
|
||||
<% end %>
|
||||
<% if params.speed != preferences.speed %>
|
||||
'&speed=<%= params.speed %>' +
|
||||
<% end %>
|
||||
''
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
console.log('Pulling playlist timed out.');
|
||||
get_playlist(plid, timeouts + 1);
|
||||
};
|
||||
var video_data = {
|
||||
id: '<%= video.id %>',
|
||||
plid: '<%= plid %>',
|
||||
length_seconds: '<%= video.info["length_seconds"].to_f %>',
|
||||
video_series: <%= video_series.to_json %>,
|
||||
params: <%= params.to_json %>,
|
||||
preferences: <%= preferences.to_json %>,
|
||||
premiere_timestamp: <%= video.premiere_timestamp.try &.to_unix || "null" %>
|
||||
}
|
||||
|
||||
get_playlist('<%= plid %>');
|
||||
<% elsif video_series %>
|
||||
player.on('ended', function() {
|
||||
location.assign('/embed/<%= video_series.shift %>' +
|
||||
<% if !video_series.empty? %>
|
||||
'?playlist=<%= video_series.join(",") %>' +
|
||||
<% end %>
|
||||
<% if params.listen != preferences.listen %>
|
||||
'&listen=<%= params.listen %>' +
|
||||
<% end %>
|
||||
<% if params.autoplay || params.continue_autoplay %>
|
||||
'&autoplay=1' +
|
||||
<% end %>
|
||||
<% if params.speed != preferences.speed %>
|
||||
'&speed=<%= params.speed %>' +
|
||||
<% end %>
|
||||
''
|
||||
);
|
||||
});
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
<%= rendered "components/player" %>
|
||||
<script src="/js/embed.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var watched_data = {
|
||||
csrf_token: '<%= URI.escape(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| %>
|
||||
@@ -27,10 +34,10 @@
|
||||
<% 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">
|
||||
<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="#">
|
||||
<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>
|
||||
@@ -47,45 +54,18 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function mark_unwatched(target) {
|
||||
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||
tile.style.display = "none";
|
||||
var count = document.getElementById('count')
|
||||
count.innerText = count.innerText - 1;
|
||||
|
||||
var url = '/watch_ajax?action_mark_unwatched=1&redirect=false' +
|
||||
'&id=' + target.getAttribute('data-id');
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('POST', url, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status != 200) {
|
||||
count.innerText = count.innerText - 1 + 2;
|
||||
tile.style.display = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<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 %>
|
||||
|
||||
@@ -11,7 +11,63 @@
|
||||
<table id="jslicense-labels1">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/silvermine-videojs-quality-selector.min.js">silvermine-videojs-quality-selector.min.js</a>
|
||||
<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>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="/js/embed.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/notifications.js?v=<%= ASSET_COMMIT %>">notifications.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="/js/notifications.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/player.js?v=<%= ASSET_COMMIT %>">player.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="/js/player.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/silvermine-videojs-quality-selector.min.js?v=<%= ASSET_COMMIT %>">silvermine-videojs-quality-selector.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -25,7 +81,49 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-contrib-quality-levels.min.js">videojs-contrib-quality-levels.min.js</a>
|
||||
<a href="/js/sse.js?v=<%= ASSET_COMMIT %>">sse.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/mpetazzoni/sse.js"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/subscribe_widget.js?v=<%= ASSET_COMMIT %>">subscribe_widget.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="/js/subscribe_widget.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/themes.js?v=<%= ASSET_COMMIT %>">themes.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="/js/themes.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-contrib-quality-levels.min.js?v=<%= ASSET_COMMIT %>">videojs-contrib-quality-levels.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -39,7 +137,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs.hotkeys.min.js">videojs.hotkeys.min.js</a>
|
||||
<a href="/js/videojs.hotkeys.min.js?v=<%= ASSET_COMMIT %>">videojs.hotkeys.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -53,7 +151,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-http-source-selector.min.js">videojs-http-source-selector.min.js</a>
|
||||
<a href="/js/videojs-http-source-selector.min.js?v=<%= ASSET_COMMIT %>">videojs-http-source-selector.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -67,7 +165,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-markers.min.js">videojs-markers.min.js</a>
|
||||
<a href="/js/videojs-markers.min.js?v=<%= ASSET_COMMIT %>">videojs-markers.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -81,7 +179,21 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-share.min.js">videojs-share.min.js</a>
|
||||
<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>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -95,7 +207,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-vtt-thumbnails.min.js">videojs-vtt-thumbnails.min.js</a>
|
||||
<a href="/js/videojs-vtt-thumbnails.min.js?v=<%= ASSET_COMMIT %>">videojs-vtt-thumbnails.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -103,13 +215,13 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="https://github.com/chrisboustead/videojs-vtt-thumbnails"><%= translate(locale, "source") %></a>
|
||||
<a href="https://github.com/omarroth/videojs-vtt-thumbnails"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/videojs-youtube-annotations.min.js">videojs-youtube-annotations.min.js</a>
|
||||
<a href="/js/videojs-youtube-annotations.min.js?v=<%= ASSET_COMMIT %>">videojs-youtube-annotations.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -123,7 +235,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/video.min.js">video.min.js</a>
|
||||
<a href="/js/video.min.js?v=<%= ASSET_COMMIT %>">video.min.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -137,7 +249,7 @@
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/js/watch.js">watch.js</a>
|
||||
<a href="/js/watch.js?v=<%= ASSET_COMMIT %>">watch.js</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -145,7 +257,7 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="/js/watch.js"><%= translate(locale, "source") %></a>
|
||||
<a href="/js/watch.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if password %>
|
||||
<input name="password" type="hidden" value="<%= password %>">
|
||||
<input name="password" type="hidden" value="<%= HTML.escape(password) %>">
|
||||
<% else %>
|
||||
<label for="password"><%= translate(locale, "Password") %> :</label>
|
||||
<input required class="pure-input-1" name="password" type="password" placeholder="<%= translate(locale, "Password") %>">
|
||||
@@ -95,7 +95,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if password %>
|
||||
<input name="password" type="hidden" value="<%= password %>">
|
||||
<input name="password" type="hidden" value="<%= HTML.escape(password) %>">
|
||||
<% else %>
|
||||
<label for="password"><%= translate(locale, "Password") %> :</label>
|
||||
<input required class="pure-input-1" name="password" type="password" placeholder="<%= translate(locale, "Password") %>">
|
||||
|
||||
@@ -15,17 +15,27 @@
|
||||
</div>
|
||||
|
||||
<div class="pure-g h-box">
|
||||
<div class="pure-u-1 pure-u-md-1-4">
|
||||
<a href="/channel/<%= playlist.ucid %>">
|
||||
<b><%= playlist.author %></b>
|
||||
<div class="pure-u-1-3">
|
||||
<a href="https://www.youtube.com/playlist?list=<%= playlist.id %>">
|
||||
<%= translate(locale, "View playlist on YouTube") %>
|
||||
</a>
|
||||
<div class="pure-u-1 pure-md-1-3">
|
||||
<a href="/channel/<%= playlist.ucid %>">
|
||||
<b><%= playlist.author %></b>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-2"></div>
|
||||
</div>
|
||||
|
||||
<div class="h-box">
|
||||
<p><%= playlist.description_html %></p>
|
||||
</div>
|
||||
|
||||
<div class="h-box">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="pure-g">
|
||||
<% videos.each_slice(4) do |slice| %>
|
||||
<% slice.each do |item| %>
|
||||
@@ -36,7 +46,7 @@
|
||||
|
||||
<div class="pure-g h-box">
|
||||
<div class="pure-u-1 pure-u-lg-1-5">
|
||||
<% if page >= 2 %>
|
||||
<% if page > 1 %>
|
||||
<a href="/playlist?list=<%= playlist.id %>&page=<%= page - 1 %>">
|
||||
<%= translate(locale, "Previous page") %>
|
||||
</a>
|
||||
|
||||
@@ -1,36 +1,56 @@
|
||||
<% content_for "header" do %>
|
||||
<title><%= author %> - Invidious</title>
|
||||
<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">
|
||||
<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) %>
|
||||
<% 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-g pure-u-1-3">
|
||||
<div class="pure-u-1 pure-md-1-3">
|
||||
<a href="https://www.youtube.com/channel/<%= ucid %>"><%= translate(locale, "View channel on YouTube") %></a>
|
||||
<a href="https://www.youtube.com/channel/<%= channel.ucid %>/playlists"><%= translate(locale, "View channel on YouTube") %></a>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-md-1-3">
|
||||
<a href="/channel/<%= ucid %>"><%= translate(locale, "Videos") %></a>
|
||||
<a href="/channel/<%= channel.ucid %>"><%= translate(locale, "Videos") %></a>
|
||||
</div>
|
||||
<div class="pure-u-1 pure-md-1-3">
|
||||
<% if !auto_generated %>
|
||||
<% if !channel.auto_generated %>
|
||||
<b><%= translate(locale, "Playlists") %></b>
|
||||
<% 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>
|
||||
<div class="pure-u-1-3"></div>
|
||||
<div class="pure-u-1-3">
|
||||
@@ -40,7 +60,7 @@
|
||||
<% if sort_by == sort %>
|
||||
<b><%= translate(locale, sort) %></b>
|
||||
<% else %>
|
||||
<a href="/channel/<%= ucid %>/playlists?sort_by=<%= sort %>">
|
||||
<a href="/channel/<%= channel.ucid %>/playlists?sort_by=<%= sort %>">
|
||||
<%= translate(locale, sort) %>
|
||||
</a>
|
||||
<% end %>
|
||||
@@ -66,7 +86,7 @@
|
||||
<div class="pure-u-1 pure-u-md-4-5"></div>
|
||||
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
||||
<% if items.size >= 28 %>
|
||||
<a href="/channel/<%= ucid %>/playlists?continuation=<%= continuation %><% if sort_by != "last" %>&sort_by=<%= sort_by %><% end %>">
|
||||
<a href="/channel/<%= channel.ucid %>/playlists?continuation=<%= continuation %><% if sort_by != "last" %>&sort_by=<%= sort_by %><% end %>">
|
||||
<%= translate(locale, "Next page") %>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
@@ -35,7 +35,7 @@ function update_value(element) {
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="local"><%= translate(locale, "Proxy videos? ") %></label>
|
||||
<input name="local" id="local" type="checkbox" <% if preferences.local %>checked<% end %>>
|
||||
<input name="local" id="local" type="checkbox" <% if preferences.local && !CONFIG.disabled?("local") %>checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>>
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
@@ -56,7 +56,9 @@ function update_value(element) {
|
||||
<label for="quality"><%= translate(locale, "Preferred video quality: ") %></label>
|
||||
<select name="quality" id="quality">
|
||||
<% {"dash", "hd720", "medium", "small"}.each do |option| %>
|
||||
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
|
||||
<% if !(option == "dash" && CONFIG.disabled?("dash")) %>
|
||||
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
@@ -165,6 +167,13 @@ function update_value(element) {
|
||||
<label for="notifications_only"><%= translate(locale, "Only show notifications (if there are any): ") %></label>
|
||||
<input name="notifications_only" id="notifications_only" type="checkbox" <% if preferences.notifications_only %>checked<% end %>>
|
||||
</div>
|
||||
|
||||
<% # Web notifications are only supported over HTTPS %>
|
||||
<% if Kemal.config.ssl || config.https_only %>
|
||||
<div class="pure-control-group">
|
||||
<a href="#" onclick="Notification.requestPermission()"><%= translate(locale, "Enable web notifications") %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if env.get?("user") && config.admins.includes? env.get?("user").as(User).email %>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<div class="pure-g h-box">
|
||||
<div class="pure-u-1 pure-u-lg-1-5">
|
||||
<% if page >= 2 %>
|
||||
<% if page > 1 %>
|
||||
<a href="/search?q=<%= HTML.escape(query.not_nil!) %>&page=<%= page - 1 %>">
|
||||
<%= translate(locale, "Previous page") %>
|
||||
</a>
|
||||
|
||||
@@ -65,10 +65,9 @@ function remove_subscription(target) {
|
||||
'&c=' + target.getAttribute('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=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
@@ -78,5 +77,7 @@ function remove_subscription(target) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var watched_data = {
|
||||
csrf_token: '<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>',
|
||||
}
|
||||
</script>
|
||||
<script src="/js/watched_widget.js"></script>
|
||||
|
||||
<div class="pure-g">
|
||||
<% videos.each_slice(4) do |slice| %>
|
||||
<% slice.each do |item| %>
|
||||
@@ -53,34 +60,10 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function mark_watched(target) {
|
||||
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||
tile.style.display = 'none';
|
||||
|
||||
var url = '/watch_ajax?action_mark_watched=1&redirect=false' +
|
||||
'&id=' + target.getAttribute('data-id');
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('POST', url, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status != 200) {
|
||||
tile.style.display = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="pure-g h-box">
|
||||
<div class="pure-u-1 pure-u-lg-1-5">
|
||||
<% if page >= 2 %>
|
||||
<a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page - 1 %>">
|
||||
<% if page > 1 %>
|
||||
<a href="/feed/subscriptions?page=<%= page - 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
|
||||
<%= translate(locale, "Previous page") %>
|
||||
</a>
|
||||
<% end %>
|
||||
@@ -88,7 +71,7 @@ function mark_watched(target) {
|
||||
<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 + notifications.size) == max_results %>
|
||||
<a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page + 1 %>">
|
||||
<a href="/feed/subscriptions?page=<%= page + 1 %><% if env.params.query["max_results"]? %>&max_results=<%= max_results %><% end %>">
|
||||
<%= translate(locale, "Next page") %>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
@@ -6,23 +6,20 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<%= yield_content "header" %>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#575757">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="manifest" href="/site.webmanifest?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=<%= ASSET_COMMIT %>" color="#575757">
|
||||
<meta name="msapplication-TileColor" content="#575757">
|
||||
<meta name="theme-color" content="#575757">
|
||||
<link title="Invidious" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml">
|
||||
<link rel="stylesheet" href="/css/pure-min.css">
|
||||
<link rel="stylesheet" href="/css/grids-responsive-min.css">
|
||||
<link rel="stylesheet" href="/css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="/css/default.css">
|
||||
<% if env.get("preferences").as(Preferences).dark_mode %>
|
||||
<link rel="stylesheet" href="/css/darktheme.css">
|
||||
<% else %>
|
||||
<link rel="stylesheet" href="/css/lighttheme.css">
|
||||
<% end %>
|
||||
<link rel="stylesheet" href="/css/pure-min.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/grids-responsive-min.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/ionicons.min.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/default.css?v=<%= ASSET_COMMIT %>">
|
||||
<link rel="stylesheet" href="/css/darktheme.css?v=<%= ASSET_COMMIT %>" id="dark_theme" <% if !env.get("preferences").as(Preferences).dark_mode %>media="none"<% end %>>
|
||||
<link rel="stylesheet" href="/css/lighttheme.css?v=<%= ASSET_COMMIT %>" id="light_theme" <% if env.get("preferences").as(Preferences).dark_mode %>media="none"<% end %>>
|
||||
</head>
|
||||
|
||||
<% locale = LOCALES[env.get("preferences").as(Preferences).locale]? %>
|
||||
@@ -45,7 +42,7 @@
|
||||
<div class="pure-u-1 pure-u-md-8-24 user-field">
|
||||
<% if env.get? "user" %>
|
||||
<div class="pure-u-1-4">
|
||||
<a href="/toggle_theme?referer=<%= env.get?("current_page") %>" class="pure-menu-heading">
|
||||
<a id="toggle_theme" href="/toggle_theme?referer=<%= env.get?("current_page") %>" class="pure-menu-heading">
|
||||
<% if env.get("preferences").as(Preferences).dark_mode %>
|
||||
<i class="icon ion-ios-sunny"></i>
|
||||
<% else %>
|
||||
@@ -54,10 +51,10 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="pure-u-1-4">
|
||||
<a title="<%= translate(locale, "Subscriptions") %>" href="/feed/subscriptions" class="pure-menu-heading">
|
||||
<a id="notification_ticker" title="<%= translate(locale, "Subscriptions") %>" href="/feed/subscriptions" class="pure-menu-heading">
|
||||
<% notification_count = env.get("user").as(User).notifications.size %>
|
||||
<% if notification_count > 0 %>
|
||||
<%= notification_count %> <i class="icon ion-ios-notifications"></i>
|
||||
<span id="notification_count"><%= notification_count %></span> <i class="icon ion-ios-notifications"></i>
|
||||
<% else %>
|
||||
<i class="icon ion-ios-notifications-outline"></i>
|
||||
<% end %>
|
||||
@@ -78,7 +75,7 @@
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="pure-u-1-3">
|
||||
<a href="/toggle_theme?referer=<%= env.get?("current_page") %>" class="pure-menu-heading">
|
||||
<a id="toggle_theme" href="/toggle_theme?referer=<%= env.get?("current_page") %>" class="pure-menu-heading">
|
||||
<% if env.get("preferences").as(Preferences).dark_mode %>
|
||||
<i class="icon ion-ios-sunny"></i>
|
||||
<% else %>
|
||||
@@ -153,6 +150,17 @@
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-2-24"></div>
|
||||
</div>
|
||||
<script src="/js/themes.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<% if env.get? "user" %>
|
||||
<script src="/js/sse.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<script>
|
||||
var notification_data = {
|
||||
upload_text: '<%= HTML.escape(translate(locale, "`x` uploaded a video")) %>',
|
||||
live_upload_text: '<%= HTML.escape(translate(locale, "`x` is live")) %>',
|
||||
}
|
||||
</script>
|
||||
<script src="/js/notifications.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<% end %>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -57,10 +57,9 @@ function revoke_token(target) {
|
||||
'&session=' + target.getAttribute('data-session');
|
||||
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=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
@@ -70,5 +69,7 @@ function revoke_token(target) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<% content_for "header" do %>
|
||||
<meta name="thumbnail" content="<%= thumbnail %>">
|
||||
<meta name="description" content="<%= description %>">
|
||||
<meta name="description" content="<%= video.short_description %>">
|
||||
<meta name="keywords" content="<%= video.keywords.join(",") %>">
|
||||
<meta property="og:site_name" content="Invidious">
|
||||
<meta property="og:url" content="<%= host_url %>/watch?v=<%= video.id %>">
|
||||
<meta property="og:title" content="<%= HTML.escape(video.title) %>">
|
||||
<meta property="og:image" content="/vi/<%= video.id %>/maxres.jpg">
|
||||
<meta property="og:description" content="<%= description %>">
|
||||
<meta property="og:description" content="<%= video.short_description %>">
|
||||
<meta property="og:type" content="video.other">
|
||||
<meta property="og:video:url" content="<%= host_url %>/embed/<%= video.id %>">
|
||||
<meta property="og:video:secure_url" content="<%= host_url %>/embed/<%= video.id %>">
|
||||
@@ -17,16 +17,34 @@
|
||||
<meta name="twitter:site" content="@omarroth1">
|
||||
<meta name="twitter:url" content="<%= host_url %>/watch?v=<%= video.id %>">
|
||||
<meta name="twitter:title" content="<%= HTML.escape(video.title) %>">
|
||||
<meta name="twitter:description" content="<%= description %>">
|
||||
<meta name="twitter:description" content="<%= video.short_description %>">
|
||||
<meta name="twitter:image" content="<%= host_url %>/vi/<%= video.id %>/maxres.jpg">
|
||||
<meta name="twitter:player" content="<%= host_url %>/embed/<%= video.id %>">
|
||||
<meta name="twitter:player:width" content="1280">
|
||||
<meta name="twitter:player:height" content="720">
|
||||
<script src="/js/watch.js"></script>
|
||||
<%= rendered "components/player_sources" %>
|
||||
<title><%= HTML.escape(video.title) %> - Invidious</title>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
var video_data = {
|
||||
id: '<%= video.id %>',
|
||||
plid: '<%= plid %>',
|
||||
length_seconds: <%= video.info["length_seconds"].to_f %>,
|
||||
play_next: <%= !rvs.empty? && !plid && params.continue %>,
|
||||
next_video: '<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>',
|
||||
youtube_comments_text: '<%= HTML.escape(translate(locale, "View YouTube comments")) %>',
|
||||
reddit_comments_text: '<%= HTML.escape(translate(locale, "View Reddit comments")) %>',
|
||||
reddit_permalink_text: '<%= HTML.escape(translate(locale, "View more comments on Reddit")) %>',
|
||||
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")) %>',
|
||||
params: <%= params.to_json %>,
|
||||
preferences: <%= preferences.to_json %>,
|
||||
premiere_timestamp: <%= video.premiere_timestamp.try &.to_unix || "null" %>
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="player-container" class="h-box">
|
||||
<%= rendered "components/player" %>
|
||||
</div>
|
||||
@@ -55,15 +73,19 @@
|
||||
<h3>
|
||||
<%= reason %>
|
||||
</h3>
|
||||
<% elsif video.premiere_timestamp %>
|
||||
<h3>
|
||||
<%= translate(locale, "Premieres in `x`", recode_date((video.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>
|
||||
</h3>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1 pure-u-lg-1-5">
|
||||
<div class="h-box">
|
||||
<p>
|
||||
<span>
|
||||
<a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch on YouTube") %></a>
|
||||
</p>
|
||||
</span>
|
||||
<p>
|
||||
<% if params.annotations %>
|
||||
<a href="/watch?<%= env.params.query %>&iv_load_policy=3">
|
||||
@@ -76,7 +98,7 @@
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if CONFIG.dmca_content.includes? video.id %>
|
||||
<% if CONFIG.dmca_content.includes?(video.id) || CONFIG.disabled?("downloads") %>
|
||||
<p><%= translate(locale, "Download is disabled.") %></p>
|
||||
<% else %>
|
||||
<form class="pure-form pure-form-stacked" action="/latest_version" method="get" rel="noopener" target="_blank">
|
||||
@@ -131,7 +153,7 @@
|
||||
<p id="engagement"><%= translate(locale, "Engagement: ") %><%= engagement.round(2) %>%</p>
|
||||
<% if video.allowed_regions.size != REGIONS.size %>
|
||||
<p id="allowed_regions">
|
||||
<% if video.allowed_regions.size < REGIONS.size / 2 %>
|
||||
<% if video.allowed_regions.size < REGIONS.size // 2 %>
|
||||
<%= translate(locale, "Whitelisted regions: ") %><%= video.allowed_regions.join(", ") %>
|
||||
<% else %>
|
||||
<%= translate(locale, "Blacklisted regions: ") %><%= (REGIONS.to_a - video.allowed_regions).join(", ") %>
|
||||
@@ -143,11 +165,12 @@
|
||||
|
||||
<div class="pure-u-1 <% if params.related_videos || plid %>pure-u-lg-3-5<% else %>pure-u-md-4-5<% end %>">
|
||||
<div class="h-box">
|
||||
<p>
|
||||
<a href="/channel/<%= video.ucid %>">
|
||||
<h3><%= video.author %></h3>
|
||||
</a>
|
||||
</p>
|
||||
<a href="/channel/<%= video.ucid %>" style="display:block;width:fit-content;width:-moz-fit-content">
|
||||
<div class="channel-profile">
|
||||
<img src="/ggpht<%= URI.parse(video.author_thumbnail).full_path %>">
|
||||
<span><%= video.author %></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<% ucid = video.ucid %>
|
||||
<% author = video.author %>
|
||||
@@ -155,11 +178,15 @@
|
||||
<%= rendered "components/subscribe_widget" %>
|
||||
|
||||
<p>
|
||||
<b><%= translate(locale, "Shared `x`", video.published.to_s("%B %-d, %Y")) %></b>
|
||||
<% if video.premiere_timestamp %>
|
||||
<b><%= translate(locale, "Premieres `x`", video.premiere_timestamp.not_nil!.to_s("%B %-d, %R UTC")) %></b>
|
||||
<% else %>
|
||||
<b><%= translate(locale, "Shared `x`", video.published.to_s("%B %-d, %Y")) %></b>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<%= video.description %>
|
||||
<%= video.description_html %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@@ -189,8 +216,8 @@
|
||||
<% if !rvs.empty? %>
|
||||
<div <% if plid %>style="display:none"<% end %>>
|
||||
<div class="pure-control-group">
|
||||
<label for="continue"><%= translate(locale, "Autoplay next video: ") %></label>
|
||||
<input name="continue" onclick="continue_autoplay(this)" id="continue" type="checkbox" <% if params.continue %>checked<% end %>>
|
||||
<label for="continue"><%= translate(locale, "Play next by default: ") %></label>
|
||||
<input name="continue" id="continue" type="checkbox" <% if params.continue %>checked<% end %>>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -225,320 +252,4 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<% if !rvs.empty? && !plid && params.continue %>
|
||||
player.on('ended', function() {
|
||||
location.assign('/watch?v=' +
|
||||
'<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>' +
|
||||
'&continue=1' +
|
||||
<% if params.listen != preferences.listen %>
|
||||
'&listen=<%= params.listen %>' +
|
||||
<% end %>
|
||||
<% if params.autoplay || params.continue_autoplay %>
|
||||
'&autoplay=1' +
|
||||
<% end %>
|
||||
<% if params.speed != preferences.speed %>
|
||||
'&speed=<%= params.speed %>' +
|
||||
<% end %>
|
||||
''
|
||||
);
|
||||
});
|
||||
<% end %>
|
||||
|
||||
function continue_autoplay(target) {
|
||||
if (target.checked) {
|
||||
player.on('ended', function() {
|
||||
location.assign('/watch?v=' +
|
||||
'<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>' +
|
||||
'&continue=1' +
|
||||
<% if params.listen != preferences.listen %>
|
||||
'&listen=<%= params.listen %>' +
|
||||
<% end %>
|
||||
<% if params.autoplay || params.continue_autoplay %>
|
||||
'&autoplay=1' +
|
||||
<% end %>
|
||||
<% if params.speed != preferences.speed %>
|
||||
'&speed=<%= params.speed %>' +
|
||||
<% end %>
|
||||
''
|
||||
);
|
||||
});
|
||||
} else {
|
||||
player.off('ended');
|
||||
}
|
||||
}
|
||||
|
||||
function number_with_separator(val) {
|
||||
while (/(\d+)(\d{3})/.test(val.toString())) {
|
||||
val = val.toString().replace(/(\d+)(\d{3})/, "$1" + "," + "$2");
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
<% if plid %>
|
||||
function get_playlist(plid, timeouts = 0) {
|
||||
playlist = document.getElementById('playlist');
|
||||
|
||||
if (timeouts > 10) {
|
||||
console.log('Failed to pull playlist');
|
||||
playlist.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
playlist.innerHTML = ' \
|
||||
<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3> \
|
||||
<hr>'
|
||||
|
||||
if (plid.startsWith('RD')) {
|
||||
var plid_url = '/api/v1/mixes/' + plid +
|
||||
'?continuation=<%= video.id %>' +
|
||||
'&format=html&hl=<%= env.get("preferences").as(Preferences).locale %>';
|
||||
} else {
|
||||
var plid_url = '/api/v1/playlists/' + plid +
|
||||
'?continuation=<%= video.id %>' +
|
||||
'&format=html&hl=<%= env.get("preferences").as(Preferences).locale %>';
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('GET', plid_url, true);
|
||||
xhr.send();
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
playlist.innerHTML = xhr.response.playlistHtml;
|
||||
|
||||
if (xhr.response.nextVideo) {
|
||||
player.on('ended', function() {
|
||||
location.assign('/watch?v=' + xhr.response.nextVideo +
|
||||
'&list=' + plid +
|
||||
<% if params.listen != preferences.listen %>
|
||||
'&listen=<%= params.listen %>' +
|
||||
<% end %>
|
||||
<% if params.autoplay || params.continue_autoplay %>
|
||||
'&autoplay=1' +
|
||||
<% end %>
|
||||
<% if params.speed != preferences.speed %>
|
||||
'&speed=<%= params.speed %>' +
|
||||
<% end %>
|
||||
''
|
||||
);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
playlist.innerHTML = '';
|
||||
document.getElementById('continue').style.display = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
console.log('Pulling playlist timed out.');
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
get_playlist('<%= plid %>');
|
||||
<% end %>
|
||||
|
||||
function get_reddit_comments(timeouts = 0) {
|
||||
comments = document.getElementById('comments');
|
||||
|
||||
if (timeouts > 10) {
|
||||
console.log('Failed to pull comments');
|
||||
comments.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
var fallback = comments.innerHTML;
|
||||
comments.innerHTML =
|
||||
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
||||
|
||||
var url = '/api/v1/comments/<%= video.id %>' +
|
||||
'?source=reddit&format=html' +
|
||||
'&hl=<%= env.get("preferences").as(Preferences).locale %>';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('GET', url, true);
|
||||
xhr.send();
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
comments.innerHTML = ' \
|
||||
<div> \
|
||||
<h3> \
|
||||
<a href="javascript:void(0)" onclick="toggle_comments(this)">[ - ]</a> \
|
||||
{title} \
|
||||
</h3> \
|
||||
<p> \
|
||||
<b> \
|
||||
<a href="javascript:void(0)" onclick="swap_comments(\'youtube\')"> \
|
||||
<%= translate(locale, "View YouTube comments") %> \
|
||||
</a> \
|
||||
</b> \
|
||||
</p> \
|
||||
<b> \
|
||||
<a rel="noopener" target="_blank" href="https://reddit.com{permalink}"><%= translate(locale, "View more comments on Reddit") %></a> \
|
||||
</b> \
|
||||
</div> \
|
||||
<div>{contentHtml}</div> \
|
||||
<hr>'.supplant({
|
||||
title: xhr.response.title,
|
||||
permalink: xhr.response.permalink,
|
||||
contentHtml: xhr.response.contentHtml
|
||||
});
|
||||
} else {
|
||||
<% if preferences && preferences.comments[1] == "youtube" %>
|
||||
get_youtube_comments(timeouts + 1);
|
||||
<% else %>
|
||||
comments.innerHTML = fallback;
|
||||
<% end %>
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
console.log('Pulling comments timed out.');
|
||||
get_reddit_comments(timeouts + 1);
|
||||
};
|
||||
}
|
||||
|
||||
function get_youtube_comments(timeouts = 0) {
|
||||
comments = document.getElementById('comments');
|
||||
|
||||
if (timeouts > 10) {
|
||||
console.log('Failed to pull comments');
|
||||
comments.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
var fallback = comments.innerHTML;
|
||||
comments.innerHTML =
|
||||
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
||||
|
||||
var url = '/api/v1/comments/<%= video.id %>' +
|
||||
'?format=html' +
|
||||
'&hl=<%= env.get("preferences").as(Preferences).locale %>' +
|
||||
'&thin_mode=<%= env.get("preferences").as(Preferences).thin_mode %>';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('GET', url, true);
|
||||
xhr.send();
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
if (xhr.response.commentCount > 0) {
|
||||
comments.innerHTML = ' \
|
||||
<div> \
|
||||
<h3> \
|
||||
<a href="javascript:void(0)" onclick="toggle_comments(this)">[ - ]</a> \
|
||||
<%= translate(locale, "View `x` comments", "{commentCount}") %> \
|
||||
</h3> \
|
||||
<b> \
|
||||
<a href="javascript:void(0)" onclick="swap_comments(\'reddit\')"> \
|
||||
<%= translate(locale, "View Reddit comments") %> \
|
||||
</a> \
|
||||
</b> \
|
||||
</div> \
|
||||
<div>{contentHtml}</div> \
|
||||
<hr>'.supplant({
|
||||
contentHtml: xhr.response.contentHtml,
|
||||
commentCount: number_with_separator(xhr.response.commentCount)
|
||||
});
|
||||
} else {
|
||||
comments.innerHTML = "";
|
||||
}
|
||||
} else {
|
||||
<% if preferences && preferences.comments[1] == "youtube" %>
|
||||
get_youtube_comments(timeouts + 1);
|
||||
<% else %>
|
||||
comments.innerHTML = '';
|
||||
<% end %>
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
console.log('Pulling comments timed out.');
|
||||
comments.innerHTML =
|
||||
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
||||
get_youtube_comments(timeouts + 1);
|
||||
};
|
||||
}
|
||||
|
||||
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/comments/<%= video.id %>' +
|
||||
'?format=html' +
|
||||
'&hl=<%= env.get("preferences").as(Preferences).locale %>' +
|
||||
'&thin_mode=<%= env.get("preferences").as(Preferences).thin_mode %>' +
|
||||
'&continuation=' + continuation;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'json';
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('GET', url, true);
|
||||
xhr.send();
|
||||
|
||||
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.innerHTML = ' \
|
||||
<p><a href="javascript:void(0)" \
|
||||
onclick="hide_youtube_replies(this, \'<%= translate(locale, "Hide replies") %>\', \'<%= translate(locale, "Show replies") %>\')"><%= translate(locale, "Hide replies") %> \
|
||||
</a></p> \
|
||||
<div>{contentHtml}</div>'.supplant({
|
||||
contentHtml: xhr.response.contentHtml,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
body.innerHTML = fallback;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
console.log('Pulling comments timed out.');
|
||||
body.innerHTML = fallback;
|
||||
};
|
||||
}
|
||||
|
||||
<% if preferences %>
|
||||
<% if preferences.comments[0] == "youtube" %>
|
||||
get_youtube_comments();
|
||||
<% elsif preferences.comments[0] == "reddit" %>
|
||||
get_reddit_comments();
|
||||
<% else %>
|
||||
<% if preferences.comments[1] == "youtube" %>
|
||||
get_youtube_comments();
|
||||
<% elsif preferences.comments[1] == "reddit" %>
|
||||
get_reddit_comments();
|
||||
<% else %>
|
||||
comments = document.getElementById('comments');
|
||||
comments.innerHTML = '';
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
get_youtube_comments();
|
||||
<% end %>
|
||||
</script>
|
||||
<script src="/js/watch.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
|
||||
Reference in New Issue
Block a user