summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr22
-rw-r--r--src/invidious/exceptions.cr6
-rw-r--r--src/invidious/helpers/errors.cr15
-rw-r--r--src/invidious/videos.cr23
-rw-r--r--src/invidious/views/embed.ecr2
5 files changed, 50 insertions, 18 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index f4cae7ea..1ff70905 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -114,16 +114,18 @@ LOGGER = Invidious::LogHandler.new(OUTPUT, CONFIG.log_level)
# Check table integrity
Invidious::Database.check_integrity(CONFIG)
-# Resolve player dependencies. This is done at compile time.
-#
-# Running the script by itself would show some colorful feedback while this doesn't.
-# Perhaps we should just move the script to runtime in order to get that feedback?
-
-{% puts "\nChecking player dependencies...\n" %}
-{% if flag?(:minified_player_dependencies) %}
- {% puts run("../scripts/fetch-player-dependencies.cr", "--minified").stringify %}
-{% else %}
- {% puts run("../scripts/fetch-player-dependencies.cr").stringify %}
+{% if !flag?(:skip_videojs_download) %}
+ # Resolve player dependencies. This is done at compile time.
+ #
+ # Running the script by itself would show some colorful feedback while this doesn't.
+ # Perhaps we should just move the script to runtime in order to get that feedback?
+
+ {% puts "\nChecking player dependencies...\n" %}
+ {% if flag?(:minified_player_dependencies) %}
+ {% puts run("../scripts/fetch-player-dependencies.cr", "--minified").stringify %}
+ {% else %}
+ {% puts run("../scripts/fetch-player-dependencies.cr").stringify %}
+ {% end %}
{% end %}
# Start jobs
diff --git a/src/invidious/exceptions.cr b/src/invidious/exceptions.cr
index 391a574d..490d98cd 100644
--- a/src/invidious/exceptions.cr
+++ b/src/invidious/exceptions.cr
@@ -1,8 +1,12 @@
# Exception used to hold the name of the missing item
# Should be used in all parsing functions
-class BrokenTubeException < InfoException
+class BrokenTubeException < Exception
getter element : String
def initialize(@element)
end
+
+ def message
+ return "Missing JSON element \"#{@element}\""
+ end
end
diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr
index 3acbac84..6155e561 100644
--- a/src/invidious/helpers/errors.cr
+++ b/src/invidious/helpers/errors.cr
@@ -38,12 +38,15 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, exce
issue_title = "#{exception.message} (#{exception.class})"
- issue_template = %(Title: `#{issue_title}`)
- issue_template += %(\nDate: `#{Time::Format::ISO_8601_DATE_TIME.format(Time.utc)}`)
- issue_template += %(\nRoute: `#{env.request.resource}`)
- issue_template += %(\nVersion: `#{SOFTWARE["version"]} @ #{SOFTWARE["branch"]}`)
- # issue_template += github_details("Preferences", env.get("preferences").as(Preferences).to_pretty_json)
- issue_template += github_details("Backtrace", exception.inspect_with_backtrace)
+ issue_template = <<-TEXT
+ Title: `#{HTML.escape(issue_title)}`
+ Date: `#{Time::Format::ISO_8601_DATE_TIME.format(Time.utc)}`
+ Route: `#{HTML.escape(env.request.resource)}`
+ Version: `#{SOFTWARE["version"]} @ #{SOFTWARE["branch"]}`
+
+ TEXT
+
+ issue_template += github_details("Backtrace", HTML.escape(exception.inspect_with_backtrace))
# URLs for the error message below
url_faq = "https://github.com/iv-org/documentation/blob/master/FAQ.md"
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr
index 446e8e03..335f6b60 100644
--- a/src/invidious/videos.cr
+++ b/src/invidious/videos.cr
@@ -2,6 +2,8 @@ CAPTION_LANGUAGES = {
"",
"English",
"English (auto-generated)",
+ "English (United Kingdom)",
+ "English (United States)",
"Afrikaans",
"Albanian",
"Amharic",
@@ -14,23 +16,31 @@ CAPTION_LANGUAGES = {
"Bosnian",
"Bulgarian",
"Burmese",
+ "Cantonese (Hong Kong)",
"Catalan",
"Cebuano",
+ "Chinese",
+ "Chinese (China)",
+ "Chinese (Hong Kong)",
"Chinese (Simplified)",
+ "Chinese (Taiwan)",
"Chinese (Traditional)",
"Corsican",
"Croatian",
"Czech",
"Danish",
"Dutch",
+ "Dutch (auto-generated)",
"Esperanto",
"Estonian",
"Filipino",
"Finnish",
"French",
+ "French (auto-generated)",
"Galician",
"Georgian",
"German",
+ "German (auto-generated)",
"Greek",
"Gujarati",
"Haitian Creole",
@@ -43,14 +53,19 @@ CAPTION_LANGUAGES = {
"Icelandic",
"Igbo",
"Indonesian",
+ "Indonesian (auto-generated)",
+ "Interlingue",
"Irish",
"Italian",
+ "Italian (auto-generated)",
"Japanese",
+ "Japanese (auto-generated)",
"Javanese",
"Kannada",
"Kazakh",
"Khmer",
"Korean",
+ "Korean (auto-generated)",
"Kurdish",
"Kyrgyz",
"Lao",
@@ -73,9 +88,12 @@ CAPTION_LANGUAGES = {
"Persian",
"Polish",
"Portuguese",
+ "Portuguese (auto-generated)",
+ "Portuguese (Brazil)",
"Punjabi",
"Romanian",
"Russian",
+ "Russian (auto-generated)",
"Samoan",
"Scottish Gaelic",
"Serbian",
@@ -87,7 +105,10 @@ CAPTION_LANGUAGES = {
"Somali",
"Southern Sotho",
"Spanish",
+ "Spanish (auto-generated)",
"Spanish (Latin America)",
+ "Spanish (Mexico)",
+ "Spanish (Spain)",
"Sundanese",
"Swahili",
"Swedish",
@@ -96,10 +117,12 @@ CAPTION_LANGUAGES = {
"Telugu",
"Thai",
"Turkish",
+ "Turkish (auto-generated)",
"Ukrainian",
"Urdu",
"Uzbek",
"Vietnamese",
+ "Vietnamese (auto-generated)",
"Welsh",
"Western Frisian",
"Xhosa",
diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr
index cd0fd0d5..27a8e266 100644
--- a/src/invidious/views/embed.ecr
+++ b/src/invidious/views/embed.ecr
@@ -7,7 +7,7 @@
<meta name="thumbnail" content="<%= thumbnail %>">
<%= rendered "components/player_sources" %>
<link rel="stylesheet" href="/videojs/videojs-overlay/videojs-overlay.css?v=<%= ASSET_COMMIT %>">
- <script src="videojs/videojs-overlay/videojs-overlay.js?v=<%= ASSET_COMMIT %>"></script>
+ <script src="/videojs/videojs-overlay/videojs-overlay.js?v=<%= ASSET_COMMIT %>"></script>
<link rel="stylesheet" href="/css/default.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/embed.css?v=<%= ASSET_COMMIT %>">
<title><%= HTML.escape(video.title) %> - Invidious</title>