Compare commits

..

57 Commits

Author SHA1 Message Date
a65998274f Defer loading videojs-share until last 2019-03-05 15:22:04 -06:00
b2f4a0276a Remove "lease_seconds" from pubsub response 2019-03-05 14:43:09 -06:00
99d9c3a900 Fix rows for subscribe job 2019-03-05 14:41:38 -06:00
e4dc430c74 Update hub topic URL 2019-03-05 13:46:08 -06:00
1435516a9c Add port number to host URL 2019-03-05 12:56:59 -06:00
2a1befb41a Fix sorting for latest_only 2019-03-05 07:17:29 -06:00
2840d98fd4 Fix tagging for current version 2019-03-04 15:17:09 -06:00
32b9c0c840 Fix tagging for current branch 2019-03-04 14:43:17 -06:00
6375a62465 Clean up handling for callback endpoint 2019-03-04 11:07:27 -06:00
aa63c3f70e Update formatting and default feed menu 2019-03-04 10:46:58 -06:00
004fb96b2f Add nonce to pubsub token 2019-03-04 07:53:31 -06:00
5895604282 Merge pull request #394 from tmiland/contrib
Add current branch to footer
2019-03-03 21:41:03 -06:00
a1af75a87f Update template.ecr
Add current branch to footer.
Add icons to footer.
2019-03-04 04:05:09 +01:00
732bd28c92 Update invidious.cr
Add current branch.
2019-03-04 04:04:26 +01:00
90715467a2 Set default value for 'subscribed' date 2019-03-03 20:44:29 -06:00
7425700009 Update pubsub to support lease_seconds 2019-03-03 20:40:24 -06:00
8e884fe115 Fix webhook endpoints 2019-03-03 19:50:23 -06:00
96c09450b8 Fix column name ucid in jobs 2019-03-03 19:45:05 -06:00
64cfd2296c Add support for subscribing to channels via PubSubHubbub 2019-03-03 19:18:23 -06:00
17cf0772fb Set domain to be nil by default 2019-03-03 12:02:15 -06:00
66605196ad Remove "detect_language" from dependencies 2019-03-03 11:51:28 -06:00
2c9b148627 Add 'playlists' tab to channel page 2019-03-03 10:56:04 -06:00
07ef48a07a Add length_seconds to playlist on watch page 2019-03-03 10:55:49 -06:00
03f94db5e2 Fix watch filtering from subscription feed when watch history is empty 2019-03-02 20:13:41 -06:00
9b202adebd Remove <hr> from footer 2019-03-02 20:12:36 -06:00
daf8e5b8b6 Remove array from usage statistics 2019-03-01 21:03:57 -06:00
25bd27ef95 Merge weblate into master 2019-03-01 19:59:30 -06:00
dd41e4906c Update Norwegian Bokmål translation 2019-03-02 02:57:53 +01:00
20660b92f8 Add missing text to locales 2019-03-01 19:57:28 -06:00
f0cc7a925c Add 'lastChannelRefreshedAt' to /api/v1/stats 2019-03-01 19:55:07 -06:00
057e69fe70 Update User-Agent and statistics schema 2019-03-01 19:39:10 -06:00
4be82c5ca6 Add /api/v1/stats 2019-03-01 19:25:16 -06:00
0eaf8f38a1 Add support for Basque translation 2019-03-01 19:24:53 -06:00
f31af18aa9 Merge weblate into master 2019-03-01 17:18:03 -06:00
5859cd290c Clean up footer and add version 2019-03-01 16:52:37 -06:00
a39b1583da Add administrator preferences 2019-03-01 16:06:45 -06:00
ac0eb9acaf Update Russian translation 2019-03-01 17:45:23 +01:00
a0d9e46c33 Update Polish translation 2019-03-01 17:45:23 +01:00
573404d3ac Update Basque translation 2019-03-01 17:45:23 +01:00
2fe545e19a Add content element to RSS feeds 2019-03-01 10:44:41 -06:00
ea52c05f05 Fix escaping for video filenames 2019-02-28 21:29:01 -06:00
2a643e86bc Update dockerfile 2019-02-28 13:49:29 -06:00
cc76428cd2 Update README 2019-02-28 13:28:02 -06:00
7ffc3a0652 Set updated for deleted channels 2019-02-27 17:31:17 -06:00
51df0860cc Update dependencies 2019-02-27 16:52:37 -06:00
e4f397d049 Fix RSS thumbnails 2019-02-27 16:18:47 -06:00
0c8dff162d Fix embed extractor for age-gated videos 2019-02-27 15:15:24 -06:00
4865529fed Create views if they don't exist 2019-02-27 09:10:28 -06:00
0a404cc9a6 Add fix for missing param in "/videoplayback" 2019-02-27 08:16:58 -06:00
17b84f32df Fix duration in /api/v1/search 2019-02-26 14:31:37 -06:00
a03958d937 Add -webkit-appearance to default.css 2019-02-26 12:21:19 -06:00
27cd1e73f3 Fix feed menu on mobile 2019-02-26 09:23:16 -06:00
d6bd893573 Add fix for missing hash keys 2019-02-26 08:12:56 -06:00
7a7049b25b Escape video titles in download widget 2019-02-25 17:54:55 -06:00
62ff9605ce Extract format streams from player response 2019-02-25 17:28:35 -06:00
2847c34f58 Bump version 2019-02-25 12:16:13 -06:00
b5a00f3c47 Remove duplicate information from autogenerated channel page 2019-02-25 09:52:44 -06:00
42 changed files with 1380 additions and 857 deletions

View File

@ -117,7 +117,7 @@ $ exit
```bash
$ sudo -i -u invidious
$ cd invidious
$ shards
$ shards update && shards install
$ crystal build src/invidious.cr --release
# test compiled binary
$ ./invidious # stop with ctrl c
@ -153,7 +153,7 @@ $ psql invidious < config/sql/session_ids.sql
$ psql invidious < config/sql/nonces.sql
# Setup Invidious
$ shards
$ shards update && shards install
$ crystal build src/invidious.cr --release
```

View File

@ -150,6 +150,7 @@ img.thumbnail {
box-shadow: none;
transition: 0.1s border-bottom;
-webkit-appearance: none;
}
.navbar > .searchbar .pure-form fieldset {

View File

@ -10,4 +10,4 @@ db:
dbname: invidious
full_refresh: false
https_only: false
domain: invidio.us
domain:

View File

@ -0,0 +1,4 @@
#!/bin/sh
psql invidious -c "ALTER TABLE channels ADD COLUMN subscribed bool;"
psql invidious -c "UPDATE channels SET subscribed = false;"

View File

@ -0,0 +1,5 @@
#!/bin/sh
psql invidious -c "ALTER TABLE channels DROP COLUMN subscribed"
psql invidious -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz"
psql invidious -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'"

View File

@ -8,6 +8,7 @@ CREATE TABLE public.channels
author text,
updated timestamp with time zone,
deleted boolean,
subscribed timestamp with time zone,
CONSTRAINT channels_id_key UNIQUE (id)
);

View File

@ -9,7 +9,7 @@ ADD . /invidious
WORKDIR /invidious
RUN sed -i 's/host: localhost/host: postgres/' config/config.yml && \
shards && \
shards update && shards install && \
crystal build src/invidious.cr
CMD [ "/invidious/invidious" ]

View File

@ -82,6 +82,14 @@
"Manage subscriptions": "إدارة المشتركين",
"Watch history": "سجل المشاهدة",
"Delete account": "حذف الحساب",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Save preferences": "حفظ التفضيلات",
"Subscription manager": "مدير الإشتراكات",
"`x` subscriptions": "`x` مشتركين",

View File

@ -82,6 +82,14 @@
"Manage subscriptions": "Abonnements 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? ": "",
"Save preferences": "Einstellungen speichern",
"Subscription manager": "Abonnementverwaltung",
"`x` subscriptions": "`x` Abonnements",

View File

@ -80,6 +80,14 @@
"Manage subscriptions": "Manage subscriptions",
"Watch history": "Watch history",
"Delete account": "Delete account",
"Administrator preferences": "Administrator preferences",
"Default homepage: ": "Default homepage: ",
"Feed menu: ": "Feed menu: ",
"Top enabled? ": "Top enabled? ",
"CAPTCHA enabled? ": "CAPTCHA enabled? ",
"Login enabled? ": "Login enabled? ",
"Registration enabled? ": "Registration enabled? ",
"Report statistics? ": "Report statistics? ",
"Save preferences": "Save preferences",
"Subscription manager": "Subscription manager",
"`x` subscriptions": "`x` subscriptions",

View File

