diff options
| -rw-r--r-- | assets/css/default.css | 2 | ||||
| -rw-r--r-- | locales/ar.json | 3 | ||||
| -rw-r--r-- | locales/cs.json | 3 | ||||
| -rw-r--r-- | locales/en-US.json | 3 | ||||
| -rw-r--r-- | locales/es.json | 4 | ||||
| -rw-r--r-- | locales/fr.json | 2 | ||||
| -rw-r--r-- | locales/hr.json | 3 | ||||
| -rw-r--r-- | locales/id.json | 7 | ||||
| -rw-r--r-- | locales/it.json | 3 | ||||
| -rw-r--r-- | locales/ko.json | 79 | ||||
| -rw-r--r-- | locales/sl.json | 3 | ||||
| -rw-r--r-- | locales/tr.json | 3 | ||||
| -rw-r--r-- | locales/uk.json | 3 | ||||
| -rw-r--r-- | locales/zh-CN.json | 3 | ||||
| -rw-r--r-- | locales/zh-TW.json | 3 | ||||
| -rw-r--r-- | src/invidious/comments.cr | 11 | ||||
| -rw-r--r-- | src/invidious/routes/embed.cr | 10 | ||||
| -rw-r--r-- | src/invidious/views/licenses.ecr | 18 | ||||
| -rw-r--r-- | src/invidious/views/template.ecr | 2 | ||||
| -rw-r--r-- | src/invidious/views/watch.ecr | 2 |
20 files changed, 128 insertions, 39 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index 9ffff960..ab2b79e6 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -213,7 +213,7 @@ img.thumbnail { } .searchbar input[type="search"]:focus { - margin: 0 0 0.5px 0; + margin: 0; border: 2px solid; border-color: rgba(0,0,0,0); border-bottom-color: #FED; diff --git a/locales/ar.json b/locales/ar.json index 38963281..fbe88b03 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -535,5 +535,6 @@ "generic_count_seconds_2": "{{count}} ثانية", "generic_count_seconds_3": "{{count}} ثانية", "generic_count_seconds_4": "{{count}} ثوانٍ", - "generic_count_seconds_5": "{{count}} ثانية" + "generic_count_seconds_5": "{{count}} ثانية", + "error_video_not_in_playlist": "الفيديو المطلوب غير موجود في قائمة التشغيل هذه. <a href=\"`x`\"> انقر هنا للحصول على الصفحة الرئيسية لقائمة التشغيل. </a>" } diff --git a/locales/cs.json b/locales/cs.json index 97f108d7..7538365a 100644 --- a/locales/cs.json +++ b/locales/cs.json @@ -487,5 +487,6 @@ "search_filters_sort_label": "Řadit dle", "search_filters_sort_option_relevance": "Relevantnost", "search_filters_apply_button": "Použít vybrané filtry", - "Popular enabled: ": "Populární povoleno: " + "Popular enabled: ": "Populární povoleno: ", + "error_video_not_in_playlist": "Požadované video v tomto playlistu neexistuje. <a href=\"`x`\">Klikněte sem pro navštívení domovské stránky playlistu.</a>" } diff --git a/locales/en-US.json b/locales/en-US.json index 9701a621..5554b928 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -471,5 +471,6 @@ "crash_page_switch_instance": "tried to <a href=\"`x`\">use another instance</a>", "crash_page_read_the_faq": "read the <a href=\"`x`\">Frequently Asked Questions (FAQ)</a>", "crash_page_search_issue": "searched for <a href=\"`x`\">existing issues on GitHub</a>", - "crash_page_report_issue": "If none of the above helped, please <a href=\"`x`\">open a new issue on GitHub</a> (preferably in English) and include the following text in your message (do NOT translate that text):" + "crash_page_report_issue": "If none of the above helped, please <a href=\"`x`\">open a new issue on GitHub</a> (preferably in English) and include the following text in your message (do NOT translate that text):", + "error_video_not_in_playlist": "The requested video doesn't exist in this playlist. <a href=\"`x`\">Click here for the playlist home page.</a>" } diff --git a/locales/es.json b/locales/es.json index 0958a736..c427e81a 100644 --- a/locales/es.json +++ b/locales/es.json @@ -470,5 +470,7 @@ "tokens_count": "{{count}} token", "tokens_count_plural": "{{count}} tokens", "search_message_use_another_instance": " También puede <a href=\"`x`\">buscar en otra instancia</a>.", - "search_filters_duration_option_medium": "Medio (4 - 20 minutes)" + "search_filters_duration_option_medium": "Medio (4 - 20 minutes)", + "Popular enabled: ": "¿Habilitar la sección popular? ", + "error_video_not_in_playlist": "El vídeo solicitado no existe en esta lista de reproducción. <a href=\"`x`\">Haga clic aquí para acceder a la página de inicio de la lista de reproducción.</a>" } diff --git a/locales/fr.json b/locales/fr.json index 928a4400..e526648f 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -116,7 +116,7 @@ "preferences_default_home_label": "Page d'accueil par défaut : ", "preferences_feed_menu_label": "Préferences des abonnements : ", "preferences_show_nick_label": "Afficher le nom d'utilisateur en haut à droite : ", - "Popular enabled: ": "Page \"populaire\" activée: ", + "Popular enabled: ": "Page \"populaire\" activée : ", "Top enabled: ": "Top activé : ", "CAPTCHA enabled: ": "CAPTCHA activé : ", "Login enabled: ": "Autoriser l'ouverture de sessions utilisateur : ", diff --git a/locales/hr.json b/locales/hr.json index 54eef7f9..e42cc4f5 100644 --- a/locales/hr.json +++ b/locales/hr.json @@ -487,5 +487,6 @@ "search_filters_duration_option_medium": "Srednje (4 – 20 minuta)", "search_filters_apply_button": "Primijeni odabrane filtre", "search_filters_type_option_all": "Bilo koja vrsta", - "Popular enabled: ": "Popularni aktivirani: " + "Popular enabled: ": "Popularni aktivirani: ", + "error_video_not_in_playlist": "Traženi video ne postoji u ovoj zbirci. <a href=\"`x`\">Pritisni ovdje za početnu stranicu zbirke.</a>" } diff --git a/locales/id.json b/locales/id.json index ad80efcf..a30f0ad4 100644 --- a/locales/id.json +++ b/locales/id.json @@ -448,5 +448,10 @@ "search_filters_date_option_none": "Tanggal berapa pun", "search_filters_duration_option_none": "Durasi berapa pun", "search_filters_duration_option_medium": "Sedang (4 - 20 menit)", - "Cantonese (Hong Kong)": "Bahasa Kanton (Hong Kong)" + "Cantonese (Hong Kong)": "Bahasa Kanton (Hong Kong)", + "crash_page_refresh": "mencoba untuk <a href=\"`x`\">memuat ulang halaman</a>", + "crash_page_switch_instance": "mencoba untuk <a href=\"`x`\">menggunakan peladen lainnya</a>", + "crash_page_read_the_faq": "baca <a href=\"`x`\">Soal Sering Ditanya (SSD/FAQ)</a>", + "crash_page_search_issue": "mencari <a href=\"`x`\">isu yang ada di GitHub</a>", + "crash_page_report_issue": "Jika yang di atas tidak membantu, <a href=\"`x`\">buka isu baru di GitHub</a> (sebaiknya dalam bahasa Inggris) dan sertakan teks berikut dalam pesan Anda (JANGAN terjemahkan teks tersebut):" } diff --git a/locales/it.json b/locales/it.json index facf2594..63a8e8d4 100644 --- a/locales/it.json +++ b/locales/it.json @@ -471,5 +471,6 @@ "search_filters_duration_option_medium": "Media (4 - 20 minuti)", "search_filters_features_option_vr180": "VR180", "search_filters_apply_button": "Applica filtri selezionati", - "crash_page_refresh": "provato a <a href=\"`x`\">ricaricare la pagina</a>" + "crash_page_refresh": "provato a <a href=\"`x`\">ricaricare la pagina</a>", + "error_video_not_in_playlist": "Il video richiesto non esiste in questa playlist. <a href=\"`x`\">Fai clic qui per la pagina iniziale della playlist.</a>" } diff --git a/locales/ko.json b/locales/ko.json index 12c2b31f..0964a563 100644 --- a/locales/ko.json +++ b/locales/ko.json @@ -12,8 +12,8 @@ "Dark mode: ": "다크 모드: ", "preferences_player_style_label": "플레이어 스타일: ", "preferences_category_visual": "시각 설정", - "preferences_vr_mode_label": "인터랙티브 360도 비디오: ", - "preferences_extend_desc_label": "자동으로 비디오 설명 확장: ", + "preferences_vr_mode_label": "360도 비디오와 상호작용하기(WebGL를 요구함): ", + "preferences_extend_desc_label": "자동으로 비디오 설명을 확장: ", "preferences_annotations_label": "기본적으로 주석 표시: ", "preferences_related_videos_label": "관련 동영상 보기: ", "Fallback captions: ": "대체 자막: ", @@ -58,7 +58,7 @@ "Import NewPipe subscriptions (.json)": "NewPipe 구독을 가져오기 (.json)", "Import FreeTube subscriptions (.db)": "FreeTube 구독 가져오기 (.db)", "Import YouTube subscriptions": "YouTube 구독 가져오기", - "Import Invidious data": "Invidious 데이터 가져오기", + "Import Invidious data": "Invidious JSON 데이터 가져오기", "Import": "가져오기", "Import and Export Data": "데이터 가져오기 및 내보내기", "No": "아니요", @@ -91,7 +91,7 @@ "Japanese": "일본어", "Greek": "그리스어", "German": "독일어", - "Chinese (Traditional)": "중국어 (정자)", + "Chinese (Traditional)": "중국어 (정체자)", "Chinese (Simplified)": "중국어 (간체자)", "French": "프랑스어", "Finnish": "핀란드어", @@ -183,9 +183,9 @@ "Russian": "러시아어", "Romanian": "루마니아어", "Punjabi": "펀자브어", - "Portuguese": "포르투갈어(포어)", + "Portuguese": "포르투갈어", "Polish": "폴란드어", - "Persian": "페르시아어(파사어)", + "Persian": "페르시아어", "Pashto": "파슈토어", "Nyanja": "체와어", "Norwegian Bokmål": "보크몰", @@ -225,7 +225,7 @@ "Kazakh": "카자흐어", "Kannada": "칸나다어", "Javanese": "자바어", - "Italian": "이탈리아어(이태리어)", + "Italian": "이탈리아어", "Irish": "아일랜드어", "Indonesian": "인도네시아어", "Igbo": "이보어", @@ -256,7 +256,7 @@ }, "Haitian Creole": "아이티 크레올어", "Gujarati": "구자라트어", - "Esperanto": "에스페란토(에스페란토어)", + "Esperanto": "에스페란토", "Georgian": "조지아어", "Galician": "갈리시아어", "Filipino": "타갈로그어(필리핀어)", @@ -374,12 +374,69 @@ "search_filters_date_option_hour": "지난 1시간", "search_filters_sort_label": "정렬기준", "search_filters_features_label": "기능별", - "search_filters_duration_option_short": "4분 미만", - "search_filters_duration_option_long": "20분 초과", + "search_filters_duration_option_short": "짧음 (4분 미만)", + "search_filters_duration_option_long": "김 (20분 초과)", "footer_documentation": "문서", "footer_source_code": "소스 코드", "footer_original_source_code": "원본 소스 코드", "footer_modfied_source_code": "수정된 소스 코드", "adminprefs_modified_source_code_url_label": "수정된 소스 코드 저장소의 URL", - "search_filters_title": "필터" + "search_filters_title": "필터", + "preferences_quality_dash_option_4320p": "4320p", + "Popular enabled: ": "인기 급상승 활성화: ", + "Dutch (auto-generated)": "네덜란드어 (자동 생성됨)", + "Chinese (Hong Kong)": "중국어 (홍콩)", + "Chinese (Taiwan)": "중국어 (대만)", + "German (auto-generated)": "독일어 (자동 생성됨)", + "Interlingue": "Interlingue", + "search_filters_date_label": "업로드 날짜", + "search_filters_date_option_none": "모든 날짜", + "search_filters_duration_option_none": "모든 기간", + "search_filters_features_option_three_sixty": "360°", + "search_filters_features_option_purchased": "구입한 항목", + "search_filters_apply_button": "선택한 필터 적용하기", + "preferences_quality_dash_option_240p": "240p", + "preferences_region_label": "콘텐트 국가: ", + "preferences_quality_dash_option_1440p": "1440p", + "French (auto-generated)": "프랑스어 (자동 생성됨)", + "Indonesian (auto-generated)": "인도네시아어 (자동 생성됨)", + "Turkish (auto-generated)": "터키어 (자동 생성됨)", + "Vietnamese (auto-generated)": "베트남어 (자동 생성됨)", + "preferences_quality_dash_option_2160p": "2160p", + "Italian (auto-generated)": "이탈리아어 (자동 생성됨)", + "preferences_quality_option_medium": "중간", + "preferences_quality_dash_option_720p": "720p", + "search_filters_duration_option_medium": "중간 (4 - 20분)", + "preferences_quality_dash_option_best": "최고", + "Portuguese (auto-generated)": "포르투갈어 (자동 생성됨)", + "Spanish (Spain)": "스페인어 (스페인)", + "preferences_quality_dash_label": "선호하시는 DASH 비디오 품질: ", + "preferences_quality_option_hd720": "HD720", + "Spanish (auto-generated)": "스페인어 (자동 생성됨)", + "preferences_quality_dash_option_1080p": "1080p", + "preferences_quality_dash_option_worst": "최저", + "preferences_watch_history_label": "시청 기록 활성화: ", + "invidious": "Invidious", + "preferences_quality_option_small": "낮음", + "preferences_quality_dash_option_auto": "자동", + "preferences_quality_dash_option_480p": "480p", + "preferences_quality_dash_option_144p": "144p", + "English (United Kingdom)": "영어 (영국)", + "search_filters_features_option_vr180": "VR180", + "Cantonese (Hong Kong)": "광동어 (홍콩)", + "Portuguese (Brazil)": "포르투갈어 (브라질)", + "search_message_no_results": "결과가 없습니다.", + "search_message_change_filters_or_query": "필터를 변경하시거나 검색어를 넓게 시도해보세요.", + "search_message_use_another_instance": " 당신은 <a href=\"`x`\">다른 인스턴스에서 검색</a>할 수도 있습니다.", + "English (United States)": "영어 (미국)", + "Chinese": "중국어", + "Chinese (China)": "중국어 (중국)", + "Japanese (auto-generated)": "일본어 (자동 생성됨)", + "Korean (auto-generated)": "한국어 (자동 생성됨)", + "Russian (auto-generated)": "러시아어 (자동 생성됨)", + "Spanish (Mexico)": "스페인어 (멕시코)", + "search_filters_type_option_all": "모든 유형", + "footer_donate_page": "기부하기", + "preferences_quality_option_dash": "DASH (적절한 화질)", + "preferences_quality_dash_option_360p": "360p" } diff --git a/locales/sl.json b/locales/sl.json index 288f8da5..5994ca1a 100644 --- a/locales/sl.json +++ b/locales/sl.json @@ -503,5 +503,6 @@ "crash_page_before_reporting": "Preden prijaviš napako, se prepričaj, da si:", "crash_page_search_issue": "preiskal/a <a href=\"`x`\">obstoječe težave na GitHubu</a>", "crash_page_report_issue": "Če nič od navedenega ni pomagalo, prosim <a href=\"`x`\">odpri novo težavo v GitHubu</a> (po možnosti v angleščini) in v svoje sporočilo vključi naslednje besedilo (tega besedila NE prevajaj):", - "Popular enabled: ": "Priljubljeni omogočeni: " + "Popular enabled: ": "Priljubljeni omogočeni: ", + "error_video_not_in_playlist": "Zahtevani videoposnetek ne obstaja na tem seznamu predvajanja. <a href=\"`x`\">Klikni tukaj za domačo stran seznama predvajanja.</a>" } diff --git a/locales/tr.json b/locales/tr.json index bd499746..77aacb40 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -471,5 +471,6 @@ "search_filters_features_option_vr180": "VR180", "search_filters_title": "Filtreler", "search_message_change_filters_or_query": "Arama sorgunuzu genişletmeyi ve/veya filtreleri değiştirmeyi deneyin.", - "Popular enabled: ": "Popüler etkin: " + "Popular enabled: ": "Popüler etkin: ", + "error_video_not_in_playlist": "İstenen video bu oynatma listesinde yok. <a href=\"`x`\">Oynatma listesi ana sayfası için buraya tıklayın.</a>" } diff --git a/locales/uk.json b/locales/uk.json index 0cc14579..b6994c56 100644 --- a/locales/uk.json +++ b/locales/uk.json @@ -487,5 +487,6 @@ "search_filters_sort_option_relevance": "Відповідні", "search_filters_sort_option_rating": "Рейтингові", "search_filters_sort_option_views": "Популярні", - "Popular enabled: ": "Популярне ввімкнено: " + "Popular enabled: ": "Популярне ввімкнено: ", + "error_video_not_in_playlist": "Запитуваного відео в цьому списку відтворення не існує. <a href=\"`x`\">Клацніть тут, щоб переглянути домашню сторінку списку відтворення.</a>" } diff --git a/locales/zh-CN.json b/locales/zh-CN.json index ff48e101..7e749dc9 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -455,5 +455,6 @@ "search_filters_duration_option_none": "任意时长", "search_filters_type_option_all": "任意类型", "search_filters_features_option_vr180": "VR180", - "Popular enabled: ": "已启用流行度: " + "Popular enabled: ": "已启用流行度: ", + "error_video_not_in_playlist": "此播放列表中不存在请求的视频。 <a href=\"`x`\">单击析出查看播放列表主页。</a>" } diff --git a/locales/zh-TW.json b/locales/zh-TW.json index 90614e48..54933701 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -455,5 +455,6 @@ "search_filters_date_label": "上傳日期", "search_filters_type_option_all": "任何類型", "search_filters_date_option_none": "任何日期", - "Popular enabled: ": "已啟用人氣: " + "Popular enabled: ": "已啟用人氣: ", + "error_video_not_in_playlist": "此播放清單不存在請求的影片。<a href=\"`x`\">點擊此處檢視播放清單首頁。</a>" } diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 5112ad3d..d691ca36 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -201,15 +201,6 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b end if node_replies && !response["commentRepliesContinuation"]? - if node_replies["moreText"]? - reply_count = (node_replies["moreText"]["simpleText"]? || node_replies["moreText"]["runs"]?.try &.[0]?.try &.["text"]?) - .try &.as_s.gsub(/\D/, "").to_i? || 1 - elsif node_replies["viewReplies"]? - reply_count = node_replies["viewReplies"]["buttonRenderer"]["text"]?.try &.["runs"][1]?.try &.["text"]?.try &.as_s.to_i? || 1 - else - reply_count = 1 - end - if node_replies["continuations"]? continuation = node_replies["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_s elsif node_replies["contents"]? @@ -219,7 +210,7 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b json.field "replies" do json.object do - json.field "replyCount", reply_count + json.field "replyCount", node_comment["replyCount"]? || 1 json.field "continuation", continuation end end diff --git a/src/invidious/routes/embed.cr b/src/invidious/routes/embed.cr index 84da9993..e6486587 100644 --- a/src/invidious/routes/embed.cr +++ b/src/invidious/routes/embed.cr @@ -2,11 +2,16 @@ module Invidious::Routes::Embed def self.redirect(env) + locale = env.get("preferences").as(Preferences).locale if plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") begin playlist = get_playlist(plid) offset = env.params.query["index"]?.try &.to_i? || 0 videos = get_playlist_videos(playlist, offset: offset) + if videos.empty? + url = "/playlist?list=#{plid}" + raise NotFoundException.new(translate(locale, "error_video_not_in_playlist", url)) + end rescue ex : NotFoundException return error_template(404, ex) rescue ex @@ -26,6 +31,7 @@ module Invidious::Routes::Embed end def self.show(env) + locale = env.get("preferences").as(Preferences).locale id = env.params.url["id"] plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") @@ -62,6 +68,10 @@ module Invidious::Routes::Embed playlist = get_playlist(plid) offset = env.params.query["index"]?.try &.to_i? || 0 videos = get_playlist_videos(playlist, offset: offset) + if videos.empty? + url = "/playlist?list=#{plid}" + raise NotFoundException.new(translate(locale, "error_video_not_in_playlist", url)) + end rescue ex : NotFoundException return error_template(404, ex) rescue ex diff --git a/src/invidious/views/licenses.ecr b/src/invidious/views/licenses.ecr index 25b24ed4..667cfa37 100644 --- a/src/invidious/views/licenses.ecr +++ b/src/invidious/views/licenses.ecr @@ -25,6 +25,20 @@ <tr> <td> + <a href="/js/handlers.js?v=<%= ASSET_COMMIT %>">handlers.js</a> + </td> + + <td> + <a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a> + </td> + + <td> + <a href="/js/handlers.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a> + </td> + </tr> + + <tr> + <td> <a href="/js/community.js?v=<%= ASSET_COMMIT %>">community.js</a> </td> @@ -169,7 +183,7 @@ </td> <td> - <a href="https://choosealicense.com/licenses/mit/">MIT</a> + <a href="https://choosealicense.com/licenses/mit/">Expat</a> </td> <td> @@ -253,7 +267,7 @@ </td> <td> - <a href="https://choosealicense.com/licenses/mit">MIT</a> + <a href="https://choosealicense.com/licenses/mit">Expat</a> </td> <td> diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index caf5299f..98f72eba 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -67,7 +67,7 @@ </a> </div> <% if env.get("preferences").as(Preferences).show_nick %> - <div class="pure-u-1-4"> + <div class="pure-u-1-4" style="overflow: hidden; white-space: nowrap;"> <span id="user_name"><%= HTML.escape(env.get("user").as(Invidious::User).email) %></span> </div> <% end %> diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 50c63d21..243ea3a4 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -270,7 +270,7 @@ we're going to need to do it here in order to allow for translations. <% video.related_videos.each do |rv| %> <% if rv["id"]? %> - <a href="/watch?v=<%= rv["id"] %>"> + <a href="/watch?v=<%= rv["id"] %>&listen=<%= params.listen %>"> <% if !env.get("preferences").as(Preferences).thin_mode %> <div class="thumbnail"> <img loading="lazy" class="thumbnail" src="/vi/<%= rv["id"] %>/mqdefault.jpg"> |
