Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use streams from the iOS client to workaround playback issues #5472

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Jul 25, 2024

Use streams from the iOS client to workaround playback issues

Pull Request Type

  • Bugfix

Related issue

closes #5453
closes #5370

Description

As YouTube is currently introducing various changes to the WEB client, which cause the random 403s and the random No valid URL to decipher errors. This pull request aims to solve both of those issues, by using the DASH streams from the iOS client instead. Age-restricted videos are still expected to have the random 403s problem, as the client we use to bypass the forced login, has the same problems as the WEB client. I've had to add overrides in a few places to get it to actually work, such as the User-Agent, however those overrides should only affect iOS requests.

Unfortunately the iOS client doesn't have the opus audio streams.

Testing

Please test this pull request thoroughly with various different videos (e.g. normal, live streams, age-restricted, music).

Age-restricted videos are still expected to have the random 403s problem.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.21.2

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 25, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) July 25, 2024 17:43
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Testing it daily~

src/renderer/helpers/api/local.js Outdated Show resolved Hide resolved
@PikachuEXE
Copy link
Collaborator

Livestream: Lofi https://youtu.be/_uMuuHk_KkQ
Age-restricted videos: #5343
Music: ???

@PikachuEXE
Copy link
Collaborator

What Music video is the testing referring to?

@absidue
Copy link
Member Author

absidue commented Jul 26, 2024

Music videos have stronger restrictions on them, e.g. geo restrictions and on the website you need to do extra steps to get them to play. So any music video should work, the main thing is just to check that it plays.

efb4f5ff-1298-471a-8973-3d47447115dc

This comment was marked as off-topic.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Jul 26, 2024
@absidue

This comment was marked as off-topic.

@efb4f5ff-1298-471a-8973-3d47447115dc

This comment was marked as off-topic.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Jul 26, 2024
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

No random 403 so far in my custom build (with shaka
Let me test this until Tuesday

@PikachuEXE
Copy link
Collaborator

PikachuEXE commented Jul 29, 2024

I am testing this with shaka together to play long playlists on MacOS & Windows
On both OS I notice sometimes 10 seconds are skipped on random video only happens per > 10 videos

Screen.Recording.2024-07-29.at.15.52.10.mov

See some SponsorBlock errors but not sure if related
image

Update 1: SponsorBlock not related
I just got 2nd time happening on 0:39 again (another video)

Update 2: Got another one 0:59 > 1:09 on windows

@absidue
Copy link
Member Author

absidue commented Jul 29, 2024

Okay that definitely shouldn't be happening, it's also interesting that it is random, I wonder if it has anything to do with this pull request using random app versions and iOS versions.

@PikachuEXE
Copy link
Collaborator

PikachuEXE commented Jul 30, 2024

Built a custom build printing client version and iOS version
Let's see what would be printed when the issue occurs again (will need at least 3-5 times)

1st:
0:39 > 0:49
client 19.24.2
ios 17.5.1

@ArthurKun21
Copy link

also using Pikachu's shaka build

https://youtu.be/J-4XwZGGn_o

I did skip from 0:58 -> 1:10

@PikachuEXE
Copy link
Collaborator

I can't reproduce with that video yet
But it happens really rarely and I am using another custom build (with a bit more debugging printing client & iOS versions

I only got 1 jump so far

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

No jump detected for the last day
Not such a big issue to prevent merging

@efb4f5ff-1298-471a-8973-3d47447115dc

Retested, havent seen any weird skips

@PikachuEXE
Copy link
Collaborator

Last time it requires 5x videos to 1-3 skips
If I find more skips and/or can reproduce it consistently I will update here but not serious enough to block the merge

@FreeTubeBot FreeTubeBot merged commit 3a245ec into FreeTubeApp:development Aug 1, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 1, 2024
@absidue absidue deleted the ios-workaround branch August 1, 2024 12:49
PikachuEXE pushed a commit to PikachuEXE/FreeTube that referenced this pull request Aug 1, 2024
…beApp#5472)

* Use streams from the iOS client to workaround playback issues

* Fix for unplayable videos

* Hoist version arrays and introduce a randomArrayItem helper
OothecaPickle pushed a commit to OothecaPickle/FreeTube that referenced this pull request Aug 1, 2024
…beApp#5472)

* Use streams from the iOS client to workaround playback issues

* Fix for unplayable videos

* Hoist version arrays and introduce a randomArrayItem helper
PrestonN pushed a commit that referenced this pull request Aug 2, 2024
…o workaround playback issues (#5508)

* ^ Update youtubei.js

* Use streams from the iOS client to workaround playback issues (#5472)

* Use streams from the iOS client to workaround playback issues

* Fix for unplayable videos

* Hoist version arrays and introduce a randomArrayItem helper

---------

Co-authored-by: absidue <[email protected]>
MarmadileManteater added a commit to MarmadileManteater/FreeTubeAndroid that referenced this pull request Aug 2, 2024
…ctions

- ^Update youtubei.js
- Use streams from the iOS client to workaround playback issues (FreeTubeApp#5472)
- Allow user agent spoofing for usage of iOS client
MarmadileManteater added a commit to MarmadileManteater/FreeTubeAndroid that referenced this pull request Aug 2, 2024
…ctions

- ^Update youtubei.js
- Use streams from the iOS client to workaround playback issues (FreeTubeApp#5472)
- Allow user agent spoofing for usage of iOS client
@efb4f5ff-1298-471a-8973-3d47447115dc

It just dawned on me that the weird skips arent maybe related to this PR but to FT in general.

Users of adblockers reported on reddit that they have seeing black screens for 5-15sec and it might be related to sever side ad injection

Could that explain the random skips?

@absidue
Copy link
Member Author

absidue commented Aug 3, 2024

That definitely would make sense and would also explain why it doesn't happen very often yet, because YouTube hasn't fully rolled them out yet.

PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Aug 4, 2024
* development:
  Bump version number to v0.21.3
  Bump sass-loader from 14.2.1 to 16.0.0 (FreeTubeApp#5495)
  ^ Update youtubei.js (FreeTubeApp#5507)
  Use streams from the iOS client to workaround playback issues (FreeTubeApp#5472)
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]: Error: No valid URL to decipher [Bug]: 80% of videos get loaded as legacy
6 participants