@ -1,11 +1,11 @@
{
"`x` subscribers": "",
"`x` videos": "",
"LIVE": "",
"Shared `x` ago": "",
"Unsubscribe": "",
"`x` subscribers": "`x` harpidedun",
"`x` videos": "`x` bideo",
"LIVE": "ZUZENEAN",
"Shared `x` ago": "Duela `x` partekatua",
"Unsubscribe": "Harpidetza kendu",
"Subscribe": "Harpidetu",
"Login to subscribe to `x`": "",
"Login to subscribe to `x`": "Saioa hasi `x`(e)ra harpidetzeko",
"View channel on YouTube": "Ikusi kanala YouTuben",
"newest": "berrienak",
"oldest": "zaharrenak",
@ -24,22 +24,22 @@
"Import NewPipe data (.zip)": "NewPipeko datuak inportatu (.zip)",
"Export": "Esportatu",
"Export subscriptions as OPML": "Esportatu harpidetzak OPML bezala",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "",
"Export data as JSON": "",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Harpidetzak OPML bezala esportatu (NewPipe eta FreeTuberako)",
"Export data as JSON": "Datuak JSON bezala esportatu",
"Delete account?": "Kontua ezabatu?",
"History": "Historia",
"Previous page": "Aurreko orria",
"An alternative front-end to YouTube": "",
"JavaScript license information": "",
"source": "",
"Login": "",
"Login/Register": "",
"Login to Google": "",
"User ID:": "",
"Password:": "",
"Time (h:mm:ss):": "",
"Text CAPTCHA": "",
"Image CAPTCHA": "",
"An alternative front-end to YouTube": "YouTuberako interfaze alternatibo bat",
"JavaScript license information": "JavaScript lizentzia informazioa",
"source": "iturburua",
"Login": "Saioa hasi",
"Login/Register": "Saioa hasi/Izena eman",
"Login to Google": "Googlekin hasi saioa",
"User ID:": "Erabiltzaile IDa:",
"Password:": "Pasahitza:",
"Time (h:mm:ss):": "Denbora (o:mm:ss):",
"Text CAPTCHA": "Testu CAPTCHA",
"Image CAPTCHA": "Irudi CAPTCHA",
"Sign In": "",
"Register": "",
"Email:": "",
@ -80,6 +80,14 @@
"Manage subscriptions": "",
"Watch history": "",
"Delete account": "",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Save preferences": "",
"Subscription manager": "",
"`x` subscriptions": "",

View File

@ -79,6 +79,14 @@
"Manage subscriptions": "Gérer les abonnements",
"Watch history": "Historique de visionnage",
"Delete account": "Supprimer votre compte",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Save preferences": "Enregistrer les préférences",
"Subscription manager": "Gestionnaire d'abonnement",
"`x` subscriptions": "`x` abonnements",

View File

@ -79,6 +79,14 @@
"Manage subscriptions": "Gestisci le iscrizioni",
"Watch history": "Cronologia dei video",
"Delete account": "Elimina l'account",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Save preferences": "Salva le preferenze",
"Subscription manager": "Gestisci le iscrizioni",
"`x` subscriptions": "`x` iscrizioni",

View File

@ -1,280 +1,288 @@
{
"`x` subscribers": "`x` abonnenter",
"`x` videos": "`x` videoer",
"LIVE": "SANNTIDSVISNING",
"Shared `x` ago": "Delt for `x` siden",
"Unsubscribe": "Opphev abonnement",
"Subscribe": "Abonner",
"Login to subscribe to `x`": "Logg inn for å abonnere på `x`",
"View channel on YouTube": "Vis kanal på YouTube",
"newest": "nyeste",
"oldest": "eldste",
"popular": "populært",
"Preview page": "Forhåndsvis side",
"Next page": "Neste side",
"Clear watch history?": "Tøm visningshistorikk?",
"Yes": "Ja",
"No": "Nei",
"Import and Export Data": "Importer- og eksporter data",
"Import": "Importer",
"Import Invidious data": "Importer Invidious-data",
"Import YouTube subscriptions": "Importer YouTube-abonnenter",
"Import FreeTube subscriptions (.db)": "Importer FreeTube-abonnenter (.db)",
"Import NewPipe subscriptions (.json)": "Importer NewPipe-abonnenter (.json)",
"Import NewPipe data (.zip)": "Importer NewPipe-data (.zip)",
"Export": "Eksporter",
"Export subscriptions as OPML": "Eksporter abonnenter som OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Eksporter abonnenter som OPML (for NewPipe og FreeTube)",
"Export data as JSON": "Eksporter data som JSON",
"Delete account?": "Slett konto?",
"History": "Historikk",
"Previous page": "Forrige side",
"An alternative front-end to YouTube": "En alternativ grenseflate for YouTube",
"JavaScript license information": "JavaScript-lisensinformasjon",
"source": "kilde",
"Login": "Logg inn",
"Login/Register": "Logg inn/registrer",
"Login to Google": "Logg inn med Google",
"User ID:": "Bruker-ID:",
"Password:": "Passord:",
"Time (h:mm:ss):": "Tid (h:mm:ss):",
"Text CAPTCHA": "Tekst-CAPTCHA",
"Image CAPTCHA": "Bilde-CAPTCHA",
"Sign In": "Innlogging",
"Register": "Registrer",
"Email:": "E-post:",
"Google verification code:": "Google-bekreftelseskode:",
"Preferences": "Innstillinger",
"Player preferences": "Avspillerinnstillinger",
"Always loop: ": "Alltid gjenta: ",
"Autoplay: ": "Autoavspilling: ",
"Autoplay next video: ": "Autospill neste video: ",
"Listen by default: ": "Lytt som forvalg: ",
"Default speed: ": "Forvalgt hastighet: ",
"Preferred video quality: ": "Foretrukket videokvalitet: ",
"Player volume: ": "Avspillerlydstyrke: ",
"Default comments: ": "Forvalgte kommentarer: ",
"Default captions: ": "Forvalgte undertitler: ",
"Fallback captions: ": "Tilbakefallsundertitler: ",
"Show related videos? ": "Vis relaterte videoer? ",
"Visual preferences": "Visuelle innstillinger",
"Dark mode: ": "Mørk drakt: ",
"Thin mode: ": "Tynt modus: ",
"Subscription preferences": "Abonnementsinnstillinger",
"Redirect homepage to feed: ": "Videresend hjemmeside til flyt: ",
"Number of videos shown in feed: ": "Antall videoer å vise i flyt: ",
"Sort videos by: ": "Sorter videoer etter: ",
"published": "publisert",
"published - reverse": "publisert - motsatt",
"alphabetically": "alfabetisk",
"alphabetically - reverse": "alfabetisk - motsatt",
"channel name": "kanalnavn",
"channel name - reverse": "kanalnavn - motsatt",
"Only show latest video from channel: ": "Kun vis siste video fra kanal: ",
"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): ",
"Data preferences": "Datainnstillinger",
"Clear watch history": "Tøm visningshistorikk",
"Import/Export data": "Importer/eksporter data",
"Manage subscriptions": "Behandle abonnementer",
"Watch history": "Visningshistorikk",
"Delete account": "Slett konto",
"Save preferences": "Lagre innstillinger",
"Subscription manager": "Abonnementsbehandler",
"`x` subscriptions": "`x` abonnementer",
"Import/Export": "Importer/eksporter",
"unsubscribe": "opphev abonnement",
"Subscriptions": "Abonnement",
"`x` unseen notifications": "`x` usette merknader",
"search": "søk",
"Sign out": "Logg ut",
"Released under the AGPLv3 by Omar Roth.": "Utgitt med AGPLv3+lisens av Omar Roth.",
"Source available here.": "Kildekode tilgjengelig her.",
"View JavaScript license information.": "Vis JavaScript-lisensinfo.",
"Trending": "Trendsettende",
"Watch video on Youtube": "Vis video på YouTube",
"Genre: ": "Sjanger: ",
"License: ": "Lisens: ",
"Family friendly? ": "Familievennlig? ",
"Wilson score: ": "Wilson-poengsum: ",
"Engagement: ": "Engasjement: ",
"Whitelisted regions: ": "Hvitlistede regioner: ",
"Blacklisted regions: ": "Svartelistede regioner: ",
"Shared `x`": "Delt `x`",
"Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it 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",
"View `x` comments": "Vis `x` kommentarer",
"View Reddit comments": "Vis Reddit-kommentarer",
"Hide replies": "Skjul svar",
"Show replies": "Vis svar",
"Incorrect password": "Feil passord",
"Quota exceeded, try again in a few hours": "Kvote overskredet, prøv igjen om et par timer",
"Unable to login, make sure two-factor authentication (Authenticator or SMS) is enabled.": "Kunne ikke logge inn, forsikre deg om at tofaktor-identitetsbekreftelse (Authenticator eller SMS) er skrudd på.",
"Invalid TFA code": "Ugyldig tofaktorkode",
"Login failed. This may be because two-factor authentication is not enabled on your account.": "Innlogging mislyktes. Dette kan være fordi tofaktor-identitetsbekreftelse er skrudd av på kontoen din.",
"Invalid answer": "Ugyldig svar",
"Invalid CAPTCHA": "Ugyldig CAPTCHA",
"CAPTCHA is a required field": "CAPTCHA er et påkrevd felt",
"User ID is a required field": "Bruker-ID er et påkrevd felt",
"Password is a required field": "Passord er et påkrevd felt",
"Invalid username or password": "Ugyldig brukernavn eller passord",
"Please sign in using 'Sign in with Google'": "Logg inn ved bruk av \"Google-innlogging\"",
"Password cannot be empty": "Passordet kan ikke være tomt",
"Password cannot be longer than 55 characters": "Passordet kan ikke være lengre enn 55 tegn",
"Please sign in": "Logg inn",
"Invidious Private Feed for `x`": "Ugyldig privat flyt for `x`",
"channel:`x`": "kanal `x`",
"Deleted or invalid channel": "Slettet eller ugyldig kanal",
"This channel does not exist.": "Denne kanalen finnes ikke.",
"Could not get channel info.": "Kunne ikke innhente kanalinfo.",
"Could not fetch comments": "Kunne ikke hente kommentarer",
"View `x` replies": "Vis `x` svar",
"`x` ago": "`x` siden",
"Load more": "Last inn flere",
"`x` points": "`x` poeng",
"Could not create mix.": "Kunne ikke opprette miks.",
"Playlist is empty": "Spillelisten er tom",
"Invalid playlist.": "Ugyldig spilleliste.",
"Playlist does not exist.": "Spillelisten finnes ikke.",
"Could not pull trending pages.": "Kunne ikke hente trendsettende sider.",
"Hidden field \"challenge\" is a required field": "Skjult felt \"utfordring\" er et påkrevd felt",
"Hidden field \"token\" is a required field": "Skjult felt \"symbol\" er et påkrevd felt",
"Invalid challenge": "Ugyldig utfordring",
"Invalid token": "Ugyldig symbol",
"Invalid user": "Ugyldig bruker",
"Token is expired, please try again": "Symbol utløpt, prøv igjen",
"English": "Engelsk",
"English (auto-generated)": "Engelsk (auto-generert)",
"Afrikaans": "",
"Albanian": "Albansk",
"Amharic": "",
"Arabic": "Arabisk",
"Armenian": "Armensk",
"Azerbaijani": "",
"Bangla": "",
"Basque": "",
"Belarusian": "Hviterussisk",
"Bosnian": "Bosnisk",
"Bulgarian": "Bulgarsk",
"Burmese": "Burmesisk",
"Catalan": "Katalansk",
"Cebuano": "",
"Chinese (Simplified)": "",
"Chinese (Traditional)": "",
"Corsican": "",
"Croatian": "",
"Czech": "Tsjekkisk",
"Danish": "Dansk",
"Dutch": "",
"Esperanto": "Esperanto",
"Estonian": "",
"Filipino": "",
"Finnish": "Finsk",
"French": "Fransk",
"Galician": "",
"Georgian": "",
"German": "",
"Greek": "",
"Gujarati": "",
"Haitian Creole": "",
"Hausa": "",
"Hawaiian": "",
"Hebrew": "",
"Hindi": "",
"Hmong": "",
"Hungarian": "Ungarsk",
"Icelandic": "Islandsk",
"Igbo": "",
"Indonesian": "Indonesisk",
"Irish": "Irsk",
"Italian": "Italiensk",
"Japanese": "Japansk",
"Javanese": "",
"Kannada": "",
"Kazakh": "",
"Khmer": "",
"Korean": "",
"Kurdish": "",
"Kyrgyz": "",
"Lao": "",
"Latin": "",
"Latvian": "",
"Lithuanian": "",
"Luxembourgish": "",
"Macedonian": "",
"Malagasy": "",
"Malay": "",
"Malayalam": "",
"Maltese": "",
"Maori": "",
"Marathi": "",
"Mongolian": "",
"Nepali": "",
"Norwegian": "Norsk bokmål",
"Nyanja": "",
"Pashto": "",
"Persian": "",
"Polish": "",
"Portuguese": "",
"Punjabi": "",
"Romanian": "",
"Russian": "Russisk",
"Samoan": "",
"Scottish Gaelic": "",
"Serbian": "Serbisk",
"Shona": "",
"Sindhi": "",
"Sinhala": "",
"Slovak": "Slovakisk",
"Slovenian": "Slovensk",
"Somali": "Somali",
"Southern Sotho": "",
"Spanish": "Spansk",
"Spanish (Latin America)": "",
"Sundanese": "",
"Swahili": "",
"Swedish": "Svensk",
"Tajik": "",
"Tamil": "",
"Telugu": "",
"Thai": "",
"Turkish": "Tyrkisk",
"Ukrainian": "Ukrainsk",
"Urdu": "",
"Uzbek": "",
"Vietnamese": "Vietnamesisk",
"Welsh": "",
"Western Frisian": "",
"Xhosa": "",
"Yiddish": "",
"Yoruba": "",
"Zulu": "",
"`x` years": "`x` år",
"`x` months": "`x` måneder",
"`x` weeks": "`x` uker",
"`x` days": "`x` dager",
"`x` hours": "`x` timer",
"`x` minutes": "`x` minutter",
"`x` seconds": "`x` sekunder",
"Fallback comments: ": "Tilbakefallskommentarer: ",
"Popular": "Pupulært",
"Top": "Topp",
"About": "Om",
"Rating: ": "Vurdering: ",
"Language: ": "Språk: ",
"Default": "Forvalg",
"Music": "Musikk",
"Gaming": "Spill",
"News": "Nyheter",
"Movies": "Filmer",
"Download": "Last ned",
"Download as: ": "Last ned som: ",
"%A %B %-d, %Y": "",
"(edited)": "(redigert)",
"Youtube permalink of the comment": "Permanent YouTube-lenke til innholdet",
"`x` marked it with a ❤": "`x` levnet et ❤",
"Audio mode": "Lydmodus",
"Video mode": "Video-modus"
"`x` subscribers": "`x` abonnenter",
"`x` videos": "`x` videoer",
"LIVE": "SANNTIDSVISNING",
"Shared `x` ago": "Delt for `x` siden",
"Unsubscribe": "Opphev abonnement",
"Subscribe": "Abonner",
"Login to subscribe to `x`": "Logg inn for å abonnere på `x`",
"View channel on YouTube": "Vis kanal på YouTube",
"newest": "nyeste",
"oldest": "eldste",
"popular": "populært",
"Preview page": "Forhåndsvis side",
"Next page": "Neste side",
"Clear watch history?": "Tøm visningshistorikk?",
"Yes": "Ja",
"No": "Nei",
"Import and Export Data": "Importer- og eksporter data",
"Import": "Importer",
"Import Invidious data": "Importer Invidious-data",
"Import YouTube subscriptions": "Importer YouTube-abonnenter",
"Import FreeTube subscriptions (.db)": "Importer FreeTube-abonnenter (.db)",
"Import NewPipe subscriptions (.json)": "Importer NewPipe-abonnenter (.json)",
"Import NewPipe data (.zip)": "Importer NewPipe-data (.zip)",
"Export": "Eksporter",
"Export subscriptions as OPML": "Eksporter abonnenter som OPML",
"Export subscriptions as OPML (for NewPipe & FreeTube)": "Eksporter abonnenter som OPML (for NewPipe og FreeTube)",
"Export data as JSON": "Eksporter data som JSON",
"Delete account?": "Slett konto?",
"History": "Historikk",
"Previous page": "Forrige side",
"An alternative front-end to YouTube": "En alternativ grenseflate for YouTube",
"JavaScript license information": "JavaScript-lisensinformasjon",
"source": "kilde",
"Login": "Logg inn",
"Login/Register": "Logg inn/registrer",
"Login to Google": "Logg inn med Google",
"User ID:": "Bruker-ID:",
"Password:": "Passord:",
"Time (h:mm:ss):": "Tid (h:mm:ss):",
"Text CAPTCHA": "Tekst-CAPTCHA",
"Image CAPTCHA": "Bilde-CAPTCHA",
"Sign In": "Innlogging",
"Register": "Registrer",
"Email:": "E-post:",
"Google verification code:": "Google-bekreftelseskode:",
"Preferences": "Innstillinger",
"Player preferences": "Avspillerinnstillinger",
"Always loop: ": "Alltid gjenta: ",
"Autoplay: ": "Autoavspilling: ",
"Autoplay next video: ": "Autospill neste video: ",
"Listen by default: ": "Lytt som forvalg: ",
"Default speed: ": "Forvalgt hastighet: ",
"Preferred video quality: ": "Foretrukket videokvalitet: ",
"Player volume: ": "Avspillerlydstyrke: ",
"Default comments: ": "Forvalgte kommentarer: ",
"Default captions: ": "Forvalgte undertitler: ",
"Fallback captions: ": "Tilbakefallsundertitler: ",
"Show related videos? ": "Vis relaterte videoer? ",
"Visual preferences": "Visuelle innstillinger",
"Dark mode: ": "Mørk drakt: ",
"Thin mode: ": "Tynt modus: ",
"Subscription preferences": "Abonnementsinnstillinger",
"Redirect homepage to feed: ": "Videresend hjemmeside til flyt: ",
"Number of videos shown in feed: ": "Antall videoer å vise i flyt: ",
"Sort videos by: ": "Sorter videoer etter: ",
"published": "publisert",
"published - reverse": "publisert - motsatt",
"alphabetically": "alfabetisk",
"alphabetically - reverse": "alfabetisk - motsatt",
"channel name": "kanalnavn",
"channel name - reverse": "kanalnavn - motsatt",
"Only show latest video from channel: ": "Kun vis siste video fra kanal: ",
"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): ",
"Data preferences": "Datainnstillinger",
"Clear watch history": "Tøm visningshistorikk",
"Import/Export data": "Importer/eksporter data",
"Manage subscriptions": "Behandle abonnementer",
"Watch history": "Visningshistorikk",
"Delete account": "Slett konto",
"Administrator preferences": "Administratorinnstillinger",
"Default homepage: ": "Forvalgt hjemmeside: ",
"Feed menu: ": "Flyt-meny: ",
"Top enabled? ": "",
"CAPTCHA enabled? ": "CAPTCHA påskrudd? ",
"Login enabled? ": "Innlogging påskrudd? ",
"Registration enabled? ": "Registrering påskrudd? ",
"Report statistics? ": "",
"Save preferences": "Lagre innstillinger",
"Subscription manager": "Abonnementsbehandler",
"`x` subscriptions": "`x` abonnementer",
"Import/Export": "Importer/eksporter",
"unsubscribe": "opphev abonnement",
"Subscriptions": "Abonnement",
"`x` unseen notifications": "`x` usette merknader",
"search": "søk",
"Sign out": "Logg ut",
"Released under the AGPLv3 by Omar Roth.": "Utgitt med AGPLv3+lisens av Omar Roth.",
"Source available here.": "Kildekode tilgjengelig her.",
"View JavaScript license information.": "Vis JavaScript-lisensinfo.",
"Trending": "Trendsettende",
"Watch video on Youtube": "Vis video på YouTube",
"Genre: ": "Sjanger: ",
"License: ": "Lisens: ",
"Family friendly? ": "Familievennlig? ",
"Wilson score: ": "Wilson-poengsum: ",
"Engagement: ": "Engasjement: ",
"Whitelisted regions: ": "Hvitlistede regioner: ",
"Blacklisted regions: ": "Svartelistede regioner: ",
"Shared `x`": "Delt `x`",
"Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it 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",
"View `x` comments": "Vis `x` kommentarer",
"View Reddit comments": "Vis Reddit-kommentarer",
"Hide replies": "Skjul svar",
"Show replies": "Vis svar",
"Incorrect password": "Feil passord",
"Quota exceeded, try again in a few hours": "Kvote overskredet, prøv igjen om et par timer",
"Unable to login, make sure two-factor authentication (Authenticator or SMS) is enabled.": "Kunne ikke logge inn, forsikre deg om at tofaktor-identitetsbekreftelse (Authenticator eller SMS) er skrudd på.",
"Invalid TFA code": "Ugyldig tofaktorkode",
"Login failed. This may be because two-factor authentication is not enabled on your account.": "Innlogging mislyktes. Dette kan være fordi tofaktor-identitetsbekreftelse er skrudd av på kontoen din.",
"Invalid answer": "Ugyldig svar",
"Invalid CAPTCHA": "Ugyldig CAPTCHA",
"CAPTCHA is a required field": "CAPTCHA er et påkrevd felt",
"User ID is a required field": "Bruker-ID er et påkrevd felt",
"Password is a required field": "Passord er et påkrevd felt",
"Invalid username or password": "Ugyldig brukernavn eller passord",
"Please sign in using 'Sign in with Google'": "Logg inn ved bruk av \"Google-innlogging\"",
"Password cannot be empty": "Passordet kan ikke være tomt",
"Password cannot be longer than 55 characters": "Passordet kan ikke være lengre enn 55 tegn",
"Please sign in": "Logg inn",
"Invidious Private Feed for `x`": "Ugyldig privat flyt for `x`",
"channel:`x`": "kanal `x`",
"Deleted or invalid channel": "Slettet eller ugyldig kanal",
"This channel does not exist.": "Denne kanalen finnes ikke.",
"Could not get channel info.": "Kunne ikke innhente kanalinfo.",
"Could not fetch comments": "Kunne ikke hente kommentarer",
"View `x` replies": "Vis `x` svar",
"`x` ago": "`x` siden",
"Load more": "Last inn flere",
"`x` points": "`x` poeng",
"Could not create mix.": "Kunne ikke opprette miks.",
"Playlist is empty": "Spillelisten er tom",
"Invalid playlist.": "Ugyldig spilleliste.",
"Playlist does not exist.": "Spillelisten finnes ikke.",
"Could not pull trending pages.": "Kunne ikke hente trendsettende sider.",
"Hidden field \"challenge\" is a required field": "Skjult felt \"utfordring\" er et påkrevd felt",
"Hidden field \"token\" is a required field": "Skjult felt \"symbol\" er et påkrevd felt",
"Invalid challenge": "Ugyldig utfordring",
"Invalid token": "Ugyldig symbol",
"Invalid user": "Ugyldig bruker",
"Token is expired, please try again": "Symbol utløpt, prøv igjen",
"English": "Engelsk",
"English (auto-generated)": "Engelsk (auto-generert)",
"Afrikaans": "",
"Albanian": "Albansk",
"Amharic": "",
"Arabic": "Arabisk",
"Armenian": "Armensk",
"Azerbaijani": "",
"Bangla": "",
"Basque": "",
"Belarusian": "Hviterussisk",
"Bosnian": "Bosnisk",
"Bulgarian": "Bulgarsk",
"Burmese": "Burmesisk",
"Catalan": "Katalansk",
"Cebuano": "",
"Chinese (Simplified)": "",
"Chinese (Traditional)": "",
"Corsican": "",
"Croatian": "",
"Czech": "Tsjekkisk",
"Danish": "Dansk",
"Dutch": "",
"Esperanto": "Esperanto",
"Estonian": "",
"Filipino": "",
"Finnish": "Finsk",
"French": "Fransk",
"Galician": "",
"Georgian": "",
"German": "",
"Greek": "",
"Gujarati": "",
"Haitian Creole": "",
"Hausa": "",
"Hawaiian": "",
"Hebrew": "",
"Hindi": "",
"Hmong": "",
"Hungarian": "Ungarsk",
"Icelandic": "Islandsk",
"Igbo": "",
"Indonesian": "Indonesisk",
"Irish": "Irsk",
"Italian": "Italiensk",
"Japanese": "Japansk",
"Javanese": "",
"Kannada": "",
"Kazakh": "",
"Khmer": "",
"Korean": "",
"Kurdish": "",
"Kyrgyz": "",
"Lao": "",
"Latin": "",
"Latvian": "",
"Lithuanian": "",
"Luxembourgish": "",
"Macedonian": "",
"Malagasy": "",
"Malay": "",
"Malayalam": "",
"Maltese": "",
"Maori": "",
"Marathi": "",
"Mongolian": "",
"Nepali": "",
"Norwegian": "Norsk bokmål",
"Nyanja": "",
"Pashto": "",
"Persian": "",
"Polish": "",
"Portuguese": "",
"Punjabi": "",
"Romanian": "",
"Russian": "Russisk",
"Samoan": "",
"Scottish Gaelic": "",
"Serbian": "Serbisk",
"Shona": "",
"Sindhi": "",
"Sinhala": "",
"Slovak": "Slovakisk",
"Slovenian": "Slovensk",
"Somali": "Somali",
"Southern Sotho": "",
"Spanish": "Spansk",
"Spanish (Latin America)": "",
"Sundanese": "",
"Swahili": "",
"Swedish": "Svensk",
"Tajik": "",
"Tamil": "",
"Telugu": "",
"Thai": "",
"Turkish": "Tyrkisk",
"Ukrainian": "Ukrainsk",
"Urdu": "",
"Uzbek": "",
"Vietnamese": "Vietnamesisk",
"Welsh": "",
"Western Frisian": "",
"Xhosa": "",
"Yiddish": "",
"Yoruba": "",
"Zulu": "",
"`x` years": "`x` år",
"`x` months": "`x` måneder",
"`x` weeks": "`x` uker",
"`x` days": "`x` dager",
"`x` hours": "`x` timer",
"`x` minutes": "`x` minutter",
"`x` seconds": "`x` sekunder",
"Fallback comments: ": "Tilbakefallskommentarer: ",
"Popular": "Pupulært",
"Top": "Topp",
"About": "Om",
"Rating: ": "Vurdering: ",
"Language: ": "Språk: ",
"Default": "Forvalg",
"Music": "Musikk",
"Gaming": "Spill",
"News": "Nyheter",
"Movies": "Filmer",
"Download": "Last ned",
"Download as: ": "Last ned som: ",
"%A %B %-d, %Y": "",
"(edited)": "(redigert)",
"Youtube permalink of the comment": "Permanent YouTube-lenke til innholdet",
"`x` marked it with a ❤": "`x` levnet et ❤",
"Audio mode": "Lydmodus",
"Video mode": "Video-modus"
}

View File

@ -80,6 +80,14 @@
"Manage subscriptions": "Abonnees 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",
"`x` subscriptions": "`x` abonnees",

View File

@ -29,7 +29,7 @@
"Delete account?": "Usunąć konto?",
"History": "Historia",
"Previous page": "Poprzednia strona",
"An alternative front-end to YouTube": "",
"An alternative front-end to YouTube": "Alternatywny front-end dla YouTube",
"JavaScript license information": "Informacja o licencji JavaScript",
"source": "źródło",
"Login": "Zaloguj",
@ -80,6 +80,14 @@
"Manage subscriptions": "Organizuj subskrybcje",
"Watch history": "Historia",
"Delete account": "Usuń konto",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Save preferences": "Zapisz preferencje",
"Subscription manager": "Manager subskrybcji",
"`x` subscriptions": "`x` subskrybcji",
@ -145,107 +153,107 @@
"Invalid token": "Niepoprawny token",
"Invalid user": "Niepoprawny użytkownik",
"Token is expired, please try again": "Token wygasł, spróbuj ponownie",
"English": "",
"English (auto-generated)": "",
"English": "angielski",
"English (auto-generated)": "angielski (automatycznie generowane)",
"Afrikaans": "",
"Albanian": "",
"Albanian": "albański",
"Amharic": "",
"Arabic": "",
"Arabic": "arabski",
"Armenian": "",
"Azerbaijani": "",
"Bangla": "",
"Basque": "",
"Belarusian": "",
"Bosnian": "",
"Bulgarian": "",
"Burmese": "",
"Catalan": "",
"Belarusian": "białoruski",
"Bosnian": "bośniacki",
"Bulgarian": "bułgarski",
"Burmese": "birmański",
"Catalan": "kataloński",
"Cebuano": "",
"Chinese (Simplified)": "",
"Chinese (Traditional)": "",
"Corsican": "",
"Croatian": "",
"Czech": "",
"Danish": "",
"Dutch": "",
"Esperanto": "",
"Estonian": "",
"Filipino": "",
"Finnish": "",
"French": "",
"Galician": "",
"Georgian": "",
"German": "",
"Greek": "",
"Chinese (Simplified)": "chiński (uproszczony)",
"Chinese (Traditional)": "chiński (tradycyjny)",
"Corsican": "korsykański",
"Croatian": "chorwacki",
"Czech": "czeski",
"Danish": "duński",
"Dutch": "holenderski",
"Esperanto": "esperanto",
"Estonian": "estoński",
"Filipino": "filipiński",
"Finnish": "fiński",
"French": "francuski",
"Galician": "galicyjski",
"Georgian": "gruziński",
"German": "niemiecki",
"Greek": "grecki",
"Gujarati": "",
"Haitian Creole": "",
"Hausa": "",
"Hawaiian": "",
"Hebrew": "",
"Hindi": "",
"Hawaiian": "hawajski",
"Hebrew": "hebrajski",
"Hindi": "hindi",
"Hmong": "",
"Hungarian": "",
"Icelandic": "",
"Hungarian": "węgierski",
"Icelandic": "islandzki",
"Igbo": "",
"Indonesian": "",
"Irish": "",
"Italian": "",
"Japanese": "",
"Javanese": "",
"Indonesian": "indonezyjski",
"Irish": "irlandzki",
"Italian": "włoski",
"Japanese": "japoński",
"Javanese": "jawajski",
"Kannada": "",
"Kazakh": "",
"Kazakh": "kazachski",
"Khmer": "",
"Korean": "",
"Kurdish": "",
"Kyrgyz": "",
"Korean": "koreański",
"Kurdish": "kurdyjski",
"Kyrgyz": "kirgiski",
"Lao": "",
"Latin": "",
"Latvian": "",
"Lithuanian": "",
"Luxembourgish": "",
"Macedonian": "",
"Malagasy": "",
"Malay": "",
"Latin": "łaciński",
"Latvian": "łotewski",
"Lithuanian": "litewski",
"Luxembourgish": "luksemburski",
"Macedonian": "macedoński",
"Malagasy": "malgaski",
"Malay": "malajski",
"Malayalam": "",
"Maltese": "",
"Maltese": "maltański",
"Maori": "",
"Marathi": "",
"Mongolian": "",
"Nepali": "",
"Norwegian": "",
"Mongolian": "mongolski",
"Nepali": "nepalski",
"Norwegian": "norweski",
"Nyanja": "",
"Pashto": "",
"Persian": "",
"Polish": "",
"Portuguese": "",
"Persian": "perski",
"Polish": "polski",
"Portuguese": "portugalski",
"Punjabi": "",
"Romanian": "",
"Russian": "",
"Romanian": "rumuński",
"Russian": "rosyjski",
"Samoan": "",
"Scottish Gaelic": "",
"Serbian": "",
"Serbian": "serbski",
"Shona": "",
"Sindhi": "",
"Sinhala": "",
"Slovak": "",
"Slovenian": "",
"Somali": "",
"Slovak": "słowacki",
"Slovenian": "słoweński",
"Somali": "somalijski",
"Southern Sotho": "",
"Spanish": "",
"Spanish (Latin America)": "",
"Spanish": "hiszpański",
"Spanish (Latin America)": "hiszpański (ameryka łacińska)",
"Sundanese": "",
"Swahili": "",
"Swedish": "",
"Swedish": "szwedzki",
"Tajik": "",
"Tamil": "",
"Telugu": "",
"Thai": "",
"Turkish": "",
"Ukrainian": "",
"Thai": "tajski",
"Turkish": "turecki",
"Ukrainian": "ukraiński",
"Urdu": "",
"Uzbek": "",
"Vietnamese": "",
"Welsh": "",
"Uzbek": "uzbecki",
"Vietnamese": "wietnamski",
"Welsh": "walijski",
"Western Frisian": "",
"Xhosa": "",
"Yiddish": "",
@ -258,23 +266,23 @@
"`x` hours": "`x` godzin",
"`x` minutes": "`x` minut",
"`x` seconds": "`x` sekund",
"Fallback comments: ": "",
"Popular": "",
"Top": "",
"About": "",
"Rating: ": "",
"Language: ": "",
"Fallback comments: ": "Zastępcze komentarze: ",
"Popular": "Popularne",
"Top": "Na czasie",
"About": "Informacje",
"Rating: ": "Ocena: ",
"Language: ": "Język: ",
"Default": "",
"Music": "",
"Gaming": "",
"News": "",
"Movies": "",
"Download": "",
"Download as: ": "",
"Music": "Muzyka",
"Gaming": "Gry",
"News": "Wiadomości",
"Movies": "Filmy",
"Download": "Pobierz",
"Download as: ": "Pobierz jako: ",
"%A %B %-d, %Y": "",
"(edited)": "",
"Youtube permalink of the comment": "",
"(edited)": "(edytowany)",
"Youtube permalink of the comment": "Odnośnik bezpośredni do komentarza na YouTube",
"`x` marked it with a ❤": "",
"Audio mode": "",
"Video mode": ""
"Audio mode": "Tryb audio",
"Video mode": "Tryb wideo"
}

