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

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

Closed
6 tasks done
ali-eljerrari opened this issue Sep 27, 2022 · 32 comments · Fixed by TeamNewPipe/NewPipeExtractor#960
Closed
6 tasks done
Labels
bug Issue is related to a bug requires extractor change This issue requires a change to the extractor youtube Service, https://www.youtube.com/

Comments

@ali-eljerrari
Copy link

Checklist

  • I am able to reproduce the bug with the latest version.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

0.24.0

Steps to reproduce the bug

I clicked on a random video

Expected behavior

No response

Actual behavior

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=6NqK9uS3wxA
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en_GB
  • Service: YouTube
  • Version: 0.24.0
  • OS: Linux Android 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: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

@ali-eljerrari ali-eljerrari added bug Issue is related to a bug needs triage Issue is not yet ready for PR authors to take up labels Sep 27, 2022
@fohfuu
Copy link

fohfuu commented Sep 28, 2022

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
Copy link

They're the same crash logs.

@ali-eljerrari
Copy link
Author

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

@AMDBartek
Copy link

AMDBartek commented Sep 29, 2022

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
Copy link

I think I have the same issue.

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=YfRtD5bIN0k
  • Content Country: DE
  • Content Language: de-DE
  • App Language: de_DE
  • Service: YouTube
  • Version: 0.24.0
  • OS: Linux Nokia/Onyx_00WW/B2N_sprout:10/QKQ1.190828.002/00WW_4_16B: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: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
Copy link
Member

AudricV commented Sep 30, 2022

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

  • Does the video you are trying to play have been enqueued several hours before?
  • 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, IOS (for running livestreams only), WEB or TVHTML5_SIMPLY_EMBEDDED_PLAYER)?
  • Does the issue happen when trying to play the streams extracted of the video on external players?
  • Does the issue happen from this debug build linked in this issue comment or not?

@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.

@AudricV AudricV added youtube Service, https://www.youtube.com/ and removed needs triage Issue is not yet ready for PR authors to take up labels Sep 30, 2022
@AudricV AudricV changed the title bug #28/09/2022 [YouTube] 403 HTTP error when trying to play some videos Sep 30, 2022
@opusforlife2 opusforlife2 added the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Oct 1, 2022
@falkpaulfabian2004

This comment was marked as off-topic.

@nlof

This comment was marked as duplicate.

@fohfuu
Copy link

fohfuu commented Oct 9, 2022

@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
Copy link
Member

AudricV commented Oct 10, 2022

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
Copy link

WorkHard4470 commented Oct 11, 2022 via email

@wetbandits6 wetbandits6 mentioned this issue Oct 12, 2022
6 tasks
@wetbandits6
Copy link

wetbandits6 commented Oct 12, 2022

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

This comment was marked as spam.

@AudricV
Copy link
Member

AudricV commented Oct 14, 2022

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

This comment was marked as spam.

@ajm83
Copy link

ajm83 commented Oct 14, 2022

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

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=FP6iyVJ70OU
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en_GB
  • Service: YouTube
  • Version: 0.24.0
  • OS: Linux OnePlus/DN2103EEA/OP515BL1:12/SP1A.210812.016/R.GDPR.202204021709:user/release-keys 12 - 31
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: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 AudricV removed the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Oct 15, 2022
@AudricV
Copy link
Member

AudricV commented Oct 15, 2022

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

@EDGE-ELITE

This comment was marked as duplicate.

@oirtemed
Copy link

oirtemed commented Oct 15, 2022

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
Copy link
Member

AudricV commented Oct 15, 2022

@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:

  • is VLC able to play all resolutions extracted by NewPipe when using the video external player option?
  • does the issue happen in the in-app player when trying to play audios? If yes, does this happen with VLC?

@chronos281
Copy link

chronos281 commented Oct 16, 2022

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
Copy link
Member

AudricV commented Oct 16, 2022

@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:

  • in the streaming URL, look at the mn query parameter value (what is after &mn= and before the next &), this should be something like sn-hgn7yn7e%2Csn-hgn7rn7r
  • still in this URL, replace in the host name the value before the %2C characters of the mn parameter (or a ,) by what is after it: for example, rr2---sn-hgn7yn7e.googlevideo.com would become rr2---sn-hgn7rn7r.googlevideo.com.

@oirtemed
Copy link

oirtemed commented Oct 16, 2022

@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
Copy link
Member

AudricV commented Oct 16, 2022

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
Copy link

oirtemed commented Oct 16, 2022

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
Copy link

chronos281 commented Oct 16, 2022

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
Copy link

chronos281 commented Oct 16, 2022

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
Copy link

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.

@AudricV AudricV added the requires extractor change This issue requires a change to the extractor label Oct 23, 2022
@AudricV AudricV pinned this issue Oct 24, 2022
@ghost
Copy link

ghost commented Oct 24, 2022

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
Copy link
Member

AudricV commented Oct 29, 2022

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
Copy link

nlof commented Oct 30, 2022

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

@prakalpup

This comment was marked as off-topic.

@TeamNewPipe TeamNewPipe locked and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue is related to a bug requires extractor change This issue requires a change to the extractor youtube Service, https://www.youtube.com/
Projects
None yet