TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
30.99k stars 3.02k forks source link

[YouTube] 403 HTTP error when trying to play some videos #9038

Closed ali-eljerrari closed 1 year ago

ali-eljerrari commented 1 year ago

Checklist

Affected version

0.24.0

Steps to reproduce the bug

I clicked on a random video

Expected behavior

No response

Actual behavior

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at android.os.Looper.loop(Looper.java:237)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)


Screenshots/Screen recordings

No response

Logs

No response

Affected Android/Custom ROM version

No response

Affected device model

j4

Additional information

No response

fohfuu commented 1 year ago

So as to not duplicate the issue, I'm also have inconsistent 403 errors.

Report ## Exception * __User Action:__ play stream * __Request:__ Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=dwzIu4zFJVI * __Content Country:__ GB * __Content Language:__ en-GB * __App Language:__ en * __Service:__ YouTube * __Version:__ 0.24.0 * __OS:__ Linux motorola/liber_retaile/liber:10/QPI30.73-33/f59be:user/release-keys 10 - 29
Crash log

``` com.google.android.exoplayer2.ExoPlaybackException: Source error at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:241) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599) at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) ```


Also, the 403 error results in the app trying to open the video repeatedly, which repeatedly increases the viewcount. Not sure how to get a log for that - it's technically working as intended.

Screen recording https://gfycat.com/WellmadeSociableBluebottlejellyfish Note: the repeated edits are because I couldn't get the bloody gif to embed properly
WorkHard4470 commented 1 year ago

They're the same crash logs.

ali-eljerrari commented 1 year ago

P.S: now the link works perfectly with no bug.

AMDBartek commented 1 year ago

Exact same issue, sometimes a video that works doesn't work later and vice versa (I am on Android 13).

Edit: This may be hard to diagnose as it doesn't occur with all videos.

WalnussPower commented 1 year ago

I think I have the same issue.

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at android.os.Looper.loop(Looper.java:214)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:124)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)


AudricV commented 1 year ago

So, as it seems you are more and more to have this issue, could you answer the following questions when you get it?

@coding-dynasty Please use in the future better issue titles, bug #28/09/2022 is not an appropriate one and does not explain at all the issue.

falkpaulfabian2004 commented 1 year ago

I go the same error on my Huawei P10 Lite with StockRom Android 8.0 after playing a 10 Horus video, during which I slept, yeah don't asking me why I play this video... My screen got even more display problems like green display pixels aka dead pixels and display burnins when I use it for a longer time. this video fix some of the display burnins..

it may be that the so-called autoplay functions caused this to have the exact same error report on the tablet where this is switched on, but not on the mobile phone.

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at android.os.Looper.loop(Looper.java:166)
    at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:124)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at java.lang.Thread.run(Thread.java:784)


nlof commented 1 year ago

Same issue, getting it quite frequently on random videos... There is a fix: force stopping the app and clearing cache (thanks to @edge-elite in the other closed thread just above)! Answer to question: it can happen to any video either enqueued, played straight from search result, or just on auto-play.

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:255)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1005)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)


fohfuu commented 1 year ago

@AudricV

So, as it seems you are more and more to have this issue, could you answer the following questions when you get it?

A little more info from an occurance today:

Does the video you are trying to play have been enqueued several hours before?

Nope.

From which YouTube client are you getting 403s? To check this, please install Intent Intercept app, disable default actions for external player if needed (so you can choose between apps when trying to play a stream on external players), enable Use external video player and Use external audio player options, check the value of the c parameter (&c=) (should be either ANDROID or WEB)?

I followed these steps and the external video player option didn't show up. I don't ever use this feature in the first place.

For what it's worth, the bug report says "error occurred while playing https://www.youtube.com/watch?v=[...]". This URL was also used by the "open in browser" function.

Does the issue happen when trying to play the streams extracted of the video on external players?

I don't use an external player and have no experience using one. Don't even know if I have one installed.

Does the issue happen from this debug build linked in this issue comment or not?

I would check this, but as others have pointed out, force-quitting seems to get around the issue - installing the debug build would quit the original NewPipe instance and therefore I can't check this myself.

Hope that helps, even though it's not all you asked for.

AudricV commented 1 year ago

Hope that helps, even though it's not all you asked for.

Unfortunately not.

Additional question: does this issue happen when trying to download videos using the latest version of yt-dlp? Some reports have been made here (and on youtube-dl too), stating that the fallback server that YouTube adds in its streaming URLs may work in this case.

WorkHard4470 commented 1 year ago

They're the same crash logs.

On Wed, 28 Sep 2022, 9:00 am fohfuu, @.***> wrote:

So as to not duplicate the issue, I'm also have inconsistent 403 errors. Report ## Exception User Action: play stream Request: Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=dwzIu4zFJVI Content Country: GB Content Language: en-GB App Language: en Service: YouTube Version: 0.24.0 OS: Linux motorola/liber_retaile/liber:10/QPI30.73-33/f59be:user/release-keys 10 - 29 Crash log

com.google.android.exoplayer2.ExoPlaybackException: Source error at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:241) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599) at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919)


Also, the 403 error results in the app trying to open the video repeatedly, which repeatedly increases the viewcount. Not sure how to get a log for that - it's technically working as intended. Screen recording <iframe src='https://gfycat.com/ifr/WellmadeSociableBluebottlejellyfish' frameborder='0' scrolling='no' width='100%' height='100%' style='position:absolute;top:0;left:0;' allowfullscreen>

