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

Sporadic 403 errors in the middle of reading a stream #705

Closed
Tyrrrz opened this issue May 2, 2023 · 2 comments
Closed

Sporadic 403 errors in the middle of reading a stream #705

Tyrrrz opened this issue May 2, 2023 · 2 comments

Comments

@Tyrrrz
Copy link
Owner

Tyrrrz commented May 2, 2023

Version

v6.2.13 / master

Details

Trying to download a media stream can sometimes result in a 403 error. This happens sporadically and can sometimes happen in the middle of the stream. Once that happens, the stream URL becomes unusable, as all further attempts also result in a 403 error.

First reported here: Tyrrrz/YoutubeDownloader#333

Steps to reproduce

  • Use the DemoWpf project
  • Resolve stream manifest for youtube.com/watch?v=6XM7BgoQdhU
  • Download the first video-only stream
  • Get an error at some point during the process
  • If there's no error, try downloading the same stream again (it usually fails every other time)
@Tyrrrz
Copy link
Owner Author

Tyrrrz commented May 2, 2023

Looks like my initial analysis was a bit inaccurate. The error always happens at the beginning of the stream (on the call to MediaStream.InitializeAsync()), but only if that stream (or any other stream from the same manifest) has been read in full.

The original issue (Tyrrrz/YoutubeDownloader#333) suggested that the streams were failing in the middle because the app downloads two streams one after another (audio then video) and only the second one fails.

The error seems to only happen with the ANDROID client, but not the TVHTML5_SIMPLY_EMBEDDED_PLAYER client. We can just switch to using the latter for all requests, but it's a bit heavier and yields a different set of streams (most notably, much fewer muxed streams).

Note that using TVHTML5_SIMPLY_EMBEDDED_PLAYER is also not a very good option because occasionally it returns streams with the n parameter, and we don't support n-signature deciphering yet: #706.

@Tyrrrz Tyrrrz closed this as completed in b82b45a May 2, 2023
@Tyrrrz
Copy link
Owner Author

Tyrrrz commented May 2, 2023

I found that using ANDROID_TESTSUITE instead of the ANDROID client appears to work, at least for now. Going to use that as the solution.

goffincedric added a commit to goffincedric/YoutubeReExplode that referenced this issue May 3, 2023
* Update Android client version

* Remove a useless lock

* Use `ANDROID_TESTSUITE` instead of `ANDROID`

Closes Tyrrrz#705

* Skip the "requires purchase" test

* Use the alternative client for requests related to closed captions

* Update version

* refactor: Optimize imports + Rename exception to match package name

---------

Co-authored-by: Tyrrrz <[email protected]>
goffincedric added a commit to goffincedric/YoutubeReExplode that referenced this issue May 3, 2023
* Use watch page as fallback for extracting video upload date

Closes Tyrrrz#699

* Allow yielding videos without titles

Closes Tyrrrz#700

* Update version

* Replace polyfills with PolyShim

* Update NuGet packages

* Remove `Microsoft.Bcl.HashCode`

* Update readme for the converter

* Move the warning up in the converter readme

* Update readme

* Update NuGet packages

* Update version

* fix: Fix broken pack step due to missing readme

* Refactor/upstream (#19)

* Update Android client version

* Remove a useless lock

* Use `ANDROID_TESTSUITE` instead of `ANDROID`

Closes Tyrrrz#705

* Skip the "requires purchase" test

* Use the alternative client for requests related to closed captions

* Update version

* refactor: Optimize imports + Rename exception to match package name

---------

Co-authored-by: Tyrrrz <[email protected]>

---------

Co-authored-by: Tyrrrz <[email protected]>
xBaank added a commit to xBaank/YoutubeExplode that referenced this issue May 3, 2023
* Update Android client version

* Remove a useless lock

* Use `ANDROID_TESTSUITE` instead of `ANDROID`

Closes Tyrrrz#705

* Skip the "requires purchase" test

* Use the alternative client for requests related to closed captions

* Update version

---------

Co-authored-by: Tyrrrz <[email protected]>
goffincedric added a commit to goffincedric/YoutubeReExplode that referenced this issue Jun 8, 2023
* Update Android client version

* Remove a useless lock

* Use `ANDROID_TESTSUITE` instead of `ANDROID`

Closes Tyrrrz#705

* Skip the "requires purchase" test

* Use the alternative client for requests related to closed captions

* Update version

* Fix badges in YoutubeExplode.Converter readme

* Refactor

* Simplify loop in `Stream.CopyToAsync(...)`

* Update readme

* Set Unix permissions directly in tests

* Use `SetUnixFileMode(...)` directly on `File` instead of `FileInfo`

* Update NuGet packages

* Replace some `OrderBy[Descending](...)` calls with `MinBy(...)`/`MaxBy(...)``

* Fix cipher extraction algorithm

* Update version

* Update favicon

* Add favicon to readme

* Inline unused extension method

* Use buffers based on memory pool

---------

Co-authored-by: Tyrrrz <[email protected]>
goffincedric added a commit to goffincedric/YoutubeReExplode that referenced this issue Jun 8, 2023
* Use watch page as fallback for extracting video upload date

Closes Tyrrrz#699

* Allow yielding videos without titles

Closes Tyrrrz#700

* Update version

* Replace polyfills with PolyShim

* Update NuGet packages

* Remove `Microsoft.Bcl.HashCode`

* Update readme for the converter

* Move the warning up in the converter readme

* Update readme

* Update NuGet packages

* Update version

* fix: Fix broken pack step due to missing readme

* Refactor/upstream (#19)

* Update Android client version

* Remove a useless lock

* Use `ANDROID_TESTSUITE` instead of `ANDROID`

Closes Tyrrrz#705

* Skip the "requires purchase" test

* Use the alternative client for requests related to closed captions

* Update version

* refactor: Optimize imports + Rename exception to match package name

---------

Co-authored-by: Tyrrrz <[email protected]>

* Refactor/upstream (#21)

* Update Android client version

* Remove a useless lock

* Use `ANDROID_TESTSUITE` instead of `ANDROID`

Closes Tyrrrz#705

* Skip the "requires purchase" test

* Use the alternative client for requests related to closed captions

* Update version

* Fix badges in YoutubeExplode.Converter readme

* Refactor

* Simplify loop in `Stream.CopyToAsync(...)`

* Update readme

* Set Unix permissions directly in tests

* Use `SetUnixFileMode(...)` directly on `File` instead of `FileInfo`

* Update NuGet packages

* Replace some `OrderBy[Descending](...)` calls with `MinBy(...)`/`MaxBy(...)``

* Fix cipher extraction algorithm

* Update version

* Update favicon

* Add favicon to readme

* Inline unused extension method

* Use buffers based on memory pool

---------

Co-authored-by: Tyrrrz <[email protected]>

---------

Co-authored-by: Tyrrrz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant