FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Use streams from the iOS client to workaround playback issues

Open absidue opened this issue 1 year ago • 5 comments

Use streams from the iOS client to workaround playback issues

Pull Request Type

  • [x] 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

absidue avatar Jul 25 '24 17:07 absidue

Livestream: Lofi https://youtu.be/_uMuuHk_KkQ Age-restricted videos: https://github.com/FreeTubeApp/FreeTube/pull/5343 Music: ???

PikachuEXE avatar Jul 26 '24 00:07 PikachuEXE

What Music video is the testing referring to?

PikachuEXE avatar Jul 26 '24 10:07 PikachuEXE

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.

absidue avatar Jul 26 '24 10:07 absidue

That error is coming from the playlist component because the playlist contains duplicate videos, that is unrelated to this pull request.

absidue avatar Jul 26 '24 12:07 absidue

The thing is I get it very consistently on this PR and im not getting it on the latest nightly or latest dev branch

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

https://github.com/user-attachments/assets/bdabb1fd-8a14-44e2-bad7-0b52d29def0e

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

PikachuEXE avatar Jul 29 '24 07:07 PikachuEXE

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.

absidue avatar Jul 29 '24 17:07 absidue

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

PikachuEXE avatar Jul 30 '24 00:07 PikachuEXE

also using Pikachu's shaka build

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

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

ArthurKun21 avatar Jul 31 '24 03:07 ArthurKun21

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

PikachuEXE avatar Jul 31 '24 08:07 PikachuEXE

Retested, havent seen any weird skips

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

PikachuEXE avatar Aug 01 '24 12:08 PikachuEXE

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?

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.

absidue avatar Aug 03 '24 07:08 absidue