— Reply to this email directly, view it on GitHub https://github.com/TeamNewPipe/NewPipe/issues/9038#issuecomment-1260259630, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QCVRG3M37UI4KSCGY4RMLWAOKEBANCNFSM6AAAAAAQXIIO2Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wetbandits6 commented 1 year ago

I am experiencing the same issue. I have observed that it tends to happen especially when I click on a video and, while is loading, I turn my phone sideways (in landscape mode), but sometimes it happens without a pattern occuring.

The app crashes and I receive a Network Error notification.

I am using NewPipe x Sponsorblock on a Pixel 4a running Graphene OS 13 (TP1A.221005.002), but I believe that the cause of the error might be upstream, in this repo.

Error report is as follows: ## Exception * __User Action:__ play stream * __Request:__ Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=CxPlmHcfguY * __Content Country:__ US * __Content Language:__ en * __App Language:__ en_US * __Service:__ YouTube * __Version:__ 0.24.0 * __OS:__ Linux Android 13 - 33
Crash log

``` com.google.android.exoplayer2.ExoPlaybackException: Source error at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599) at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012) ```


fdfytr commented 1 year ago

Same problem precisely while trying play some videos

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)


AudricV commented 1 year ago

Stop spamming the same comment with the same stacktrace! Please give us instead useful information to help us to identify the problem (see my comments above).

Otherwise, this issue couldn't be fixed.

fdfytr commented 1 year ago

Stop spamming the same comment with the same stacktrace! Please give us instead useful information to help us to identify the problem (see my comments above).

Otherwise, this issue couldn't be fixed.

Totally uncalled. The app gives the option to report bug via github.

What additional info is needed? Open app click play get error. I will just avoid the app then. Buggying is hell for several months and developers call you spammer.

ajm83 commented 1 year ago

Hello, I tried the linked debug build as requested and I got a 403 immediately, stack trace below in case there is anything of interest.

What I did: 1 Subscribe to PBS space time 2 Pick a random video from the subscription page, in this case "Is The Wave Function The Building Block Of Reality" https://www.youtube.com/watch?v=FP6iyVJ70OU 3 click the video to play it in foreground, receive 403

Please note the app was at default settings

The package name is not listed in the info below but it says debug.usecronetforplayback

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:233)
    at android.os.Looper.loop(Looper.java:344)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at com.google.android.exoplayer2.ext.cronet.CronetDataSource.open(CronetDataSource.java:595)
    at com.google.android.exoplayer2.upstream.ResolvingDataSource.open(ResolvingDataSource.java:108)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)


AudricV commented 1 year ago

@ajm83 Thanks. Could you try to answer the other questions in my comments above?

EDGE-ELITE commented 1 year ago

@ajm83 Thanks. Could you try to answer the other questions in my comments above?

I can confirm I'm receiving what appear to be the similar errors using the cronet debug build you posted above.

Exception

com.google.android.exoplayer2.ExoPlaybackException: Source error
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
    at com.google.android.exoplayer2.ext.cronet.CronetDataSource.open(CronetDataSource.java:595)
    at com.google.android.exoplayer2.upstream.ResolvingDataSource.open(ResolvingDataSource.java:108)
    at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
    at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
    at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
    at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
    at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99)
    at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)


oirtemed commented 1 year ago

I'm experiencing the same issue on LineageOS 19.1.

I'll try to answer @AudricV questions below.

  • Does the video you are trying to play have been enqueued several hours before?

No.

  • From which YouTube client are you getting 403s?

ANDROID

Intent details

