diff options
| -rw-r--r-- | docker/Dockerfile.arm64 | 6 | ||||
| -rw-r--r-- | locales/ar.json | 4 | ||||
| -rw-r--r-- | locales/eo.json | 2 | ||||
| -rw-r--r-- | locales/es.json | 2 | ||||
| -rw-r--r-- | locales/ja.json | 4 | ||||
| -rw-r--r-- | locales/lt.json | 2 | ||||
| -rw-r--r-- | locales/pt-BR.json | 2 | ||||
| -rw-r--r-- | locales/tr.json | 2 | ||||
| -rw-r--r-- | locales/zh-CN.json | 2 | ||||
| -rw-r--r-- | locales/zh-TW.json | 2 | ||||
| -rw-r--r-- | src/invidious/comments.cr | 57 |
11 files changed, 50 insertions, 35 deletions
diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 index 4d212d8b..063ba6d2 100644 --- a/docker/Dockerfile.arm64 +++ b/docker/Dockerfile.arm64 @@ -1,5 +1,5 @@ -FROM alpine:3.14 AS builder -RUN apk add --no-cache 'crystal<2' shards sqlite-static yaml-static yaml-dev libxml2-dev zlib-static openssl-libs-static openssl-dev musl-dev +FROM alpine:edge AS builder +RUN apk add --no-cache 'crystal=1.1.1-r0' shards sqlite-static yaml-static yaml-dev libxml2-dev zlib-static openssl-libs-static openssl-dev musl-dev ARG release @@ -29,7 +29,7 @@ RUN if [ ${release} == 1 ] ; then \ --link-flags "-lxml2 -llzma"; \ fi -FROM alpine:latest +FROM alpine:edge RUN apk add --no-cache librsvg ttf-opensans WORKDIR /invidious RUN addgroup -g 1000 -S invidious && \ diff --git a/locales/ar.json b/locales/ar.json index 4393fb7c..9488e309 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -145,7 +145,7 @@ }, "search": "بحث", "Log out": "تسجيل الخروج", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "تم إصداره بموجب AGPLv3 على Github.", "Source available here.": "الأكواد متوفرة هنا.", "View JavaScript license information.": "مشاهدة معلومات حول تراخيص الجافاسكريبت.", "View privacy policy.": "عرض سياسة الخصوصية.", @@ -382,7 +382,7 @@ "News": "الأخبار", "Movies": "الأفلام", "Download": "نزّل", - "Download as: ": "نزله كـ: ", + "Download as: ": "نزله كـ:. ", "%A %B %-d, %Y": "%A %-d %B %Y", "(edited)": "(تم تعديلة)", "YouTube comment permalink": "رابط التعليق على اليوتيوب", diff --git a/locales/eo.json b/locales/eo.json index 56a2681c..7c2c7482 100644 --- a/locales/eo.json +++ b/locales/eo.json @@ -145,7 +145,7 @@ }, "search": "serĉi", "Log out": "Elsaluti", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "Eldonita sub la AGPLv3 en Github.", "Source available here.": "Fonto havebla ĉi tie.", "View JavaScript license information.": "Vidi Ĝavoskriptan licencan informon.", "View privacy policy.": "Vidi regularon pri privateco.", diff --git a/locales/es.json b/locales/es.json index 9d455413..1f3f1c9e 100644 --- a/locales/es.json +++ b/locales/es.json @@ -145,7 +145,7 @@ }, "search": "buscar", "Log out": "Cerrar la sesión", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "Publicado bajo la AGPLv3 en Github.", "Source available here.": "Código fuente disponible aquí.", "View JavaScript license information.": "Ver información de licencia de JavaScript.", "View privacy policy.": "Ver la política de privacidad.", diff --git a/locales/ja.json b/locales/ja.json index 1e418094..c4f78f96 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -145,7 +145,7 @@ }, "search": "検索", "Log out": "ログアウト", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "Github 上で AGPLv3 の下で公開されています", "Source available here.": "ソースはここで閲覧可能です。", "View JavaScript license information.": "JavaScript ライセンス情報", "View privacy policy.": "プライバシーポリシー", @@ -402,7 +402,7 @@ "features": "機能", "sort": "順番", "hour": "1時間前", - "today": "本日", + "today": "今日", "week": "今週", "month": "今月", "year": "今年", diff --git a/locales/lt.json b/locales/lt.json index ae0ee0a3..e8e84dcf 100644 --- a/locales/lt.json +++ b/locales/lt.json @@ -145,7 +145,7 @@ }, "search": "ieškoti", "Log out": "Atsijungti", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "Išleista pagal AGPLv3 licenciją Github.", "Source available here.": "Kodas prieinamas čia.", "View JavaScript license information.": "Žiūrėti JavaScript licencijos informaciją.", "View privacy policy.": "Žiūrėti privatumo politiką.", diff --git a/locales/pt-BR.json b/locales/pt-BR.json index 16725774..f1ffb7a8 100644 --- a/locales/pt-BR.json +++ b/locales/pt-BR.json @@ -145,7 +145,7 @@ }, "search": "Pesquisar", "Log out": "Sair", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "Lançado sob a AGPLv3 no Github.", "Source available here.": "Código-fonte disponível aqui.", "View JavaScript license information.": "Ver informações da licença do JavaScript.", "View privacy policy.": "Ver a política de privacidade.", diff --git a/locales/tr.json b/locales/tr.json index 4d165909..493f1295 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -145,7 +145,7 @@ }, "search": "ara", "Log out": "Çıkış yap", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "Github'da AGPLv3 altında yayınlandı.", "Source available here.": "Kaynak kodları burada bulunabilir.", "View JavaScript license information.": "JavaScript lisans bilgilerini görüntüle.", "View privacy policy.": "Gizlilik politikasını görüntüle.", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index 77101362..5f89f964 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -145,7 +145,7 @@ }, "search": "搜索", "Log out": "登出", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "依据 AGPLv3 许可证发布于 Github。", "Source available here.": "源码可在此查看。", "View JavaScript license information.": "查看 JavaScript 协议信息。", "View privacy policy.": "查看隐私政策。", diff --git a/locales/zh-TW.json b/locales/zh-TW.json index e39e9470..96e04594 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -145,7 +145,7 @@ }, "search": "搜尋", "Log out": "登出", - "Released under the AGPLv3 on Github.": "", + "Released under the AGPLv3 on Github.": "在 GitHub 上以 AGPLv3 釋出。", "Source available here.": "原始碼在此提供。", "View JavaScript license information.": "檢視 JavaScript 授權條款資訊。", "View privacy policy.": "檢視隱私權政策。", diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 57fba565..a5506b03 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -70,8 +70,24 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b client_config = YoutubeAPI::ClientConfig.new(region: region) response = YoutubeAPI.next(continuation: ctoken, client_config: client_config) + contents = nil - if response["continuationContents"]? + if response["onResponseReceivedEndpoints"]? + onResponseReceivedEndpoints = response["onResponseReceivedEndpoints"] + header = nil + onResponseReceivedEndpoints.as_a.each do |item| + if item["reloadContinuationItemsCommand"]? + case item["reloadContinuationItemsCommand"]["slot"] + when "RELOAD_CONTINUATION_SLOT_HEADER" + header = item["reloadContinuationItemsCommand"]["continuationItems"][0] + when "RELOAD_CONTINUATION_SLOT_BODY" + contents = item["reloadContinuationItemsCommand"]["continuationItems"] + end + elsif item["appendContinuationItemsAction"]? + contents = item["appendContinuationItemsAction"]["continuationItems"] + end + end + elsif response["continuationContents"]? response = response["continuationContents"] if response["commentRepliesContinuation"]? body = response["commentRepliesContinuation"] @@ -83,22 +99,6 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b if body["continuations"]? moreRepliesContinuation = body["continuations"][0]["nextContinuationData"]["continuation"].as_s end - elsif response["onResponseReceivedEndpoints"]? - onResponseReceivedEndpoints = response["onResponseReceivedEndpoints"] - onResponseReceivedEndpoints.as_a.each do |item| - case item["reloadContinuationItemsCommand"]["slot"] - when "RELOAD_CONTINUATION_SLOT_HEADER" - header = item["reloadContinuationItemsCommand"]["continuationItems"][0] - when "RELOAD_CONTINUATION_SLOT_BODY" - contents = item["reloadContinuationItemsCommand"]["continuationItems"] - contents.as_a.reject! do |item| - if item["continuationItemRenderer"]? - moreRepliesContinuation = item["continuationItemRenderer"]["continuationEndpoint"]["continuationCommand"]["token"].as_s - true - end - end - end - end else raise InfoException.new("Could not fetch comments") end @@ -111,6 +111,14 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b end end + continuationItemRenderer = nil + contents.as_a.reject! do |item| + if item["continuationItemRenderer"]? + continuationItemRenderer = item["continuationItemRenderer"] + true + end + end + response = JSON.build do |json| json.object do if header @@ -126,7 +134,7 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b json.array do contents.as_a.each do |node| json.object do - if !response["commentRepliesContinuation"]? + if node["commentThreadRenderer"]? node = node["commentThreadRenderer"] end @@ -134,7 +142,7 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b node_replies = node["replies"]["commentRepliesRenderer"] end - if !response["commentRepliesContinuation"]? + if node["comment"]? node_comment = node["comment"]["commentRenderer"] else node_comment = node["commentRenderer"] @@ -224,8 +232,15 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b end end - if moreRepliesContinuation - json.field "continuation", moreRepliesContinuation + if continuationItemRenderer + if continuationItemRenderer["continuationEndpoint"]? + continuationEndpoint = continuationItemRenderer["continuationEndpoint"] + elsif continuationItemRenderer["button"]? + continuationEndpoint = continuationItemRenderer["button"]["buttonRenderer"]["command"] + end + if continuationEndpoint + json.field "continuation", continuationEndpoint["continuationCommand"]["token"].as_s + end end end end |
