summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos/transcript.cr34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/invidious/videos/transcript.cr b/src/invidious/videos/transcript.cr
new file mode 100644
index 00000000..c50f7569
--- /dev/null
+++ b/src/invidious/videos/transcript.cr
@@ -0,0 +1,34 @@
+module Invidious::Videos
+ # Namespace for methods primarily relating to Transcripts
+ module Transcript
+ def self.generate_param(video_id : String, language_code : String, auto_generated : Bool) : String
+ if !auto_generated
+ is_auto_generated = ""
+ elsif is_auto_generated = "asr"
+ end
+
+ object = {
+ "1:0:string" => video_id,
+
+ "2:base64" => {
+ "1:string" => is_auto_generated,
+ "2:string" => language_code,
+ "3:string" => "",
+ },
+
+ "3:varint" => 1_i64,
+ "5:string" => "engagement-panel-searchable-transcript-search-panel",
+ "6:varint" => 1_i64,
+ "7:varint" => 1_i64,
+ "8:varint" => 1_i64,
+ }
+
+ params = object.try { |i| Protodec::Any.cast_json(i) }
+ .try { |i| Protodec::Any.from_json(i) }
+ .try { |i| Base64.urlsafe_encode(i) }
+ .try { |i| URI.encode_www_form(i) }
+
+ return params
+ end
+ end
+end
ect'>Add new icon button for instance redirectssyeopite 2021-06-19Add 'Switch Invidious Instance' to en localesyeopite 2021-06-19Change wording of redirect hyperlinksyeopite 2021-06-19Expose instance redirect to frontendsyeopite 2021-06-19Add route to redirect to another instancesyeopite 2021-06-19Add helper function to fetch random instancesyeopite 2021-06-19Update Dutch translationGert-dev 2021-06-19Update Arabic translationRex_sa 2021-06-19TypoTheFrenchGhosty 2021-06-18Prevent CI run when src or wrkflows aren't chngdsyeopite 2021-06-18Reduce PR stale lengthsyeopite PRs should be active. Anything that hasn't had activity in more than 45 days should be considered abandoned. 2021-06-18Delete For-Matrix-org-Support.mdTheFrenchGhosty 2021-06-17Rewrite response headersSamantaz Fox Fixes #2018 and #2153 2021-06-14Add 10px margin to top and bottom of hr elementGraham 2021-06-14Use if/else instead of return in search routeSamantaz Fox 2021-06-14Disallow /watch path for bots againPaul Braeuning 2021-06-13Multiple search fixesSamantaz Fox * Remove percent-encoding of the search query when calling youtube API, as it breaks UTF-8 * Empty search redirects to /search, not / * Show the fullscreen search "home page" (from #1977) at /search * Allow 'region=' parameter to be passed to /search * Other minor fixes 2021-06-13Add ability to propagate locale removalssyeopite 2021-06-13Fix typossyeopite 2021-06-13Add locale-key-propagater and auto linter hookssyeopite 2021-06-13Add new line at end of locale filessyeopite 2021-06-13Change internal i18n key of sv-SE from sv to sv-SEsyeopite 2021-06-11Update Indonesian translationReza Almanda 2021-06-11Update Hungarian translationBenedek Nagy 2021-06-11Temporarily remove thread locker commentssyeopite 2021-06-10Fix typo in hu-HU translationSamantaz Fox Change requested by the original translator, see https://github.com/iv-org/invidious/pull/2141#pullrequestreview-679868487 2021-06-10Bump lsquic.cr shard version to v2.18.1-2syeopite 2021-06-09Update CI's crystal versionsyeopite 2021-06-09Update hu-HU.jsonwatchingdogs finished the translation