``` intent://rr1---sn-aigl6ner.googlevideo.com/videoplayback?expire=1665853092&ei=RJJKY9a1JbrpxN8PurGZkAw&ip=37.120.133.75&id=o-AKa_PaXbEfbU2XsR3_2REyPgpzkCRUJ46NNPWevUTtzN&itag=22&source=youtube&requiressl=yes&mh=aP&mm=31%2C29&mn=sn-aigl6ner%2Csn-aigzrne7&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1068750&spc=yR2vpxQJVVVBQmPysdcy37J0IEP8Pbk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=634.624&lmt=1662343734047004&mt=1665830953&fvip=5&fexp=24001373%2C24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAPQBDmTOvCzVRZeB1LEqdFFUMCleRg6xK4iWAJ24vZF4AiEA-lu7RvfgHpe1WAv73yOUMtf-T-bT8SCAe-YksKx8EfU%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAMQDKVuDvZkftkkxU1RIo7krNWXb9hWnuxLp4SbXA2jSAiAO3zd3dXXKEYD__YxlYXUqxeJkKSPCvPp5djnrcRS2gg%3D%3D&cpn=xoUs9bVOm1t39xDe#Intent;scheme=https;type=video/mp4;launchFlags=0x13000000;S.artist=;S.title=Big%20Buck%20Bunny%2060fps%204K%20-%20Official%20Blender%20Foundation%20Short%20Film;S.android.intent.extra.TITLE=Big%20Buck%20Bunny%2060fps%204K%20-%20Official%20Blender%20Foundation%20Short%20Film;end ------------ ACTION: android.intent.action.VIEW DATA: https://rr1---sn-aigl6ner.googlevideo.com/videoplayback?expire=1665853092&ei=RJJKY9a1JbrpxN8PurGZkAw&ip=37.120.133.75&id=o-AKa_PaXbEfbU2XsR3_2REyPgpzkCRUJ46NNPWevUTtzN&itag=22&source=youtube&requiressl=yes&mh=aP&mm=31%2C29&mn=sn-aigl6ner%2Csn-aigzrne7&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1068750&spc=yR2vpxQJVVVBQmPysdcy37J0IEP8Pbk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=634.624&lmt=1662343734047004&mt=1665830953&fvip=5&fexp=24001373%2C24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAPQBDmTOvCzVRZeB1LEqdFFUMCleRg6xK4iWAJ24vZF4AiEA-lu7RvfgHpe1WAv73yOUMtf-T-bT8SCAe-YksKx8EfU%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAMQDKVuDvZkftkkxU1RIo7krNWXb9hWnuxLp4SbXA2jSAiAO3zd3dXXKEYD__YxlYXUqxeJkKSPCvPp5djnrcRS2gg%3D%3D&cpn=xoUs9bVOm1t39xDe MIME: video/mp4 URI: intent://rr1---sn-aigl6ner.googlevideo.com/videoplayback?expire=1665853092&ei=RJJKY9a1JbrpxN8PurGZkAw&ip=37.120.133.75&id=o-AKa_PaXbEfbU2XsR3_2REyPgpzkCRUJ46NNPWevUTtzN&itag=22&source=youtube&requiressl=yes&mh=aP&mm=31%2C29&mn=sn-aigl6ner%2Csn-aigzrne7&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1068750&spc=yR2vpxQJVVVBQmPysdcy37J0IEP8Pbk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=634.624&lmt=1662343734047004&mt=1665830953&fvip=5&fexp=24001373%2C24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAPQBDmTOvCzVRZeB1LEqdFFUMCleRg6xK4iWAJ24vZF4AiEA-lu7RvfgHpe1WAv73yOUMtf-T-bT8SCAe-YksKx8EfU%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAMQDKVuDvZkftkkxU1RIo7krNWXb9hWnuxLp4SbXA2jSAiAO3zd3dXXKEYD__YxlYXUqxeJkKSPCvPp5djnrcRS2gg%3D%3D&cpn=xoUs9bVOm1t39xDe#Intent;scheme=https;type=video/mp4;launchFlags=0x13000000;S.artist=;S.title=Big%20Buck%20Bunny%2060fps%204K%20-%20Official%20Blender%20Foundation%20Short%20Film;S.android.intent.extra.TITLE=Big%20Buck%20Bunny%2060fps%204K%20-%20Official%20Blender%20Foundation%20Short%20Film;end FLAGS: FLAG_RECEIVER_FOREGROUND FLAG_ACTIVITY_FORWARD_RESULT FLAG_ACTIVITY_PREVIOUS_IS_TOP EXTRAS: 1 Class: java.lang.String Key: artist Value: 2 Class: java.lang.String Key: title Value: Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film 3 Class: java.lang.String Key: android.intent.extra.TITLE Value: Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film ------------ MATCHING ACTIVITIES: Video player (com.android.gallery3d - com.android.gallery3d.app.MovieActivity) Photos (com.google.android.apps.photos - com.google.android.apps.photos.pager.HostPhotoPagerActivity) VLC (org.videolan.vlc - org.videolan.vlc.StartActivity) Kore (org.xbmc.kore - org.xbmc.kore.ShareOpenActivity) Kore (org.xbmc.kore - org.xbmc.kore.ShareQueueActivity) ```

  • Does the issue happen when trying to play the streams extracted of the video on external players?

No, it doesn't. I've tried with VLC and I can play the stream with no issues.

Yes, it does. Please, see error report at the bottom of this comment.

Error report generated by org.schabi.newpipe v0.24.0 ## Exception * __User Action:__ play stream * __Request:__ Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=mf5tUbhi9Q4 * __Content Country:__ GB * __Content Language:__ en-GB * __App Language:__ en_GB * __Service:__ YouTube * __Version:__ 0.24.0 * __OS:__ Linux Android 12 - 32
Crash log

``` com.google.android.exoplayer2.ExoPlaybackException: Source error at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599) at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:920) ```

Error report generated by org.schabi.newpipe.debug.usecronetforplayback v0.24.0 ## Exception * __User Action:__ play stream * __Request:__ Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=3WouYgzxbN8 * __Content Country:__ GB * __Content Language:__ en-GB * __App Language:__ en_GB * __Service:__ YouTube * __Version:__ 0.24.0 * __OS:__ Linux Android 12 - 32
Crash log

``` com.google.android.exoplayer2.ExoPlaybackException: Source error at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403 at com.google.android.exoplayer2.ext.cronet.CronetDataSource.open(CronetDataSource.java:595) at com.google.android.exoplayer2.upstream.ResolvingDataSource.open(ResolvingDataSource.java:108) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599) at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:99) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:920) ```


AudricV commented 1 year ago

@oirtemed Thanks a lot. What is your default quality in the in-app player? Is it the same as the one you used to play the content in VLC?

I have additional questions:

chronos281 commented 1 year ago

