Commit Graph

54 Commits

Author SHA1 Message Date
Fijxu
09d342b84d Update src/invidious/yt_backend/youtube_api.cr
Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2025-05-22 17:55:46 -04:00
Fijxu
3a8d4f333f update IOS_APP_VERSION 2025-05-22 17:17:01 -04:00
Fijxu
97354adf0f Update src/invidious/yt_backend/youtube_api.cr
Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2025-05-22 17:15:45 -04:00
Fijxu
6497e1c418 YtAPI: Bump client versions 2025-05-22 16:06:13 -04:00
Émilien (perso)
70ff463cc6 Add invidious companion support (#4985)
* add support for invidious companion

* redirect latest_version and dash manifest to invidious companion

* fix Shadowing outer local variable `response`

* fixing condition for Content-Security-Policy

* throw error if inv_sig_helper and invidious_companion used same time

* Use sample instead of Random.rand

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>

* Remove debug puts functions

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>

* modify the description for config.example.yaml about invidious companion

* move config checks for invidious companion

* separate invidious_companion logic + better config.yaml config

* fixing "end" misplacement

* fix linting + use .empty?

* crystal handle decompression already by itself

* fix download function when invidious companion used

* fix linting

* invidious companion always used so always add CSP and redirect latest_version

* apply all the suggestions + rework invidious_companion parameter

* format watch.cr

* fix ameba Redundant use of `Object#to_s` in interpolation

* add ability for invidious companion to check request from invidious

* Better document private_url and public_url

* Better doc for invidious_companion_key

* !empty? to present?

* skip proxy for invidious companion

* fixing format

* missing ,

* add companion pooling http

* fix: don't use http proxy when sending requests to companion

* fix: logic where we want to have the invidious logic if companion is not used

* chore: remove baseurl usage from invidious companion

* chore: change from inv-sig-helper to companion for required playback

* fix: use puts + add warning for inv-sig-helper deprecated

---------

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2025-03-13 16:44:00 +01:00
syeopite
e1378702af Apply upcoming formatting rules from Crystal 1.15 2025-01-20 16:15:13 -08:00
Emilien
f3e93ca83d revert back to www.youtube.com when client_config.screen embed 2024-11-09 22:21:09 +01:00
Émilien (perso)
ac6e796c73 checking the status code returned by youtube (#5052)
* checking the status code returned by youtube

* add documentation link

* Update src/invidious/yt_backend/youtube_api.cr

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>

---------

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2024-11-07 14:04:43 +01:00
Émilien (perso)
a021b93063 Update latest version WEB_CREATOR + fix comment web embed (#4930)
* Update to latest version WEB_CREATOR

* fix comment about using web embed as a fallback
2024-09-20 00:05:41 +00:00
Émilien (perso)
d9df90b5e3 use WEB_CREATOR when po_token with WEB_EMBED as a fallback (#4928)
* use WEB_CREATOR when po_token with WEB_EMBEDDED_PLAYER as a fallback

* remove unrelated comment

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>

---------

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
2024-09-20 00:19:13 +02:00
Emilien Devos
cec3cfba77 Revert "use web screen embed for fixing potoken functionality (#4923)"
This reverts commit de918b9234.
The code doesn't work as expected. Reverting
2024-09-17 00:22:06 +02:00
Émilien (perso)
de918b9234 use web screen embed for fixing potoken functionality (#4923)
* use web screen embed for fixing potoken functionality

* use web screen embed only for getting streamingData + disable tv screen on po_token
2024-09-16 23:42:43 +02:00
Samantaz Fox
acbb625866 YtAPI: Update clients to latest version 2024-08-15 12:57:36 +02:00
Samantaz Fox
2d18ff1f80 Add ability to set po_token and visitordata ID (#4789)
This PR adds two new config option, to pass a PO token (config 'po_token') and
a visitor ID (config 'visitor_data') to Youtube. These two strings are required
to play videos using the WEB client.

Warning: These strings gives much more identifiable information to Google!

If the po_token setting is filled in, then the WEB client is used. If not, the
Android client is used. TvHtml5ScreenEmbed will still be used as a fallback.

Script for generating po_token and visitor_data:
https://github.com/iv-org/youtube-trusted-session-generator

Helps with issue 4734
2024-08-13 20:35:43 +02:00
Samantaz Fox
7798faf234 SigHelper: Make signature server optional and configurable 2024-08-07 23:25:35 +02:00
Samantaz Fox
10e5788c21 Videos: Send player sts when required 2024-07-25 22:13:08 +02:00
Emilien Devos
53223f99b0 Add ability to set po_token and visitordata ID 2024-07-24 19:28:47 +02:00
Samantaz Fox
470245de54 YtAPI: Remove API keys like official clients 2024-04-27 20:48:42 +02:00
Samantaz Fox
0ab6d9e748 Videos: Use android test suite client (#4650)
"Temporary" fix, until a better and more permanent solution is found.

Closes issue 4584
2024-04-26 23:54:24 +02:00
Samantaz Fox
d49c762609 YtAPI: Add more client infos for Android test suite 2024-04-26 22:26:45 +02:00
Samantaz Fox
7f3ddad12e Videos: Use android test suite client 2024-04-26 22:03:59 +02:00
syeopite
990931ff67 Remove legacy proxy code 2024-04-07 11:08:12 -07:00
Samantaz Fox
619aa3ff05 YoutubeAPI: bump client versions 2024-03-06 21:36:15 +01:00
Samantaz Fox
842e9fade5 Captions: Add ability to use Innertube's transcripts API (#4001) 2023-09-18 23:31:56 +02:00
syeopite
c5fe96e936 Remove lsquic from codebase 2023-07-26 07:19:12 -07:00
syeopite
3509752b79 Rename transcript() to get_transcript() in YT API 2023-07-23 16:52:47 -07:00
syeopite
2e67b90540 Add method to query /youtubei/v1/get_transcript 2023-07-23 14:40:02 -07:00
Samantaz Fox
7556cb69f2 YT API: Bump WEB/MWEB client versions 2023-06-09 21:05:48 +02:00
Samantaz Fox
b5e30d66d4 YT API: Bump Android app version 2023-06-09 21:05:48 +02:00
Samantaz Fox
d9521c82cf YT API: Bump iOS app version 2023-06-09 21:05:48 +02:00
Samantaz Fox
f44506b7e0 yt api: bump web client version 2022-11-20 23:48:59 +01:00
Emilien Devos
c658fd27cc better spoof requests 2022-09-02 21:18:56 +02:00
Émilien Devos
31244cbcc8 replicate headers and params made by yt apps 2022-08-30 14:20:08 +00:00
Emilien Devos
218f7be1a7 For android client send sdk version to youtube 2022-08-07 21:37:11 +02:00
Samantaz Fox
23855c09dc Remove 'screen' where not required 2022-08-07 00:37:09 +02:00
Samantaz Fox
618ab01cd7 Add TVHtml5 client 2022-08-07 00:36:22 +02:00
Samantaz Fox
349d90b60e Add IOS clients 2022-08-07 00:32:26 +02:00
Samantaz Fox
9e7c2dcdbb Move the default API key to a constant for clarity 2022-08-06 23:49:36 +02:00
Samantaz Fox
f353589a53 Bump web clients versions 2022-08-06 23:47:16 +02:00
Samantaz Fox
fc97929dee Bump android app version 2022-08-06 23:28:19 +02:00
Émilien Devos
c152243b4d new method for bypassing age restriction (#2996) 2022-03-30 19:52:39 +02:00
Samantaz Fox
ed265cfdcd Request minified JSON from innertube (#2974) 2022-03-16 09:07:30 +01:00
Dimitris Apostolou
7e4690e43c Fix typos 2022-02-07 14:57:14 +02:00
Samantaz Fox
46f7ca9ffa Remove useless intermediary variable in youtube_api.cr
This fixes an ameba warning
2022-01-28 02:19:53 +01:00
Samantaz Fox
de00e86cd5 Decompress the response body ourselves
Temp fix for #2612
2021-11-28 18:04:12 +01:00
Émilien Devos
c6e086c6ff Revert "Temporarily fix for #2612" (#2673) 2021-11-28 09:41:16 +01:00
Samantaz Fox
ba48f68fc3 allow multiple, successive content-encodings 2021-11-21 18:16:05 +01:00
Samantaz Fox
2c447a42f2 Make sure to only apply fix if QUIC is disabled 2021-11-16 21:40:35 +01:00
Samantaz Fox
dad8f9a0ce Fix typo
Should be checking the returned headers, not the sent ones.
2021-11-16 20:39:26 +01:00
Samantaz Fox
2eac23a0b3 Temporary fix for #2612
Don't rely on the auto compression/decompression provided by the crystal stdlib.
2021-11-16 13:46:28 +01:00