View File

@ -82,6 +82,14 @@
"Manage subscriptions": "Управление подписками",
"Watch history": "История просмотров",
"Delete account": "Удалить аккаунт",
"Administrator preferences": "",
"Default homepage: ": "",
"Feed menu: ": "",
"Top enabled? ": "",
"CAPTCHA enabled? ": "",
"Login enabled? ": "",
"Registration enabled? ": "",
"Report statistics? ": "",
"Save preferences": "Сохранить настройки",
"Subscription manager": "Менеджер подписок",
"`x` subscriptions": "`x` подписок",
@ -159,103 +167,103 @@
"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": "",
"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": "",
"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": "Норвежский",
"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` месяцев",
@ -281,6 +289,6 @@
"(edited)": "(изменено)",
"Youtube permalink of the comment": "Прямая ссылка на YouTube",
"`x` marked it with a ❤": "❤ от автора канала \"`x`\"",
"Audio mode": "",
"Video mode": ""
"Audio mode": "Аудио режим",
"Video mode": "Видео режим"
}

View File

@ -1,5 +1,5 @@
name: invidious
version: 0.14.0
version: 0.14.1
authors:
- Omar Roth <omarroth@hotmail.com>
@ -9,16 +9,13 @@ targets:
main: src/invidious.cr
dependencies:
detect_language:
github: detectlanguage/detectlanguage-crystal
kemal:
github: kemalcr/kemal
commit: afd17fc
pg:
github: will/crystal-pg
sqlite3:
github: crystal-lang/crystal-sqlite3
crystal: 0.27.1
crystal: 0.27.2
license: AGPLv3

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require "detect_language"
require "digest/md5"
require "file_utils"
require "kemal"
@ -29,44 +28,40 @@ require "./invidious/helpers/*"
require "./invidious/*"
CONFIG = Config.from_yaml(File.read("config/config.yml"))
HMAC_KEY = CONFIG.hmac_key || Random::Secure.random_bytes(32)
crawl_threads = CONFIG.crawl_threads
channel_threads = CONFIG.channel_threads
feed_threads = CONFIG.feed_threads
video_threads = CONFIG.video_threads
HMAC_KEY = CONFIG.hmac_key || Random::Secure.hex(32)
config = CONFIG
logger = Invidious::LogHandler.new
Kemal.config.extra_options do |parser|
parser.banner = "Usage: invidious [arguments]"
parser.on("-t THREADS", "--crawl-threads=THREADS", "Number of threads for crawling YouTube (default: #{crawl_threads})") do |number|
parser.on("-t THREADS", "--crawl-threads=THREADS", "Number of threads for crawling YouTube (default: #{config.crawl_threads})") do |number|
begin
crawl_threads = number.to_i
config.crawl_threads = number.to_i
rescue ex
puts "THREADS must be integer"
exit
end
end
parser.on("-c THREADS", "--channel-threads=THREADS", "Number of threads for refreshing channels (default: #{channel_threads})") do |number|
parser.on("-c THREADS", "--channel-threads=THREADS", "Number of threads for refreshing channels (default: #{config.channel_threads})") do |number|
begin
channel_threads = number.to_i
config.channel_threads = number.to_i
rescue ex
puts "THREADS must be integer"
exit
end
end
parser.on("-f THREADS", "--feed-threads=THREADS", "Number of threads for refreshing feeds (default: #{feed_threads})") do |number|
parser.on("-f THREADS", "--feed-threads=THREADS", "Number of threads for refreshing feeds (default: #{config.feed_threads})") do |number|
begin
feed_threads = number.to_i
config.feed_threads = number.to_i
rescue ex
puts "THREADS must be integer"
exit
end
end
parser.on("-v THREADS", "--video-threads=THREADS", "Number of threads for refreshing videos (default: #{video_threads})") do |number|
parser.on("-v THREADS", "--video-threads=THREADS", "Number of threads for refreshing videos (default: #{config.video_threads})") do |number|
begin
video_threads = number.to_i
config.video_threads = number.to_i
rescue ex
puts "THREADS must be integer"
exit
@ -78,7 +73,7 @@ Kemal.config.extra_options do |parser|
end
end
Kemal::CLI.new
Kemal::CLI.new ARGV
PG_URL = URI.new(
scheme: "postgres",
@ -93,12 +88,17 @@ PG_DB = DB.open PG_URL
YT_URL = URI.parse("https://www.youtube.com")
REDDIT_URL = URI.parse("https://www.reddit.com")
LOGIN_URL = URI.parse("https://accounts.google.com")
PUBSUB_URL = URI.parse("https://pubsubhubbub.appspot.com")
TEXTCAPTCHA_URL = URI.parse("http://textcaptcha.com/omarroth@hotmail.com.json")
CURRENT_BRANCH = `git branch | sed -n '/\* /s///p'`.strip
CURRENT_COMMIT = `git rev-list HEAD --max-count=1 --abbrev-commit`.strip
CURRENT_VERSION = `git describe --tags --abbrev=0`.strip
LOCALES = {
"ar" => load_locale("ar"),
"de" => load_locale("de"),
"en-US" => load_locale("en-US"),
"eu" => load_locale("eu"),
"fr" => load_locale("fr"),
"it" => load_locale("it"),
"nb_NO" => load_locale("nb_NO"),
@ -107,28 +107,65 @@ LOCALES = {
"ru" => load_locale("ru"),
}
crawl_threads.times do
config.crawl_threads.times do
spawn do
crawl_videos(PG_DB, logger)
end
end
refresh_channels(PG_DB, logger, channel_threads, CONFIG.full_refresh)
refresh_channels(PG_DB, logger, config.channel_threads, config.full_refresh)
refresh_feeds(PG_DB, logger, feed_threads)
refresh_feeds(PG_DB, logger, config.feed_threads)
video_threads.times do |i|
subscribe_to_feeds(PG_DB, logger, HMAC_KEY, config)
config.video_threads.times do |i|
spawn do
refresh_videos(PG_DB, logger)
end
end
statistics = {
"error" => "Statistics are not availabile.",
}
if config.statistics_enabled
spawn do
loop do
statistics = {
"version" => "2.0",
"software" => {
"name" => "invidious",
"version" => "#{CURRENT_VERSION}-#{CURRENT_COMMIT}",
"branch" => "#{CURRENT_BRANCH}",
},
"openRegistrations" => config.registration_enabled,
"usage" => {
"users" => {
"total" => PG_DB.query_one("SELECT count(*) FROM users", as: Int64),
"activeHalfyear" => PG_DB.query_one("SELECT count(*) FROM users WHERE CURRENT_TIMESTAMP - updated < '6 months'", as: Int64),
"activeMonth" => PG_DB.query_one("SELECT count(*) FROM users WHERE CURRENT_TIMESTAMP - updated < '1 month'", as: Int64),
},
},
"metadata" => {
"updatedAt" => Time.now.to_unix,
"lastChannelRefreshedAt" => PG_DB.query_one?("SELECT updated FROM channels ORDER BY updated DESC LIMIT 1", as: Time).try &.to_unix || 0,
},
}
sleep 1.minute
Fiber.yield
end
end
end
top_videos = [] of Video
spawn do
pull_top_videos(CONFIG, PG_DB) do |videos|
top_videos = videos
sleep 1.minutes
Fiber.yield
if config.top_enabled
spawn do
pull_top_videos(config, PG_DB) do |videos|
top_videos = videos
sleep 1.minutes
Fiber.yield
end
end
end
@ -231,7 +268,20 @@ get "/" do |env|
end
end
templated "index"
case config.default_home
when "Popular"
templated "popular"
when "Top"
templated "top"
when "Trending"
env.redirect "/feed/trending"
when "Subscriptions"
if user
env.redirect "/feed/subscriptions"
else
templated "popular"
end
end
end
get "/licenses" do |env|
@ -367,7 +417,7 @@ get "/watch" do |env|
video.description = replace_links(video.description)
description = video.short_description
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
host_params = env.request.query_params
host_params.delete_all("v")
@ -467,7 +517,7 @@ get "/embed/:id" do |env|
video.description = replace_links(video.description)
description = video.short_description
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
host_params = env.request.query_params
host_params.delete_all("v")
@ -553,7 +603,7 @@ get "/opensearch.xml" do |env|
locale = LOCALES[env.get("locale").as(String)]?
env.response.content_type = "application/opensearchdescription+xml"
host = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host = make_host_url(config, Kemal.config)
XML.build(indent: " ", encoding: "UTF-8") do |xml|
xml.element("OpenSearchDescription", xmlns: "http://a9.com/-/spec/opensearch/1.1/") do
@ -678,6 +728,11 @@ get "/login" do |env|
next env.redirect "/feed/subscriptions"
end
if !config.login_enabled
error_message = "Login has been disabled by administrator."
next templated "error"
end
referer = get_referer(env, "/feed/subscriptions")
account_type = env.params.query["type"]?
@ -716,6 +771,11 @@ post "/login" do |env|
referer = get_referer(env, "/feed/subscriptions")
if !config.login_enabled
error_message = "Login has been disabled by administrator."
next templated "error"
end
email = env.params.body["email"]?
password = env.params.body["password"]?
@ -876,14 +936,14 @@ post "/login" do |env|
host = URI.parse(env.request.headers["Host"]).host
if Kemal.config.ssl || CONFIG.https_only
if Kemal.config.ssl || config.https_only
secure = true
else
secure = false
end
login.cookies.each do |cookie|
if Kemal.config.ssl || CONFIG.https_only
if Kemal.config.ssl || config.https_only
cookie.secure = secure
else
cookie.secure = secure
@ -912,54 +972,56 @@ post "/login" do |env|
answer = env.params.body["answer"]?
text_answer = env.params.body["text_answer"]?
if answer
answer = answer.lstrip('0')
answer = OpenSSL::HMAC.hexdigest(:sha256, HMAC_KEY, answer)
if config.captcha_enabled
if answer
answer = answer.lstrip('0')
answer = OpenSSL::HMAC.hexdigest(:sha256, HMAC_KEY, answer)
challenge = env.params.body["challenge"]?
token = env.params.body["token"]?
challenge = env.params.body["challenge"]?
token = env.params.body["token"]?
begin
validate_response(challenge, token, answer, "sign_in", HMAC_KEY, PG_DB, locale)
rescue ex
if ex.message == translate(locale, "Invalid user")
error_message = translate(locale, "Invalid answer")
else
error_message = ex.message
end
next templated "error"
end
elsif text_answer
text_answer = Digest::MD5.hexdigest(text_answer.downcase.strip)
challenges = env.params.body.select { |k, v| k.match(/text_challenge\d+/) }
tokens = env.params.body.select { |k, v| k.match(/text_token\d+/) }
found_valid_captcha = false
error_message = translate(locale, "Invalid CAPTCHA")
challenges.each_with_index do |challenge, i|
begin
challenge = challenge[1]
token = tokens[i][1]
validate_response(challenge, token, text_answer, "sign_in", HMAC_KEY, PG_DB, locale)
found_valid_captcha = true
validate_response(challenge, token, answer, "sign_in", HMAC_KEY, PG_DB, locale)
rescue ex
if ex.message == translate(locale, "Invalid user")
error_message = translate(locale, "Invalid answer")
else
error_message = ex.message
end
end
end
if !found_valid_captcha
next templated "error"
end
elsif text_answer
text_answer = Digest::MD5.hexdigest(text_answer.downcase.strip)
challenges = env.params.body.select { |k, v| k.match(/text_challenge\d+/) }
tokens = env.params.body.select { |k, v| k.match(/text_token\d+/) }
found_valid_captcha = false
error_message = translate(locale, "Invalid CAPTCHA")
challenges.each_with_index do |challenge, i|
begin
challenge = challenge[1]
token = tokens[i][1]
validate_response(challenge, token, text_answer, "sign_in", HMAC_KEY, PG_DB, locale)
found_valid_captcha = true
rescue ex
if ex.message == translate(locale, "Invalid user")
error_message = translate(locale, "Invalid answer")
else
error_message = ex.message
end
end
end
if !found_valid_captcha
next templated "error"
end
else
error_message = translate(locale, "CAPTCHA is a required field")
next templated "error"
end
else
error_message = translate(locale, "CAPTCHA is a required field")
next templated "error"
end
action = env.params.body["action"]?
@ -992,14 +1054,14 @@ post "/login" do |env|
sid = Base64.urlsafe_encode(Random::Secure.random_bytes(32))
PG_DB.exec("INSERT INTO session_ids VALUES ($1, $2, $3)", sid, email, Time.now)
if Kemal.config.ssl || CONFIG.https_only
if Kemal.config.ssl || config.https_only
secure = true
else
secure = false
end
if CONFIG.domain
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: ".#{CONFIG.domain}", value: sid, expires: Time.now + 2.years,
if config.domain
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: "#{config.domain}", value: sid, expires: Time.now + 2.years,
secure: secure, http_only: true)
else
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,
@ -1016,6 +1078,11 @@ post "/login" do |env|
secure: secure, http_only: true)
end
elsif action == "register"
if !config.registration_enabled
error_message = "Registration has been disabled by administrator."
next templated "error"
end
if password.empty?
error_message = translate(locale, "Password cannot be empty")
next templated "error"
@ -1049,14 +1116,14 @@ post "/login" do |env|
ucid = ANY ((SELECT subscriptions FROM users WHERE email = E'#{user.email.gsub("'", "\\'")}')::text[]) \
ORDER BY published DESC;")
if Kemal.config.ssl || CONFIG.https_only
if Kemal.config.ssl || config.https_only
secure = true
else
secure = false
end
if CONFIG.domain
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: ".#{CONFIG.domain}", value: sid, expires: Time.now + 2.years,
if config.domain
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: "#{config.domain}", value: sid, expires: Time.now + 2.years,
secure: secure, http_only: true)
else
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,
@ -1153,14 +1220,15 @@ post "/preferences" do |env|
volume = env.params.body["volume"]?.try &.as(String).to_i?
volume ||= DEFAULT_USER_PREFERENCES.volume
comments_0 = env.params.body["comments_0"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.comments[0]
comments_1 = env.params.body["comments_1"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.comments[1]
comments = [comments_0, comments_1]
comments = [] of String
2.times do |i|
comments << (env.params.body["comments[#{i}]"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.comments[i])
end
captions_0 = env.params.body["captions_0"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[0]
captions_1 = env.params.body["captions_1"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[1]
captions_2 = env.params.body["captions_2"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[2]
captions = [captions_0, captions_1, captions_2]
captions = [] of String
3.times do |i|
captions << (env.params.body["captions[#{i}]"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[i])
end
related_videos = env.params.body["related_videos"]?.try &.as(String)
related_videos ||= "off"
@ -1224,6 +1292,41 @@ post "/preferences" do |env|
if user = env.get? "user"
user = user.as(User)
PG_DB.exec("UPDATE users SET preferences = $1 WHERE email = $2", preferences, user.email)
if config.admins.includes? user.email
config.default_home = env.params.body["default_home"]?.try &.as(String) || config.default_home
feed_menu = [] of String
4.times do |index|
option = env.params.body["feed_menu[#{index}]"]?.try &.as(String) || ""
if !option.empty?
feed_menu << option
end
end
config.feed_menu = feed_menu
top_enabled = env.params.body["top_enabled"]?.try &.as(String)
top_enabled ||= "off"
config.top_enabled = top_enabled == "on"
captcha_enabled = env.params.body["captcha_enabled"]?.try &.as(String)
captcha_enabled ||= "off"
config.captcha_enabled = captcha_enabled == "on"
login_enabled = env.params.body["login_enabled"]?.try &.as(String)
login_enabled ||= "off"
config.login_enabled = login_enabled == "on"
registration_enabled = env.params.body["registration_enabled"]?.try &.as(String)
registration_enabled ||= "off"
config.registration_enabled = registration_enabled == "on"
statistics_enabled = env.params.body["statistics_enabled"]?.try &.as(String)
statistics_enabled ||= "off"
config.statistics_enabled = statistics_enabled == "on"
File.write("config/config.yml", config.to_yaml)
end
else
env.response.cookies["PREFS"] = preferences
end
@ -1397,7 +1500,7 @@ get "/subscription_manager" do |env|
subscriptions.sort_by! { |channel| channel.author.downcase }
if action_takeout
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
if format == "json"
env.response.content_type = "application/json"
@ -1741,7 +1844,11 @@ end
get "/feed/top" do |env|
locale = LOCALES[env.get("locale").as(String)]?
templated "top"
if config.top_enabled
templated "top"
else
env.redirect "/"
end
end
get "/feed/popular" do |env|
@ -1845,14 +1952,19 @@ get "/feed/subscriptions" do |env|
# 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 #{user.watched.map { |id| %(('#{id}')) }.join(",")}) \
NOT id = ANY (#{values}) \
ORDER BY ucid, published #{sort}", 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", as: ChannelVideo)
ORDER BY ucid, published DESC", as: ChannelVideo)
end
videos.sort_by! { |video| video.published }.reverse!
@ -1860,8 +1972,13 @@ get "/feed/subscriptions" do |env|
if 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 #{user.watched.map { |id| %(('#{id}')) }.join(",")}) \
NOT id = ANY (#{values}) \
ORDER BY published #{sort} LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
else
# Sort subscriptions as normal
@ -1940,7 +2057,8 @@ end
get "/feed/channel/:ucid" do |env|
locale = LOCALES[env.get("locale").as(String)]?
env.response.content_type = "text/xml"
env.response.content_type = "application/atom+xml"
ucid = env.params.url["ucid"]
begin
@ -1984,7 +2102,7 @@ get "/feed/channel/:ucid" do |env|
)
end
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
path = env.request.path
feed = XML.build(indent: " ", encoding: "UTF-8") do |xml|
@ -2020,11 +2138,19 @@ get "/feed/channel/:ucid" do |env|
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=#{video.id}") do
xml.element("img", src: "#{host_url}/vi/#{video.id}/mqdefault.jpg")
end
end
end
xml.element("published") { xml.text video.published.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("media:group") do
xml.element("media:title") { xml.text video.title }
xml.element("media:thumbnail", url: "/vi/#{video.id}/mqdefault.jpg",
xml.element("media:thumbnail", url: "#{host_url}/vi/#{video.id}/mqdefault.jpg",
width: "320", height: "180")
xml.element("media:description") { xml.text video.description }
end
@ -2043,6 +2169,8 @@ end
get "/feed/private" do |env|
locale = LOCALES[env.get("locale").as(String)]?
env.response.content_type = "application/atom+xml"
token = env.params.query["token"]?
if !token
@ -2085,7 +2213,7 @@ get "/feed/private" do |env|
if latest_only
videos = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM #{view_name} \
ORDER BY ucid, published", as: ChannelVideo)
ORDER BY ucid, published DESC", as: ChannelVideo)
videos.sort_by! { |video| video.published }.reverse!
else
@ -2110,7 +2238,7 @@ get "/feed/private" do |env|
videos = videos[0..max_results]
end
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
path = env.request.path
query = env.request.query.not_nil!
@ -2135,12 +2263,20 @@ get "/feed/private" do |env|
xml.element("uri") { xml.text "#{host_url}/channel/#{video.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=#{video.id}") do
xml.element("img", src: "#{host_url}/vi/#{video.id}/mqdefault.jpg")
end
end
end
xml.element("published") { xml.text video.published.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("updated") { xml.text video.updated.to_s("%Y-%m-%dT%H:%M:%S%:z") }
xml.element("media:group") do
xml.element("media:title") { xml.text video.title }
xml.element("media:thumbnail", url: "/vi/#{video.id}/mqdefault.jpg",
xml.element("media:thumbnail", url: "#{host_url}/vi/#{video.id}/mqdefault.jpg",
width: "320", height: "180")
end
end
@ -2148,16 +2284,17 @@ get "/feed/private" do |env|
end
end
env.response.content_type = "application/atom+xml"
feed
end
get "/feed/playlist/:plid" do |env|
locale = LOCALES[env.get("locale").as(String)]?
env.response.content_type = "application/atom+xml"
plid = env.params.url["plid"]
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
path = env.request.path
client = make_client(YT_URL)
@ -2182,10 +2319,75 @@ get "/feed/playlist/:plid" do |env|
document = document.gsub(match[0], "<uri>#{content}</uri>")
end
env.response.content_type = "text/xml"
document
end
# Support push notifications via PubSubHubbub
get "/feed/webhook/:token" do |env|
verify_token = env.params.url["token"]
mode = env.params.query["hub.mode"]
topic = env.params.query["hub.topic"]
challenge = env.params.query["hub.challenge"]
if verify_token.starts_with? "v1"
_, time, nonce, signature = verify_token.split(":")
data = "#{time}:#{nonce}"
else
time, signature = verify_token.split(":")
data = "#{time}"
end
if Time.now.to_unix - time.to_i > 600
halt env, status_code: 400
end
if OpenSSL::HMAC.hexdigest(:sha1, HMAC_KEY, data) != signature
halt env, status_code: 400
end
ucid = HTTP::Params.parse(URI.parse(topic).query.not_nil!)["channel_id"]
PG_DB.exec("UPDATE channels SET subscribed = $1 WHERE id = $2", Time.now, ucid)
halt env, status_code: 200, response: challenge
end
post "/feed/webhook/:token" do |env|
token = env.params.url["token"]
body = env.request.body.not_nil!.gets_to_end
signature = env.request.headers["X-Hub-Signature"].lchop("sha1=")
if signature != OpenSSL::HMAC.hexdigest(:sha1, HMAC_KEY, body)
logger.write("#{token} : Invalid signature")
halt env, status_code: 200
end
spawn do
rss = XML.parse_html(body)
rss.xpath_nodes("//feed/entry").each do |entry|
id = entry.xpath_node("videoid").not_nil!.content
published = Time.parse(entry.xpath_node("published").not_nil!.content, "%FT%X%z", Time::Location.local)
updated = Time.parse(entry.xpath_node("updated").not_nil!.content, "%FT%X%z", Time::Location.local)
video = get_video(id, PG_DB, proxies, region: nil)
video = ChannelVideo.new(id, video.title, published, updated, video.ucid, video.author, video.length_seconds)
PG_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)
video_array = video.to_a
args = arg_array(video_array)
PG_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", video_array)
end
end
halt env, status_code: 200
end
# Channels
# YouTube appears to let users set a "brand" URL that
@ -2245,7 +2447,6 @@ get "/channel/:ucid" do |env|
continuation = env.params.query["continuation"]?
sort_by = env.params.query["sort_by"]?.try &.downcase
sort_by ||= "newest"
begin
author, ucid, auto_generated, sub_count = get_about_info(ucid, locale)
@ -2263,10 +2464,17 @@ get "/channel/:ucid" do |env|
end
if auto_generated
sort_options = {"last", "oldest", "newest"}
sort_by ||= "last"
items, continuation = fetch_channel_playlists(ucid, author, auto_generated, continuation, sort_by)
items.select! { |item| item.is_a?(SearchPlaylist) && !item.videos.empty? }
items = items.map { |item| item.as(SearchPlaylist) }
items.each { |item| item.author = "" }
else
sort_options = {"newest", "oldest", "popular"}
sort_by ||= "newest"
items, count = get_60_videos(ucid, page, auto_generated, sort_by)
items.select! { |item| !item.paid }
end
@ -2289,8 +2497,63 @@ get "/channel/:ucid/videos" do |env|
env.redirect "/channel/#{ucid}#{params}"
end
get "/channel/:ucid/playlists" do |env|
locale = LOCALES[env.get("locale").as(String)]?
user = env.get? "user"
if user
user = user.as(User)
subscriptions = user.subscriptions
end
subscriptions ||= [] of String
ucid = env.params.url["ucid"]
continuation = env.params.query["continuation"]?
sort_by = env.params.query["sort_by"]?.try &.downcase
sort_by ||= "last"
begin
author, ucid, auto_generated, sub_count = get_about_info(ucid, locale)
rescue ex
error_message = ex.message
next templated "error"
end
if auto_generated
next env.redirect "/channel/#{ucid}"
end
items, continuation = fetch_channel_playlists(ucid, author, auto_generated, continuation, sort_by)
items.select! { |item| item.is_a?(SearchPlaylist) && !item.videos.empty? }
items = items.map { |item| item.as(SearchPlaylist) }
items.each { |item| item.author = "" }
templated "playlists"
end
# API Endpoints
get "/api/v1/stats" do |env|
env.response.content_type = "application/json"
if !config.statistics_enabled
error_message = {"error" => "Statistics are not enabled."}.to_json
halt env, status_code: 400, response: error_message
end
if statistics["error"]?
halt env, status_code: 500, response: statistics.to_json
end
if env.params.query["pretty"]? && env.params.query["pretty"] == "1"
statistics.to_pretty_json
else
statistics.to_json
end
end
get "/api/v1/captions/:id" do |env|
locale = LOCALES[env.get("locale").as(String)]?
@ -2470,7 +2733,7 @@ get "/api/v1/insights/:id" do |env|
env.response.content_type = "application/json"
error_message = {"error" => "YouTube has removed publicly-available analytics."}.to_json
halt env, status_code: 503, response: error_message
halt env, status_code: 410, response: error_message
client = make_client(YT_URL)
headers = HTTP::Headers.new
@ -2636,7 +2899,7 @@ get "/api/v1/videos/:id" do |env|
end
if video.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
host_params = env.request.query_params
host_params.delete_all("v")
@ -2854,6 +3117,11 @@ get "/api/v1/top" do |env|
env.response.content_type = "application/json"
if !config.top_enabled
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
halt env, status_code: 400, response: error_message
end
videos = JSON.build do |json|
json.array do
top_videos.each do |video|
@ -3411,7 +3679,7 @@ get "/api/v1/search" do |env|
date = env.params.query["date"]?.try &.downcase
date ||= ""
duration = env.params.query["date"]?.try &.downcase
duration = env.params.query["duration"]?.try &.downcase
duration ||= ""
features = env.params.query["features"]?.try &.split(",").map { |feature| feature.downcase }
@ -3825,7 +4093,7 @@ get "/api/manifest/hls_variant/*" do |env|
env.response.content_type = "application/x-mpegURL"
env.response.headers.add("Access-Control-Allow-Origin", "*")
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
manifest = manifest.body
manifest.gsub("https://www.youtube.com", host_url)
@ -3839,7 +4107,7 @@ get "/api/manifest/hls_playlist/*" do |env|
halt env, status_code: manifest.status_code
end
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, CONFIG.domain)
host_url = make_host_url(config, Kemal.config)
manifest = manifest.body.gsub("https://www.youtube.com", host_url)
manifest = manifest.gsub(/https:\/\/r\d---.{11}\.c\.youtube\.com/, host_url)
@ -3957,7 +4225,7 @@ end
get "/videoplayback" do |env|
query_params = env.params.query
fvip = query_params["fvip"]
fvip = query_params["fvip"]? || "3"
mn = query_params["mn"].split(",")[-1]
host = "https://r#{fvip}---#{mn}.googlevideo.com"
url = "/videoplayback?#{query_params.to_s}"
@ -4001,7 +4269,8 @@ get "/videoplayback" do |env|
env.response.status_code = response.status_code
if title = env.params.query["title"]?
env.response.headers["Content-Disposition"] = "attachment; filename=\"#{title}\""
# https://blog.fastmail.com/2011/06/24/download-non-english-filenames/
env.response.headers["Content-Disposition"] = "attachment; filename=\"#{URI.escape(title)}\"; filename*=UTF-8''#{URI.escape(title)}"
end
response.headers.each do |key, value|

View File

@ -1,9 +1,10 @@
class InvidiousChannel
add_mapping({
id: String,
author: String,
updated: Time,
deleted: Bool,
id: String,
author: String,
updated: Time,
deleted: Bool,
subscribed: Time?,
})
end
@ -15,10 +16,7 @@ class ChannelVideo
updated: Time,
ucid: String,
author: String,
length_seconds: {
type: Int32,
default: 0,
},
length_seconds: {type: Int32, default: 0},
})
end
@ -188,11 +186,31 @@ 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)
channel = InvidiousChannel.new(ucid, author, Time.now, 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)

View File

@ -252,7 +252,7 @@ end
def fetch_reddit_comments(id)
client = make_client(REDDIT_URL)
headers = HTTP::Headers{"User-Agent" => "web:invidio.us:v0.14.0 (by /u/omarroth)"}
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)"
search_results = client.get("/search.json?q=#{query}", headers)

View File

@ -1,9 +1,9 @@
class Config
YAML.mapping({
video_threads: Int32, # Number of threads to use for updating videos in cache (mostly non-functional)
crawl_threads: Int32, # Number of threads to use for finding new videos from YouTube (used to populate "top" page)
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
video_threads: Int32, # Number of threads to use for updating videos in cache (mostly non-functional)
db: NamedTuple( # Database configuration
user: String,
password: String,
@ -11,11 +11,19 @@ user: String,
port: Int32,
dbname: String,
),
dl_api_key: String?, # DetectLanguage API Key (used to filter non-English results from "top" page), mostly non-functional
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
full_refresh: Bool, # Used for crawling channels: threads should check all videos uploaded by a channel
domain: String, # Domain to be used for links to resources on the site where an absolute URL is required
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
domain: String?, # Domain to be used for links to resources on the site where an absolute URL is required
use_pubsub_feeds: {type: Bool, default: false}, # Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
default_home: {type: String, default: "Top"},
feed_menu: {type: Array(String), default: ["Popular", "Top", "Trending", "Subscriptions"]},
top_enabled: {type: Bool, default: true},
captcha_enabled: {type: Bool, default: true},
login_enabled: {type: Bool, default: true},
registration_enabled: {type: Bool, default: true},
statistics_enabled: {type: Bool, default: false},
admins: {type: Array(String), default: [] of String},
})
end
@ -66,7 +74,7 @@ class DenyFrame < Kemal::Handler
end
end
def rank_videos(db, n, filter, url)
def rank_videos(db, n)
top = [] of {Float64, String}
db.query("SELECT id, wilson_score, published FROM videos WHERE views > 5000 ORDER BY published DESC LIMIT 1000") do |rs|
@ -87,41 +95,7 @@ def rank_videos(db, n, filter, url)
top.reverse!
top = top.map { |a, b| b }
if filter
language_list = [] of String
top.each do |id|
if language_list.size == n
break
else
client = make_client(url)
begin
video = get_video(id, db)
rescue ex
next
end
if video.language
language = video.language
else
description = XML.parse(video.description)
content = [video.title, description.content].join(" ")
content = content[0, 10000]
results = DetectLanguage.detect(content)
language = results[0].language
db.exec("UPDATE videos SET language = $1 WHERE id = $2", language, id)
end
if language == "en"
language_list << id
end
end
end
return language_list
else
return top[0..n - 1]
end
return top[0..n - 1]
end
def login_req(login_form, f_req)

View File

@ -193,14 +193,28 @@ def arg_array(array, start = 1)
return args
end
def make_host_url(ssl, host)
def make_host_url(config, kemal_config)
ssl = config.https_only || kemal_config.ssl
if ssl
scheme = "https://"
else
scheme = "http://"
end
return "#{scheme}#{host}"
if kemal_config.port != 80 && kemal_config.port != 443
port = ":#{kemal_config.port}"
else
port = ""
end
if !config.domain
return ""
end
host = config.domain.not_nil!.lchop(".")
return "#{scheme}#{host}#{port}"
end
def get_referer(env, fallback = "/")

View File

@ -73,7 +73,7 @@ def refresh_channels(db, logger, max_threads = 1, full_refresh = false)
db.exec("UPDATE channels SET updated = $1, author = $2, deleted = false WHERE id = $3", Time.now, channel.author, id)
rescue ex
if ex.message == "Deleted or invalid channel"
db.exec("UPDATE channels SET deleted = true WHERE id = $1", id)
db.exec("UPDATE channels SET updated = $1, deleted = true WHERE id = $2", Time.now, id)
end
logger.write("#{id} : #{ex.message}\n")
end
@ -131,7 +131,16 @@ def refresh_feeds(db, logger, max_threads = 1)
begin
db.exec("REFRESH MATERIALIZED VIEW #{view_name}")
rescue ex
logger.write("REFRESH #{email} : #{ex.message}\n")
# Create view if it doesn't exist
if ex.message.try &.ends_with? "does not exist"
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.write("CREATE #{view_name}")
else
logger.write("REFRESH #{email} : #{ex.message}\n")
end
end
active_channel.send(true)
@ -144,19 +153,32 @@ def refresh_feeds(db, logger, max_threads = 1)
max_channel.send(max_threads)
end
def pull_top_videos(config, db)
if config.dl_api_key
DetectLanguage.configure do |dl_config|
dl_config.api_key = config.dl_api_key.not_nil!
def subscribe_to_feeds(db, logger, key, config)
if config.use_pubsub_feeds
spawn do
loop do
db.query_all("SELECT id FROM channels WHERE CURRENT_TIMESTAMP - subscribed > '4 days'") do |rs|
rs.each do
ucid = rs.read(String)
response = subscribe_pubsub(ucid, key, config)
if response.status_code >= 400
logger.write("#{ucid} : #{response.body}\n")
end
end
end
sleep 1.minute
Fiber.yield
end
end
filter = true
end
end
filter ||= false
def pull_top_videos(config, db)
loop do
begin
top = rank_videos(db, 40, filter, YT_URL)
top = rank_videos(db, 40)
rescue ex
next
end
@ -184,11 +206,11 @@ end
def pull_popular_videos(db)
loop do
subscriptions = PG_DB.query_all("SELECT channel FROM \
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 = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM \
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

View File

@ -99,7 +99,10 @@ def template_mix(mix)
html += <<-END_HTML
<li class="pure-menu-item">
<a href="/watch?v=#{video["videoId"]}&list=#{mix["mixId"]}">
<img style="width:100%;" src="/vi/#{video["videoId"]}/mqdefault.jpg">
<div class="thumbnail">
<img class="thumbnail" src="/vi/#{video["videoId"]}/mqdefault.jpg">
<p class="length">#{recode_length_seconds(video["lengthSeconds"].as_i)}</p>
</div>
<p style="width:100%">#{video["title"]}</p>
<p>
<b style="width: 100%">#{video["author"]}</b>

View File

@ -234,7 +234,10 @@ def template_playlist(playlist)
html += <<-END_HTML
<li class="pure-menu-item">
<a href="/watch?v=#{video["videoId"]}&list=#{playlist["playlistId"]}">
<img style="width:100%;" src="/vi/#{video["videoId"]}/mqdefault.jpg">
<div class="thumbnail">
<img class="thumbnail" src="/vi/#{video["videoId"]}/mqdefault.jpg">
<p class="length">#{recode_length_seconds(video["lengthSeconds"].as_i)}</p>
</div>
<p style="width:100%">#{video["title"]}</p>
<p>
<b style="width: 100%">#{video["author"]}</b>

View File

@ -188,7 +188,7 @@ def produce_search_params(sort : String = "relevance", date : String = "", conte
end
end
if body.size > 0
if !body.empty?
token = head + "\x12" + body.size.unsafe_chr + body
else
token = head

View File

@ -143,7 +143,7 @@ def get_user(sid, headers, db, refresh = true)
begin
view_name = "subscriptions_#{sha256(user.email)[0..7]}"
PG_DB.exec("CREATE MATERIALIZED VIEW #{view_name} AS \
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;")
@ -165,7 +165,7 @@ def get_user(sid, headers, db, refresh = true)
begin
view_name = "subscriptions_#{sha256(user.email)[0..7]}"
PG_DB.exec("CREATE MATERIALIZED VIEW #{view_name} AS \
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;")
@ -247,7 +247,7 @@ def validate_response(challenge, token, user_id, operation, key, db, locale)
raise translate(locale, "Invalid challenge")
end
challenge = OpenSSL::HMAC.digest(:sha256, HMAC_KEY, challenge)
challenge = OpenSSL::HMAC.digest(:sha256, key, challenge)
challenge = Base64.urlsafe_encode(challenge)
if db.query_one?("SELECT EXISTS (SELECT true FROM nonces WHERE nonce = $1)", nonce, as: Bool)

View File

@ -271,9 +271,51 @@ class Video
def fmt_stream(decrypt_function)
streams = [] of HTTP::Params
self.info["url_encoded_fmt_stream_map"].split(",") do |string|
if !string.empty?
streams << HTTP::Params.parse(string)
if fmt_streams = self.player_response["streamingData"]?.try &.["formats"]?
fmt_streams.as_a.each do |fmt_stream|
if !fmt_stream.as_h?
next
end
fmt = {} of String => String
fmt["lmt"] = fmt_stream["lastModified"]?.try &.as_s || "0"
fmt["projection_type"] = "1"
fmt["type"] = fmt_stream["mimeType"].as_s
fmt["clen"] = fmt_stream["contentLength"]?.try &.as_s || "0"
fmt["bitrate"] = fmt_stream["bitrate"]?.try &.as_i.to_s || "0"
fmt["itag"] = fmt_stream["itag"].as_i.to_s
fmt["url"] = fmt_stream["url"].as_s
fmt["quality"] = fmt_stream["quality"].as_s
if fmt_stream["width"]?
fmt["size"] = "#{fmt_stream["width"]}x#{fmt_stream["height"]}"
fmt["height"] = fmt_stream["height"].as_i.to_s
end
if fmt_stream["fps"]?
fmt["fps"] = fmt_stream["fps"].as_i.to_s
end
if fmt_stream["qualityLabel"]?
fmt["quality_label"] = fmt_stream["qualityLabel"].as_s
end
params = HTTP::Params.new
fmt.each do |key, value|
params[key] = value
end
streams << params
end
streams.sort_by! { |stream| stream["height"].to_i }.reverse!
elsif fmt_stream = self.info["url_encoded_fmt_stream_map"]?
fmt_stream.split(",").each do |string|
if !string.empty?
streams << HTTP::Params.parse(string)
end
end
end
@ -296,80 +338,54 @@ class Video
def adaptive_fmts(decrypt_function)
adaptive_fmts = [] of HTTP::Params
if self.info.has_key?("adaptive_fmts")
self.info["adaptive_fmts"].split(",") do |string|
adaptive_fmts << HTTP::Params.parse(string)
end
elsif dashmpd = self.player_response["streamingData"]["dashManifestUrl"]?.try &.as_s
client = make_client(YT_URL)
response = client.get(dashmpd)
document = XML.parse_html(response.body)
document.xpath_nodes(%q(//adaptationset)).each do |adaptation_set|
mime_type = adaptation_set["mimetype"]
document.xpath_nodes(%q(.//representation)).each do |representation|
codecs = representation["codecs"]
itag = representation["id"]
bandwidth = representation["bandwidth"]
url = representation.xpath_node(%q(.//baseurl)).not_nil!.content
clen = url.match(/clen\/(?<clen>\d+)/).try &.["clen"]
clen ||= "0"
lmt = url.match(/lmt\/(?<lmt>\d+)/).try &.["lmt"]
lmt ||= "#{((Time.now + 1.hour).to_unix_f.to_f64 * 1000000).to_i64}"
segment_list = representation.xpath_node(%q(.//segmentlist)).not_nil!
init = segment_list.xpath_node(%q(.//initialization))
# TODO: Replace with sane defaults when byteranges are absent
if init && !init["sourceurl"].starts_with? "sq"
init = init["sourceurl"].lchop("range/")
index = segment_list.xpath_node(%q(.//segmenturl)).not_nil!["media"]
index = index.lchop("range/")
index = "#{init.split("-")[1].to_i + 1}-#{index.split("-")[0].to_i}"
else
init = "0-0"
index = "1-1"
end
params = {
"type" => ["#{mime_type}; codecs=\"#{codecs}\""],
"url" => [url],
"projection_type" => ["1"],
"index" => [index],
"init" => [init],
"xtags" => [] of String,
"lmt" => [lmt],
"clen" => [clen],
"bitrate" => [bandwidth],
"itag" => [itag],
}
if mime_type == "video/mp4"
width = representation["width"]?
height = representation["height"]?
fps = representation["framerate"]?
metadata = itag_to_metadata?(itag)
if metadata
width ||= metadata["width"]?
height ||= metadata["height"]?
fps ||= metadata["fps"]?
end
if width && height
params["size"] = ["#{width}x#{height}"]
end
if width
params["quality_label"] = ["#{height}p"]
end
end
adaptive_fmts << HTTP::Params.new(params)
if fmts = self.player_response["streamingData"]?.try &.["adaptiveFormats"]?
fmts.as_a.each do |adaptive_fmt|
if !adaptive_fmt.as_h?
next
end
fmt = {} of String => String
if init = adaptive_fmt["initRange"]?
fmt["init"] = "#{init["start"]}-#{init["end"]}"
end
fmt["init"] ||= "0-0"
fmt["lmt"] = adaptive_fmt["lastModified"]?.try &.as_s || "0"
fmt["projection_type"] = "1"
fmt["type"] = adaptive_fmt["mimeType"].as_s
fmt["clen"] = adaptive_fmt["contentLength"]?.try &.as_s || "0"
fmt["bitrate"] = adaptive_fmt["bitrate"]?.try &.as_i.to_s || "0"
fmt["itag"] = adaptive_fmt["itag"].as_i.to_s
fmt["url"] = adaptive_fmt["url"].as_s
if index = adaptive_fmt["indexRange"]?
fmt["index"] = "#{index["start"]}-#{index["end"]}"
end
fmt["index"] ||= "0-0"
if adaptive_fmt["width"]?
fmt["size"] = "#{adaptive_fmt["width"]}x#{adaptive_fmt["height"]}"
end
if adaptive_fmt["fps"]?
fmt["fps"] = adaptive_fmt["fps"].as_i.to_s
end
if adaptive_fmt["qualityLabel"]?
fmt["quality_label"] = adaptive_fmt["qualityLabel"].as_s
end
params = HTTP::Params.new
fmt.each do |key, value|
params[key] = value
end
adaptive_fmts << params
end
elsif fmts = self.info["adaptive_fmts"]?
fmts.split(",") do |string|
adaptive_fmts << HTTP::Params.parse(string)
end
end
@ -387,13 +403,13 @@ class Video
end
def video_streams(adaptive_fmts)
video_streams = adaptive_fmts.compact_map { |s| s["type"].starts_with?("video") ? s : nil }
video_streams = adaptive_fmts.select { |s| s["type"].starts_with? "video" }
return video_streams
end
def audio_streams(adaptive_fmts)
audio_streams = adaptive_fmts.compact_map { |s| s["type"].starts_with?("audio") ? s : nil }
audio_streams = adaptive_fmts.select { |s| s["type"].starts_with? "audio" }
audio_streams.sort_by! { |s| s["bitrate"].to_i }.reverse!
audio_streams.each do |stream|
stream["bitrate"] = (stream["bitrate"].to_f64/1000).to_i.to_s
@ -620,7 +636,10 @@ def fetch_video(id, proxies, region)
# Try to pull streams from embed URL
if info["reason"]?
embed_info = HTTP::Params.parse(client.get("/get_video_info?video_id=#{id}&ps=default&eurl=&gl=US&hl=en&disable_polymer=1").body)
embed_page = client.get("/embed/#{id}").body
sts = embed_page.match(/"sts"\s*:\s*(?<sts>\d+)/).try &.["sts"]?
sts ||= ""
embed_info = HTTP::Params.parse(client.get("/get_video_info?video_id=#{id}&eurl=https://youtube.googleapis.com/v/#{id}&gl=US&hl=en&disable_polymer=1&sts=#{sts}").body)
if !embed_info["reason"]?
embed_info.each do |key, value|

View File

@ -21,12 +21,20 @@
<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>
<div class="pure-u-1 pure-md-1-3">
<b><%= translate(locale, "Videos") %></b>
</div>
<div class="pure-u-1 pure-md-1-3">
<% if !auto_generated %>
<a href="/channel/<%= ucid %>/playlists"><%= translate(locale, "Playlists") %></a>
<% end %>
</div>
</div>
<div class="pure-u-1-3">
</div>
<div class="pure-u-1-3">
<div class="pure-g" style="text-align:right;">
<% {"newest", "oldest", "popular"}.each do |sort| %>
<% sort_options.each do |sort| %>
<div class="pure-u-1 pure-md-1-3">
<% if sort_by == sort %>
<b><%= translate(locale, sort) %></b>

View File

@ -1,13 +1,13 @@
<div class="h-box pure-g">
<div class="pure-u-1-4"></div>
<div class="pure-u-1 pure-u-md-1-4"></div>
<div class="pure-u-1 pure-u-md-1-2">
<div class="pure-g">
<% feeds = ["Popular", "Top", "Trending"] %>
<% if env.get? "user" %>
<% feeds << "Subscriptions" %>
<% feed_menu = config.feed_menu.dup %>
<% if !env.get?("user") %>
<% feed_menu.reject! {|feed| feed == "Subscriptions"} %>
<% end %>
<% feeds.each do |feed| %>
<div class="pure-u-1-<%= feeds.size %>">
<% feed_menu.each do |feed| %>
<div class="pure-u-1-2 pure-u-md-1-<%= feed_menu.size %>">
<a href="/feed/<%= feed.downcase %>" style="text-align:center;" class="pure-menu-heading">
<%= translate(locale, feed) %>
</a>
@ -15,5 +15,5 @@
<% end %>
</div>
</div>
<div class="pure-u-1-4"></div>
<div class="pure-u-1 pure-u-md-1-4"></div>
</div>

View File

@ -137,8 +137,6 @@ player.on('error', function(event) {
}
});
player.share(shareOptions);
<% if params[:video_start] > 0 || params[:video_end] > 0 %>
player.markers({
onMarkerReached: function(marker) {
@ -188,4 +186,7 @@ if (bpb) {
});
}
<% end %>
// Since videojs-share can sometimes be blocked, we try to load it last
player.share(shareOptions);
</script>

View File

@ -1,14 +0,0 @@
<% content_for "header" do %>
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
<title>Invidious</title>
<% end %>
<%= rendered "components/feed_menu" %>
<div class="pure-g">
<% top_videos.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<%= rendered "components/item" %>
<% end %>
<% end %>
</div>

View File

@ -27,36 +27,40 @@
<label for="password"><%= translate(locale, "Password:") %></label>
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
<% if captcha_type == "image" %>
<img style="width:100%" src='<%= captcha.not_nil![:image] %>'/>
<input type="hidden" name="token" value="<%= captcha.not_nil![:token] %>">
<input type="hidden" name="challenge" value="<%= captcha.not_nil![:challenge] %>">
<label for="answer"><%= translate(locale, "Time (h:mm:ss):") %></label>
<input required type="text" name="answer" type="text" placeholder="h:mm:ss">
<label>
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious&captcha=text">
<%= translate(locale, "Text CAPTCHA") %>
</a>
</label>
<% else %>
<% text_captcha.not_nil![:tokens].each_with_index do |token, i| %>
<input type="hidden" name="text_challenge<%= i %>" value="<%= token[0] %>">
<input type="hidden" name="text_token<%= i %>" value="<%= token[1] %>">
<% end %>
<label for="text_answer"><%= text_captcha.not_nil![:question] %></label>
<input required type="text" name="text_answer" type="text" placeholder="Answer">
<label>
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious">
<%= translate(locale, "Image CAPTCHA") %>
</a>
</label>
<% if config.captcha_enabled %>
<% if captcha_type == "image" %>
<img style="width:100%" src='<%= captcha.not_nil![:image] %>'/>
<input type="hidden" name="token" value="<%= captcha.not_nil![:token] %>">
<input type="hidden" name="challenge" value="<%= captcha.not_nil![:challenge] %>">
<label for="answer"><%= translate(locale, "Time (h:mm:ss):") %></label>
<input required type="text" name="answer" type="text" placeholder="h:mm:ss">
<label>
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious&captcha=text">
<%= translate(locale, "Text CAPTCHA") %>
</a>
</label>
<% else %>
<% text_captcha.not_nil![:tokens].each_with_index do |token, i| %>
<input type="hidden" name="text_challenge<%= i %>" value="<%= token[0] %>">
<input type="hidden" name="text_token<%= i %>" value="<%= token[1] %>">
<% end %>
<label for="text_answer"><%= text_captcha.not_nil![:question] %></label>
<input required type="text" name="text_answer" type="text" placeholder="Answer">
<label>
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious">
<%= translate(locale, "Image CAPTCHA") %>
</a>
</label>
<% end %>
<% end %>
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary"><%= translate(locale, "Sign In") %></button>
<% if config.registration_enabled %>
<button type="submit" name="action" value="register" class="pure-button pure-button-primary"><%= translate(locale, "Register") %></button>
<% end %>
</fieldset>
</form>
<% elsif account_type == "google" %>
@ -67,7 +71,7 @@
<label for="password"><%= translate(locale, "Password:") %></label>
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
<% if tfa %>
<label for="tfa"><%= translate(locale, "Google verification code:") %></label>
<input required class="pure-input-1" name="tfa" type="text" placeholder="Google verification code">

View File

@ -0,0 +1,80 @@
<% content_for "header" do %>
<title><%= author %> - Invidious</title>
<% end %>
<div class="pure-g h-box">
<div class="pure-u-2-3">
<h3><%= author %></h3>
</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>
</h3>
</div>
</div>
<div class="h-box">
<% sub_count_text = number_to_short_text(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>
</div>
<div class="pure-u-1 pure-md-1-3">
<a href="/channel/<%= ucid %>"><%= translate(locale, "Videos") %></a>
</div>
<div class="pure-u-1 pure-md-1-3">
<% if !auto_generated %>
<b><%= translate(locale, "Playlists") %></b>
<% end %>
</div>
</div>
<div class="pure-u-1-3">
</div>
<div class="pure-u-1-3">
<div class="pure-g" style="text-align:right;">
<% {"last", "oldest", "newest"}.each do |sort| %>
<div class="pure-u-1 pure-md-1-3">
<% if sort_by == sort %>
<b><%= translate(locale, sort) %></b>
<% else %>
<a href="/channel/<%= ucid %>/playlists?sort_by=<%= sort %>">
<%= translate(locale, sort) %>
</a>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
<div class="h-box">
<hr>
</div>
<div class="pure-g">
<% items.each_slice(4) do |slice| %>
<% slice.each do |item| %>
<%= rendered "components/item" %>
<% end %>
<% end %>
</div>
<div class="pure-g h-box">
<div class="pure-u-1 pure-u-md-4-5"></div>
<div style="text-align:right;" class="pure-u-1 pure-u-md-1-5">
<% if items.size >= 28 %>
<a href="/channel/<%= ucid %>/playlists?continuation=<%= continuation %><% if sort_by != "last" %>&sort_by=<%= sort_by %><% end %>">
<%= translate(locale, "Next page") %>
</a>
<% end %>
</div>
</div>
<script>
<% sub_count_text = number_to_short_text(sub_count) %>
<%= rendered "components/subscribe_widget_script" %>
</script>

View File

@ -1,6 +1,6 @@
<% content_for "header" do %>
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
<title><%= translate(locale, "Popular") %> - Invidious</title>
<title><% if config.default_home != "Popular" %><%= translate(locale, "Popular") %> - <% end %>Invidious</title>
<% end %>
<%= rendered "components/feed_menu" %>

View File

@ -58,45 +58,25 @@ function update_value(element) {
</div>
<div class="pure-control-group">
<label for="comments_0"><%= translate(locale, "Default comments: ") %></label>
<select name="comments_0" id="comments_0">
<label for="comments[0]"><%= translate(locale, "Default comments: ") %></label>
<% preferences.comments.each_with_index do |comments, index| %>
<select name="comments[<%= index %>]" id="comments[<%= index %>]">
<% {"", "youtube", "reddit"}.each do |option| %>
<option value="<%= option %>" <% if preferences.comments[0] == option %> selected <% end %>><%= translate(locale, option) %></option>
<option value="<%= option %>" <% if preferences.comments[index] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
<% end %>
</div>
<div class="pure-control-group">
<label for="comments_1"><%= translate(locale, "Fallback comments: ") %></label>
<select name="comments_1" id="comments_1">
<% {"", "youtube", "reddit"}.each do |option| %>
<option value="<%= option %>" <% if preferences.comments[1] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
<label for="captions_0"><%= translate(locale, "Default captions: ") %></label>
<select class="pure-u-1-5" name="captions_0" id="captions_0">
<label for="captions[0]"><%= translate(locale, "Default captions: ") %></label>
<% preferences.captions.each_with_index do |caption, index| %>
<select class="pure-u-1-6" name="captions[<%= index %>]" id="captions[<%= index %>]">
<% CAPTION_LANGUAGES.each do |option| %>
<option value="<%= option %>" <% if preferences.captions[0] == option %> selected <% end %>><%= translate(locale, option) %></option>
<option value="<%= option %>" <% if preferences.captions[index] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
<label for="captions_fallback"><%= translate(locale, "Fallback captions: ") %></label>
<select class="pure-u-1-5" name="captions_1" id="captions_1">
<% CAPTION_LANGUAGES.each do |option| %>
<option value="<%= option %>" <% if preferences.captions[1] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
<select class="pure-u-1-5" name="captions_2" id="captions_2">
<% CAPTION_LANGUAGES.each do |option| %>
<option value="<%= option %>" <% if preferences.captions[2] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
@ -167,13 +147,62 @@ function update_value(element) {
</div>
<% end %>
<% if env.get?("user") && config.admins.includes? env.get?("user").as(User).email %>
<legend><%= translate(locale, "Administrator preferences") %></legend>
<div class="pure-control-group">
<label for="default_home"><%= translate(locale, "Default homepage: ") %></label>
<select name="default_home" id="default_home">
<% {"Popular", "Top", "Trending", "Subscriptions"}.each do |option| %>
<option value="<%= option %>" <% if config.default_home == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
<label for="feed_menu"><%= translate(locale, "Feed menu: ") %></label>
<% 4.times do |index| %>
<select name="feed_menu[<%= index %>]" id="feed_menu[<%= index %>]">
<% {"", "Popular", "Top", "Trending", "Subscriptions"}.each do |option| %>
<option value="<%= option %>" <% if config.feed_menu[index]? == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
<% end %>
</div>
<div class="pure-control-group">
<label for="top_enabled"><%= translate(locale, "Top enabled? ") %></label>
<input name="top_enabled" id="top_enabled" type="checkbox" <% if config.top_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="captcha_enabled"><%= translate(locale, "CAPTCHA enabled? ") %></label>
<input name="captcha_enabled" id="captcha_enabled" type="checkbox" <% if config.captcha_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="login_enabled"><%= translate(locale, "Login enabled? ") %></label>
<input name="login_enabled" id="login_enabled" type="checkbox" <% if config.login_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="registration_enabled"><%= translate(locale, "Registration enabled? ") %></label>
<input name="registration_enabled" id="registration_enabled" type="checkbox" <% if config.registration_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="statistics_enabled"><%= translate(locale, "Report statistics? ") %></label>
<input name="statistics_enabled" id="statistics_enabled" type="checkbox" <% if config.statistics_enabled %>checked<% end %>>
</div>
<% end %>
<% if env.get? "user" %>
<legend><%= translate(locale, "Data preferences") %></legend>
<div class="pure-control-group">
<a href="/clear_watch_history?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Clear watch history") %></a>
</div>
<div class="pure-control-group">
<a href="/data_control?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Import/Export data") %></a>
</div>

View File

@ -72,7 +72,7 @@ function mark_watched(target) {
}
</script>
<div class="pure-g">
<div class="pure-g h-box">
<div class="pure-u-1 pure-u-md-1-5">
<% if page >= 2 %>
<a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page - 1 %>">

View File

@ -89,43 +89,48 @@
<i class="icon ion-ios-cog"></i>
</a>
</div>
<% if config.login_enabled %>
<div class="pure-u-1-3">
<a href="/login?referer=<%= env.get?("current_page") %>" class="pure-menu-heading">
<%= translate(locale, "Login") %>
</a>
</div>
<% end %>
<% end %>
</div>
</div>
<%= content %>
<div class="footer">
<p>
<a href="https://github.com/omarroth">
<%= translate(locale, "Released under the AGPLv3 by Omar Roth.") %>
</a>
</p>
<p>
<a href="https://github.com/omarroth/invidious">
<%= translate(locale, "Source available here.") %>
</a>
</p>
<p><%= translate(locale, "Liberapay: ") %>
<a href="https://liberapay.com/omarroth">
https://liberapay.com/omarroth
</a>
</p>
<p><%= translate(locale, "Patreon: ") %>
<a href="https://patreon.com/omarroth">
https://patreon.com/omarroth
</a>
</p>
<p><%= translate(locale, "BTC: ") %>356DpZyMXu6rYd55Yqzjs29n79kGKWcYrY</p>
<p><%= translate(locale, "BCH: ") %>qq4ptclkzej5eza6a50et5ggc58hxsq5aylqut2npk</p>
<p>
<a rel="jslicense" href="/licenses">
<%= translate(locale, "View JavaScript license information.") %>
</a>
</p>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-3">
<a href="https://github.com/omarroth/invidious">
<%= translate(locale, "Released under the AGPLv3 by Omar Roth.") %>
</a>
</div>
<div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-bitcoin"></i>
<%= translate(locale, "BTC: ") %>356DpZyMXu6rYd55Yqzjs29n79kGKWcYrY</div>
<div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-bitcoin"></i>
<%= translate(locale, "BCH: ") %>qq4ptclkzej5eza6a50et5ggc58hxsq5aylqut2npk</div>
<div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-usd"></i>
<a href="https://liberapay.com/omarroth"><%= translate(locale, "Liberapay") %></a>
/
<a href="https://patreon.com/omarroth"><%= translate(locale, "Patreon") %></a>
</div>
<div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-javascript"></i>
<a rel="jslicense" href="/licenses">
<%= translate(locale, "View JavaScript license information.") %>
</a>
</div>
<div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-github"></i>
<%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %>
<i class="icon ion-logo-github"></i>
<%= CURRENT_BRANCH %></div>
</div>
</div>
</div>
<div class="pure-u-1 pure-u-md-2-24"></div>

View File

@ -1,6 +1,6 @@
<% content_for "header" do %>
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
<title><%= translate(locale, "Top") %> - Invidious</title>
<title><% if config.default_home != "Top" %><%= translate(locale, "Top") %> - <% end %>Invidious</title>
<% end %>
<%= rendered "components/feed_menu" %>

View File

@ -1,6 +1,6 @@
<% content_for "header" do %>
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
<title><%= translate(locale, "Trending") %> - Invidious</title>
<title><% if config.default_home != "Trending" %><%= translate(locale, "Trending") %> - <% end %>Invidious</title>
<% end %>
<%= rendered "components/feed_menu" %>

View File

@ -59,17 +59,17 @@
<label for="download_widget"><%= translate(locale, "Download as: ") %></label>
<select style="width:100%" name="download_widget" id="download_widget">
<% video_streams.each do |option| %>
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= video.title.dump_unquoted %>-<%= video.id %>.mp4"}'>
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= URI.escape(video.title) %>-<%= video.id %>.mp4"}'>
<%= option["quality_label"] %> - <%= option["type"].split(";")[0] %> @ <%= option["fps"] %>fps - video only
</option>
<% end %>
<% audio_streams.each do |option| %>
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= video.title.dump_unquoted %>-<%= video.id %>.mp4"}'>
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= URI.escape(video.title) %>-<%= video.id %>.mp4"}'>
<%= option["type"].split(";")[0] %> @ <%= option["bitrate"] %>k - audio only
</option>
<% end %>
<% fmt_stream.each do |option| %>
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= video.title.dump_unquoted %>-<%= video.id %>.mp4"}'>
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= URI.escape(video.title) %>-<%= video.id %>.mp4"}'>
<%= itag_to_metadata?(option["itag"]).try &.["height"]? || "~240" %>p - <%= option["type"].split(";")[0] %>
</option>
<% end %>