Some hopefully useful information - first time I've been near a PC when I've had the issue.

  1. Opened https://www.youtube.com/watch?v=DD2m_iqD7dI watched briefly as video then minimised to background.
  2. https://www.youtube.com/watch?v=u9DV1eHQpcA auto played afterwards with no issue.
  3. https://www.youtube.com/watch?v=tlXfpdpKng8 failed, when I checked it did seem to be at a position 7m or so in, as though it had already been played in the past and was resuming. Can confirm I've almost certainly listened to this video in the past (and potentially stopped watching at this point?).
  4. Changed settings in Newpipe to third party audio & video and then attempted to play video via VLC and audio in background via VLC/fubar2000, with both failing (VLC failed on all resolutions attempted, my default resolution for Newpipe is 720p60)
  5. Turned off WiFi as I was running DNS blocking, but same issue with mobile data.
  6. Turned WiFi back on and downloaded as a video with no issues and the file then played fine on VLC. Attempted again to play the video through Newpipe directly and Newpipe via VLC both still failed.
  7. Skipping to the next video worked perfectly well playing as video and audio all resolutions in the app.
  8. Force closed Newpipe, https://www.youtube.com/watch?v=tlXfpdpKng8 then played perfectly well again in Newpipe and Newpipe via VLC with all resolutions.

Running a diff of the failure vs success from Intent Intercept on opening background audio there was very little to see in terms of difference. As expected opening the links on my PC one 403'd and the other gave me the audio.

Running OnePlus Nord CE with Android 11 - customised LineageOS 18.1

EDIT: Managed a simlar issue with the linked dev version. had to try a few things to get it to fail again but after a few attempts skipping from https://www.youtube.com/watch?v=tlXfpdpKng8 gave https://www.youtube.com/watch?v=NmxFxBiCrL4 which then failed on the next auto play which weirdly was https://www.youtube.com/watch?v=ZnZqB5Z75zI. Can say with some certainty this is not a video that has been queued up previously in NewPipe dev version or otherwise.

My TODO: Potentially run some testing with yt-dlp if a suitable test case can be suggested Answer any follow up questions if you've got them @AudricV, or anything I've missed

AudricV commented 1 year ago

