Skip to content

Conversation

@syeopite
Copy link
Member

@syeopite syeopite commented May 18, 2025

Closes #5307

Try next fallback client if one raises

Convert dig to dig?

Optimize companionless stream retrieval


At this point the usage of dig? should just be mandatory lol

This PR makes the companion-less stream retrieval logic slightly faster, and more resilient. Some calls to #dig is also replaced with #dig?

src/invidious/videos/parser.cr is a bit of a mess and there a ton of duplicated errors too. I'll see if I can do a clean-up after we upgrade to Kemal 1.7.0 and maybe after #5237

Try next fallback client if one raises

Convert `dig` to `dig?`

Optimize companionless stream retrieval
@syeopite syeopite requested a review from a team as a code owner May 18, 2025 06:06
@syeopite syeopite requested review from Fijxu and removed request for a team May 18, 2025 06:06
@unixfox
Copy link
Member

unixfox commented May 18, 2025

At this point the usage of dig? should just be mandatory lol

😄 👍

Copy link
Member

@Fijxu Fijxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine. I no longer get Missing hash key: "videoDetails" (KeyError) when I don't have inv_sig_helper nor invidious-companion set up on the config. The video just fails to play.

2025-05-18 21:24:52 UTC [warn] Missing URLs for adaptive formats, falling back to other YT clients.
2025-05-18 21:24:52 UTC [debug] try_fetch_streaming_data: [x] Using TvHtml5 client.
2025-05-18 21:24:52 UTC [debug] YoutubeAPI: Using endpoint: "/youtubei/v1/player"
2025-05-18 21:24:52 UTC [debug] try_fetch_streaming_data: [x] Got playabilityStatus == LOGIN_REQUIRED.
2025-05-18 21:24:52 UTC [warn] Failed to fetch streams with TvHtml5
2025-05-18 21:24:52 UTC [debug] try_fetch_streaming_data: [x] Using WebMobile client.
2025-05-18 21:24:52 UTC [debug] YoutubeAPI: Using endpoint: "/youtubei/v1/player"
2025-05-18 21:24:52 UTC [debug] try_fetch_streaming_data: [x] Got playabilityStatus == OK.

@syeopite syeopite changed the title Fix #5307 Make base-Invidious video info extraction more resilient May 19, 2025
@unixfox
Copy link
Member

unixfox commented May 19, 2025

Do we still candidate this PR for fixing #5307?

@syeopite
Copy link
Member Author

Yeah it's just a title change

@syeopite syeopite merged commit df8839d into iv-org:master May 28, 2025
8 of 9 checks passed
@syeopite syeopite deleted the fix-5307 branch May 28, 2025 20:19
NorkzYT pushed a commit to NorkzYT/invidious that referenced this pull request Nov 16, 2025
Try next fallback client if one raises

Convert `dig` to `dig?`

Optimize companionless stream retrieval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] videoDetails - inv_sig_helper not installed

3 participants