@chronos281 Thanks (even if I don't understand some parts of what you wrote). Could you test if using the fallback server provided in the original URL works when you get 403s? To do so, use the following steps:

oirtemed commented 1 year ago

@AudricV sorry I think I was wrong in my previous comment. When the error happens I'm not able to stream it with VLC, I get the error "The location X cannot be played" where X is the URL.

Please, find below the answer to your questions (including the one related to the fallback server).

What is your default quality in the in-app player? Is it the same as the one you used to play the content in VLC?

I have the default video resolution set to 720p and it's the same I use to play the stream in VLC.

* is VLC able to play all resolutions extracted by NewPipe when using the video external player option?

When I'm able to play the stream with the in-app player I'm also able to play the video stream with VLC using all the available resolutions.

* does the issue happen in the in-app player when trying to play audios? If yes, does this happen with VLC?

Sorry but I'm not sure if understand. You mean playing the content using the "background" option? Or do you mean to download the video selecting the "audio" option and then playing the downloaded audio file?

Could you test if using the fallback server provided in the original URL works when you get 403s?

It seems to work fine using the fallback server. Please, find below the intent details and a test against the fallback server using curl in termux.

Intent details

``` intent://rr2---sn-aigzrn7l.googlevideo.com/videoplayback?expire=1665968139&ei=q1NMY4_lHoXZxN8PufyK4AI&ip=94.46.244.26&id=o-AAO-jhJfh19vjQK-VxDD0LVPmFlxuZG-HlHZDXj5Zotb&itag=22&source=youtube&requiressl=yes&mh=DE&mm=31%2C26&mn=sn-aigzrn7l%2Csn-4g5edndy&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=2287500&spc=yR2vp7cBKqbSjkOxuCZhWc1xs2tZ9mk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=527.023&lmt=1662749803344036&mt=1665946158&fvip=3&fexp=24001373%2C24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgAc9Oj6xNNZI2qdedcwnqsSe6PkVYikh9MTa9UpxRIvkCIQDkxaF3sHsyPo4ZvrAs3WsBczxtgFmVuXLkfXwSgOIFiA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAI7zB5RIHANlsy6sUoBUL5itsxZh5FApD9H78L4hbtrgAiEA2rWWRwpHiT57hfPR-z6c8TExtpmwVHOtQxGdxpGmpQM%3D&cpn=5LG3rcjVBSukVXcV#Intent;scheme=https;type=video/mp4;launchFlags=0x13000000;S.artist=;S.title=The%20Download%3A%20GitHub%20Universe%2C%20Minecraft%20Coding%20Font%2C%20Quake%20on%20an%20Apple%20Watch%20and%20more;S.android.intent.extra.TITLE=The%20Download%3A%20GitHub%20Universe%2C%20Minecraft%20Coding%20Font%2C%20Quake%20on%20an%20Apple%20Watch%20and%20more;end ------------ ACTION: android.intent.action.VIEW DATA: https://rr2---sn-aigzrn7l.googlevideo.com/videoplayback?expire=1665968139&ei=q1NMY4_lHoXZxN8PufyK4AI&ip=94.46.244.26&id=o-AAO-jhJfh19vjQK-VxDD0LVPmFlxuZG-HlHZDXj5Zotb&itag=22&source=youtube&requiressl=yes&mh=DE&mm=31%2C26&mn=sn-aigzrn7l%2Csn-4g5edndy&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=2287500&spc=yR2vp7cBKqbSjkOxuCZhWc1xs2tZ9mk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=527.023&lmt=1662749803344036&mt=1665946158&fvip=3&fexp=24001373%2C24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgAc9Oj6xNNZI2qdedcwnqsSe6PkVYikh9MTa9UpxRIvkCIQDkxaF3sHsyPo4ZvrAs3WsBczxtgFmVuXLkfXwSgOIFiA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAI7zB5RIHANlsy6sUoBUL5itsxZh5FApD9H78L4hbtrgAiEA2rWWRwpHiT57hfPR-z6c8TExtpmwVHOtQxGdxpGmpQM%3D&cpn=5LG3rcjVBSukVXcV MIME: video/mp4 URI: intent://rr2---sn-aigzrn7l.googlevideo.com/videoplayback?expire=1665968139&ei=q1NMY4_lHoXZxN8PufyK4AI&ip=94.46.244.26&id=o-AAO-jhJfh19vjQK-VxDD0LVPmFlxuZG-HlHZDXj5Zotb&itag=22&source=youtube&requiressl=yes&mh=DE&mm=31%2C26&mn=sn-aigzrn7l%2Csn-4g5edndy&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=2287500&spc=yR2vp7cBKqbSjkOxuCZhWc1xs2tZ9mk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=527.023&lmt=1662749803344036&mt=1665946158&fvip=3&fexp=24001373%2C24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgAc9Oj6xNNZI2qdedcwnqsSe6PkVYikh9MTa9UpxRIvkCIQDkxaF3sHsyPo4ZvrAs3WsBczxtgFmVuXLkfXwSgOIFiA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAI7zB5RIHANlsy6sUoBUL5itsxZh5FApD9H78L4hbtrgAiEA2rWWRwpHiT57hfPR-z6c8TExtpmwVHOtQxGdxpGmpQM%3D&cpn=5LG3rcjVBSukVXcV#Intent;scheme=https;type=video/mp4;launchFlags=0x13000000;S.artist=;S.title=The%20Download%3A%20GitHub%20Universe%2C%20Minecraft%20Coding%20Font%2C%20Quake%20on%20an%20Apple%20Watch%20and%20more;S.android.intent.extra.TITLE=The%20Download%3A%20GitHub%20Universe%2C%20Minecraft%20Coding%20Font%2C%20Quake%20on%20an%20Apple%20Watch%20and%20more;end FLAGS: FLAG_RECEIVER_FOREGROUND FLAG_ACTIVITY_FORWARD_RESULT FLAG_ACTIVITY_PREVIOUS_IS_TOP EXTRAS: 1 Class: java.lang.String Key: artist Value: 2 Class: java.lang.String Key: title Value: The Download: GitHub Universe, Minecraft Coding Font, Quake on an Apple Watch and more 3 Class: java.lang.String Key: android.intent.extra.TITLE Value: The Download: GitHub Universe, Minecraft Coding Font, Quake on an Apple Watch and more ------------ MATCHING ACTIVITIES: Video player (com.android.gallery3d - com.android.gallery3d.app.MovieActivity) Photos (com.google.android.apps.photos - com.google.android.apps.photos.pager.HostPhotoPagerActivity) VLC (org.videolan.vlc - org.videolan.vlc.StartActivity) Kore (org.xbmc.kore - org.xbmc.kore.ShareOpenActivity) Kore (org.xbmc.kore - org.xbmc.kore.ShareQueueActivity) ```

~ $ curl -v 'https://rr2---sn-4g5edndy.googlevideo.com/videoplayback?expire=1665968139&ei=q1NMY4_lHoXZxN8PufyK4AI&ip=94.46.244.26&id=o-AAO-jhJfh19vjQK-VxDD0LVPmFlxuZG-HlHZDXj5Zotb&itag=22&source=youtube&requiressl=yes&mh=DE&mm=31%2C26&mn=sn-aigzrn7l%2Csn-4g5edndy&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=2287500&spc=yR2vp7cBKqbSjkOxuCZhWc1xs2tZ9mk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=527.023&lmt=1662749803344036&mt=1665946158&fvip=3&fexp=24001373%2C24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgAc9Oj6xNNZI2qdedcwnqsSe6PkVYikh9MTa9UpxRIvkCIQDkxaF3sHsyPo4ZvrAs3WsBczxtgFmVuXLkfXwSgOIFiA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAI7zB5RIHANlsy6sUoBUL5itsxZh5FApD9H78L4hbtrgAiEA2rWWRwpHiT57hfPR-z6c8TExtpmwVHOtQxGdxpGmpQM%3D&cpn=5LG3rcjVBSukVXcV'
*   Trying 173.194.1.7:443...
* Connected to rr2---sn-4g5edndy.googlevideo.com (173.194.1.7) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /data/data/com.termux/files/usr/etc/tls/cert.pem
*  CApath: /data/data/com.termux/files/usr/etc/tls/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.c.docs.google.com
*  start date: Sep 27 11:05:53 2022 GMT
*  expire date: Dec  6 11:05:52 2022 GMT
*  subjectAltName: host "rr2---sn-4g5edndy.googlevideo.com" matched cert's "*.googlevideo.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
> GET /videoplayback?expire=1665968139&ei=q1NMY4_lHoXZxN8PufyK4AI&ip=94.46.244.26&id=o-AAO-jhJfh19vjQK-VxDD0LVPmFlxuZG-HlHZDXj5Zotb&itag=22&source=youtube&requiressl=yes&mh=DE&mm=31%2C26&mn=sn-aigzrn7l%2Csn-4g5edndy&ms=au%2Conr&mv=m&mvi=2&pl=22&initcwndbps=2287500&spc=yR2vp7cBKqbSjkOxuCZhWc1xs2tZ9mk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=527.023&lmt=1662749803344036&mt=1665946158&fvip=3&fexp=24001373%2C24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgAc9Oj6xNNZI2qdedcwnqsSe6PkVYikh9MTa9UpxRIvkCIQDkxaF3sHsyPo4ZvrAs3WsBczxtgFmVuXLkfXwSgOIFiA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAI7zB5RIHANlsy6sUoBUL5itsxZh5FApD9H78L4hbtrgAiEA2rWWRwpHiT57hfPR-z6c8TExtpmwVHOtQxGdxpGmpQM%3D&cpn=5LG3rcjVBSukVXcV HTTP/1.1
> Host: rr2---sn-4g5edndy.googlevideo.com
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Last-Modified: Wed, 02 May 2007 10:26:10 GMT
< Date: Sun, 16 Oct 2022 19:02:17 GMT
< Expires: Sun, 16 Oct 2022 19:02:17 GMT
< Cache-Control: private, max-age=900
< Location: https://rr1---sn-5hnednss.googlevideo.com/videoplayback?expire=1665968139&ei=q1NMY4_lHoXZxN8PufyK4AI&ip=94.46.244.26&id=o-AAO-jhJfh19vjQK-VxDD0LVPmFlxuZG-HlHZDXj5Zotb&itag=22&source=youtube&requiressl=yes&spc=yR2vp7cBKqbSjkOxuCZhWc1xs2tZ9mk&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=527.023&lmt=1662749803344036&fexp=24001373,24007246&c=ANDROID&txp=6318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgAc9Oj6xNNZI2qdedcwnqsSe6PkVYikh9MTa9UpxRIvkCIQDkxaF3sHsyPo4ZvrAs3WsBczxtgFmVuXLkfXwSgOIFiA%3D%3D&cpn=5LG3rcjVBSukVXcV&redirect_counter=1&rm=sn-4g5eys7l&req_id=c9fa4f464070a3ee&cms_redirect=yes&cmsv=e&mh=DE&mm=34&mn=sn-5hnednss&ms=ltu&mt=1665946854&mv=m&mvi=1&pl=22&lsparams=mh,mm,mn,ms,mv,mvi,pl&lsig=AG3C_xAwRQIhAPTace6-VAkwu0liTw4G1XTI1UOD5LQHJZGBPaFu7ZLkAiAtisFi-f3fhlJViP2eRIJ9QVUX2T6ppdeQOkavQJqLlw%3D%3D
< Content-Length: 0
< Connection: close
< Vary: Origin
< Cross-Origin-Resource-Policy: cross-origin
< X-Content-Type-Options: nosniff
< Content-Type: text/html
< Server: gvs 1.0
<
* Closing connection 0
* TLSv1.3 (OUT), TLS alert, close notify (256):
Mod edit: duplicate error report removed
AudricV commented 1 year ago

Sorry but I'm not sure if understand. You mean playing the content using the "background" option? Or do you mean to download the video selecting the "audio" option and then playing the downloaded audio file?

Exactly, sorry for the confusion.

Thanks for testing the fallback server! The question is now: is the 403 response code voluntary against third-party clients from Google video servers or is it a server issue?

It would be great if you can test this on YouTube websites to know if you get this behavior on them (watch videos on YouTube with the developer tools of your browser enabled and check for 403 of videoplayback URLs.

Note: I tested your streaming URL with the fallback host and the redirector domain (redirector.googlevideo.com instead of the playback host), and I was successfully redirected to the video file.

It won't be testable of course in a few hours, as the URL would have expired.

oirtemed commented 1 year ago

I've just performed a second test with a different video. This time the fallback server didn't work and got a 403. Please, find at the bottom the output. Does it make sense?

  • does the issue happen in the in-app player when trying to play audios? If yes, does this happen with VLC?

After the error is reported, if I tap on "Background" the app doesn't do anything and it doesn't report any error. I can download the audio track though. I can also play the audio using VLC.

I'll try what you suggested with the browser developer tools during the week.

cURL output:

~ $ curl -v 'https://rr5---sn-aigl6ney.googlevideo.com/videoplayback?expire=1665971853&ei=LWJMY7XMJKn1xgLU87jQAw&ip=37.120.133.73&id=o-AMNp9cIBTVBezoWXLKbZMSEIQaVKcrBluuAApcqZENe5&itag=22&source=youtube&requiressl=yes&mh=UH&mm=31%2C29&mn=sn-aigzrn76%2Csn-aigl6ney&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=1300000&spc=yR2vpyhuBURUf_S0oDR94ZFk4en73Go&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=1859.895&lmt=1664272109362693&mt=1665949762&fvip=4&fexp=24001373%2C24007246&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP6OHad2IUroJ5dZxVagbHNpP_cLBfBuBlid2uJsiOVnAiB12pOiNE-4yEZ3Lwk3QKIl2D5-sa_ceyiYCEanHPcLOg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgb95DEsCXU_UEwGpkCVAdRJ_X8bjnQu-kSXk2D7Ac9EoCIH2bQbWzw--1N7pSrXN9Ux1OLSZiowFwKRNrxN0TpMOO&cpn=Vl-wJ7kNyDL-OrO0'
*   Trying 173.194.183.170:443...
* Connected to rr5---sn-aigl6ney.googlevideo.com (173.194.183.170) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /data/data/com.termux/files/usr/etc/tls/cert.pem
*  CApath: /data/data/com.termux/files/usr/etc/tls/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.c.docs.google.com
*  start date: Sep 27 11:05:53 2022 GMT
*  expire date: Dec  6 11:05:52 2022 GMT
*  subjectAltName: host "rr5---sn-aigl6ney.googlevideo.com" matched cert's "*.googlevideo.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
> GET /videoplayback?expire=1665971853&ei=LWJMY7XMJKn1xgLU87jQAw&ip=37.120.133.73&id=o-AMNp9cIBTVBezoWXLKbZMSEIQaVKcrBluuAApcqZENe5&itag=22&source=youtube&requiressl=yes&mh=UH&mm=31%2C29&mn=sn-aigzrn76%2Csn-aigl6ney&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=1300000&spc=yR2vpyhuBURUf_S0oDR94ZFk4en73Go&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=1859.895&lmt=1664272109362693&mt=1665949762&fvip=4&fexp=24001373%2C24007246&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP6OHad2IUroJ5dZxVagbHNpP_cLBfBuBlid2uJsiOVnAiB12pOiNE-4yEZ3Lwk3QKIl2D5-sa_ceyiYCEanHPcLOg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgb95DEsCXU_UEwGpkCVAdRJ_X8bjnQu-kSXk2D7Ac9EoCIH2bQbWzw--1N7pSrXN9Ux1OLSZiowFwKRNrxN0TpMOO&cpn=Vl-wJ7kNyDL-OrO0 HTTP/1.1
> Host: rr5---sn-aigl6ney.googlevideo.com
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 403 Forbidden
< Last-Modified: Wed, 02 May 2007 10:26:10 GMT
< Content-Type: text/plain
< Content-Length: 0
< Connection: close
< Vary: Origin
< Cross-Origin-Resource-Policy: cross-origin
< X-Content-Type-Options: nosniff
< Date: Sun, 16 Oct 2022 20:01:06 GMT
< Server: gvs 1.0
<
* Closing connection 0
* TLSv1.3 (OUT), TLS alert, close notify (256):
Intent details

``` intent://rr5---sn-aigzrn76.googlevideo.com/videoplayback?expire=1665971853&ei=LWJMY7XMJKn1xgLU87jQAw&ip=37.120.133.73&id=o-AMNp9cIBTVBezoWXLKbZMSEIQaVKcrBluuAApcqZENe5&itag=22&source=youtube&requiressl=yes&mh=UH&mm=31%2C29&mn=sn-aigzrn76%2Csn-aigl6ney&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=1300000&spc=yR2vpyhuBURUf_S0oDR94ZFk4en73Go&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=1859.895&lmt=1664272109362693&mt=1665949762&fvip=4&fexp=24001373%2C24007246&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP6OHad2IUroJ5dZxVagbHNpP_cLBfBuBlid2uJsiOVnAiB12pOiNE-4yEZ3Lwk3QKIl2D5-sa_ceyiYCEanHPcLOg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgb95DEsCXU_UEwGpkCVAdRJ_X8bjnQu-kSXk2D7Ac9EoCIH2bQbWzw--1N7pSrXN9Ux1OLSZiowFwKRNrxN0TpMOO&cpn=Vl-wJ7kNyDL-OrO0#Intent;scheme=https;type=video/mp4;launchFlags=0x13400000;S.artist=;S.title=Your%20Open%20Source%20Alternative%20to%20Twilio%20-%20%20Fonoster%20-%20Open%20Source%20Friday%20%23opensource;S.android.intent.extra.TITLE=Your%20Open%20Source%20Alternative%20to%20Twilio%20-%20%20Fonoster%20-%20Open%20Source%20Friday%20%23opensource;end ------------ ACTION: android.intent.action.VIEW DATA: https://rr5---sn-aigzrn76.googlevideo.com/videoplayback?expire=1665971853&ei=LWJMY7XMJKn1xgLU87jQAw&ip=37.120.133.73&id=o-AMNp9cIBTVBezoWXLKbZMSEIQaVKcrBluuAApcqZENe5&itag=22&source=youtube&requiressl=yes&mh=UH&mm=31%2C29&mn=sn-aigzrn76%2Csn-aigl6ney&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=1300000&spc=yR2vpyhuBURUf_S0oDR94ZFk4en73Go&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=1859.895&lmt=1664272109362693&mt=1665949762&fvip=4&fexp=24001373%2C24007246&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP6OHad2IUroJ5dZxVagbHNpP_cLBfBuBlid2uJsiOVnAiB12pOiNE-4yEZ3Lwk3QKIl2D5-sa_ceyiYCEanHPcLOg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgb95DEsCXU_UEwGpkCVAdRJ_X8bjnQu-kSXk2D7Ac9EoCIH2bQbWzw--1N7pSrXN9Ux1OLSZiowFwKRNrxN0TpMOO&cpn=Vl-wJ7kNyDL-OrO0 MIME: video/mp4 URI: intent://rr5---sn-aigzrn76.googlevideo.com/videoplayback?expire=1665971853&ei=LWJMY7XMJKn1xgLU87jQAw&ip=37.120.133.73&id=o-AMNp9cIBTVBezoWXLKbZMSEIQaVKcrBluuAApcqZENe5&itag=22&source=youtube&requiressl=yes&mh=UH&mm=31%2C29&mn=sn-aigzrn76%2Csn-aigl6ney&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=1300000&spc=yR2vpyhuBURUf_S0oDR94ZFk4en73Go&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=1859.895&lmt=1664272109362693&mt=1665949762&fvip=4&fexp=24001373%2C24007246&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP6OHad2IUroJ5dZxVagbHNpP_cLBfBuBlid2uJsiOVnAiB12pOiNE-4yEZ3Lwk3QKIl2D5-sa_ceyiYCEanHPcLOg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgb95DEsCXU_UEwGpkCVAdRJ_X8bjnQu-kSXk2D7Ac9EoCIH2bQbWzw--1N7pSrXN9Ux1OLSZiowFwKRNrxN0TpMOO&cpn=Vl-wJ7kNyDL-OrO0#Intent;scheme=https;type=video/mp4;launchFlags=0x13400000;S.artist=;S.title=Your%20Open%20Source%20Alternative%20to%20Twilio%20-%20%20Fonoster%20-%20Open%20Source%20Friday%20%23opensource;S.android.intent.extra.TITLE=Your%20Open%20Source%20Alternative%20to%20Twilio%20-%20%20Fonoster%20-%20Open%20Source%20Friday%20%23opensource;end FLAGS: FLAG_RECEIVER_FOREGROUND FLAG_ACTIVITY_FORWARD_RESULT FLAG_ACTIVITY_PREVIOUS_IS_TOP FLAG_ACTIVITY_BROUGHT_TO_FRONT EXTRAS: 1 Class: java.lang.String Key: artist Value: 2 Class: java.lang.String Key: title Value: Your Open Source Alternative to Twilio - Fonoster - Open Source Friday #opensource 3 Class: java.lang.String Key: android.intent.extra.TITLE Value: Your Open Source Alternative to Twilio - Fonoster - Open Source Friday #opensource ------------ MATCHING ACTIVITIES: Video player (com.android.gallery3d - com.android.gallery3d.app.MovieActivity) Photos (com.google.android.apps.photos - com.google.android.apps.photos.pager.HostPhotoPagerActivity) VLC (org.videolan.vlc - org.videolan.vlc.StartActivity) Kore (org.xbmc.kore - org.xbmc.kore.ShareOpenActivity) Kore (org.xbmc.kore - org.xbmc.kore.ShareQueueActivity) ```

chronos281 commented 1 year ago

Could you test if using the fallback server provided in the original URL works when you get 403s?

Can confirm fallback server appears to fix the issue, both modifying in Intent Intercept before continuing to VLC or loading modified link in a fresh browser window.

Had half an hour or so of youtube on the pc, only had one 403 and that was for https://i.ytimg.com, nothing but 200's far as the eye can see for videoplayback URLs.

Will try and remember to have dev tools open in the background next time for a longer session, possibly look at seeing if I can get some sort of dev tools working on my phone just in case that makes a difference.

chronos281 commented 1 year ago

I've just performed a second test with a different video. This time the fallback server didn't work and got a 403.

Seems I didn't have a large enough sample size. Ran two more after seeing your note. One worked one did not:

Success Original address https://rr1---sn-aigl6ns6.googlevideo.com which I modified to https://rr1---sn-5hnekn76.googlevideo.com based on the mn query parameter but then appears to have changed to https://rr3---sn-4g5ednde.googlevideo.com

abc

Failure Original address https://rr5---sn-aigl6n6s.googlevideo.com modified based on parameter again to https://rr5---sn-aigzrne7.googlevideo.com and no change after adding this time

def

JasonT962 commented 1 year ago

I've also been suffering from this problem for a while now. I've managed to come up with a fix which should hopefully be merged soon.

ghost commented 1 year ago

i have this issue as well and i think i've worked out the problem, youtube is A/B testing a new requirement for requests (like #8713 and also tied to visitorData). the required parameter is field number 12 in the protobuf (very long base64 string), the JSON name is "params" -- it seems to be some kind of ad token?

strangely even though using the JSON API without the parameter gets you a 403, when using the protobuf interface you get the famous 'content is not available on this app' message instead.

edit: since params contains protobuf-encoded data, removing all the fields except the ones the server needs gets you the following working (for now) value: CgIQBg%3D%3D. for a non-working x-goog-visitor-id, adding "params": "CgIQBg%3D%3D" seems to stop the issue!

AudricV commented 1 year ago

Could you test the APK from this CI run (section Artifcats) to see if the issue is fixed or not? You can find the source code of the changes by clicking on the commit associated to the run and then going to the branch.

https://github.com/AudricV/NewPipe/actions/runs/3352339641

Thank you in advance.

nlof commented 1 year ago

@AudricV Yep this seems to have fixed it. Awesome!

prakalpup commented 1 year ago

Today i am suffering playback issue in some videos what to do pls help