Piped icon indicating copy to clipboard operation
Piped copied to clipboard

"The page needs to be reloaded" error when attempting to open videos

Open 10203 opened this issue 10 months ago • 28 comments

Official Instance

Describe the bug

This error shows up randomly when trying to play a video, livestream or short and as it suggests if you refresh the page at some point the video will play. This error shows up on the official instance and on my personal instance.

To Reproduce

  1. Go to a working piped instance, the official one with the "private.coffee" instance selected in settings will work
  2. Select any video
  3. The error should show up replacing the video player
  4. If it does not refresh the page until it does

Expected behavior

The video player shows and plays the video.

Logs/Errors

{ error:"org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException: The page needs to be reloaded. at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.checkPlayabilityStatus(YoutubeStreamExtractor.java:894) at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.fetchHtml5Client(YoutubeStreamExtractor.java:935) at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.onFetchPage(YoutubeStreamExtractor.java:823) at org.schabi.newpipe.extractor.Extractor.fetchPage(Extractor.java:60) at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:77) at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:72) at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:67) at me.kavin.piped.server.handlers.StreamHandlers.lambda$streamsResponse$0(StreamHandlers.java:54) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) " message:"The page needs to be reloaded." }

Browser, and OS with Version.

Universally replicated, but:

  • Artix Linux
  • Librewolf 146.0.1-1

Additional context

This error show up on anything using the piped api such as LibreTube and PipePipe. Because this error is universal it's probably because of YouTube backend changes, or so I guess.

10203 avatar Jan 25 '26 01:01 10203

I fixed this issue on my Piped instance:

How to fix this issue on your own Piped instance

This is not easy if you don't already build your instance from source (for which I cannot give you a step by step because it depends on your deployment method). Mine is, because I use my own small fork, that fixes Piped leaking your servers public IP address.

Basically I substituted the NewPipeExtractor library from the Piped fork with upstream commit cfa985451eb11bbf812fecf57d74d9ed9da0eb3f cherry picked on top of 05e0e4ced7b6ff05f3d68d831efed8bdf588f9ac (I chose that commit, because anything after https://github.com/TeamNewPipe/NewPipe/pull/12706 gave me nothing but trouble, but that is probably not that PRs fault but caused by me barely having used Java in the last few years and my build system knowledge being out of date).

Here is a NON-EXHAUSTIVE outline of the process, that you need to adapt to your deployment:

  • In your checked out Piped-Backend source code folder run:
    • git clone https://github.com/TeamNewPipe/NewPipeExtractor.git
    • cd NewPipeExtractor
    • git checkout 05e0e4ced7b6ff05f3d68d831efed8bdf588f9ac
    • git switch -c needs-to-be-reloaded-fix
    • git remote add AudricV https://github.com/AudricV/NewPipeExtractor.git
    • git fetch AudricV
    • git cherry-pick cfa985451eb11bbf812fecf57d74d9ed9da0eb3f
    • cd ..
    • append includeBuild("NewPipeExtractor") to settings.gradle
    • replace implementation 'com.github.FireMasterK:NewPipeExtractor:92809cedefd89ce68bc4de8763e9d5f2760f5899' in build.gradle with implementation 'com.github.TeamNewPipe:extractor:v0.24.8'
  • build and deploy piped-backend from source

I tried to find commits from the piped NewPipeExtractor fork, that are needed, but there don't seem to be any critical ones, seems most changes were also upstreamed, but I could have missed something and I cannot guarantee you it is wise to swap out this dependency on your instance.

This is not yet applicable as a Piped contribution, as the commit fixing the issue is not even merged upstream yet, much less included in a NewPipeExtractor release.

Alternative for people without their own instance or an instance, that is not built from source

If you want you can use my instance piped.treffler.cloud (API: pipedapi.treffler.cloud, Proxy: pipedproxy.treffler.cloud) (since my piped-backend fork also required changes in the proxy, you can't use my instance with another proxy instance!). It wasn't really ever meant for public usage, but for this scenario I think it makes sense to allow others to use it and I am very certain the instance can handle additional load.

JonathanTreffler avatar Jan 25 '26 13:01 JonathanTreffler

I fixed this issue on my Piped instance:

How to fix this issue on your own Piped instance

This is not easy if you don't already build your instance from source (for which I cannot give you a step by step because it depends on your deployment method). Mine is, because I use my own small fork, that fixes Piped leaking your servers public IP address.

Basically I substituted the NewPipeExtractor library from the Piped fork with upstream commit cfa985451eb11bbf812fecf57d74d9ed9da0eb3f cherry picked on top of 05e0e4ced7b6ff05f3d68d831efed8bdf588f9ac (I chose that commit, because anything after TeamNewPipe/NewPipe#12706 gave me nothing but trouble, but that is probably not that PRs fault but caused by me barely having used Java in the last few years and my build system knowledge being out of date).

Here is a NON-EXHAUSTIVE outline of the process, that you need to adapt to your deployment:

* In your checked out Piped-Backend source code folder run:
  
  * `git clone https://github.com/TeamNewPipe/NewPipeExtractor.git`
  * `cd NewPipeExtractor`
  * `git checkout 05e0e4ced7b6ff05f3d68d831efed8bdf588f9ac`
  * `git switch -c needs-to-be-reloaded-fix`
  * `git remote add AudricV https://github.com/AudricV/NewPipeExtractor.git`
  * `git fetch AudricV`
  * `git cherry-pick cfa985451eb11bbf812fecf57d74d9ed9da0eb3f`
  * `cd ..`
  * append `includeBuild("NewPipeExtractor")` to settings.gradle
  * replace `implementation 'com.github.FireMasterK:NewPipeExtractor:92809cedefd89ce68bc4de8763e9d5f2760f5899'` in build.gradle with `implementation 'com.github.TeamNewPipe:extractor:v0.24.8'`

* build and deploy piped-backend from source

I tried to find commits from the piped NewPipeExtractor fork, that are needed, but there don't seem to be any critical ones, seems most changes were also upstreamed, but I could have missed something and I cannot guarantee you it is wise to swap out this dependency on your instance.

This is not yet applicable as a Piped contribution, as the commit fixing the issue is not even merged upstream yet, much less included in a NewPipeExtractor release.

Alternative for people without their own instance or an instance, that is not built from source

If you want you can use my instance piped.treffler.cloud (API: pipedapi.treffler.cloud, Proxy: pipedproxy.treffler.cloud) (since my piped-backend fork also required changes in the proxy, you can't use my instance with another proxy instance!). It wasn't really ever meant for public usage, but for this scenario I think it makes sense to allow others to use it and I am very certain the instance can handle additional load.

Thanks a lot for this fix! It works and for anyone interest I rolled this into a docker image here. https://github.com/10203/Piped-Backend-Fixes/pkgs/container/piped-backend-fixes%2Fpiped

EDIT: Forgot to add in, this makes recommendations under videos and comments not appear. I don't care but just a warning.

10203 avatar Jan 26 '26 14:01 10203

The pull request with the fix has been merged to https://github.com/TeamNewPipe/NewPipeExtractor, unsure how the full piper setup is but I assume it has to be updated into PipedBackend?

MatteoAlberghini avatar Jan 27 '26 20:01 MatteoAlberghini

Thanks a lot for this fix! It works and for anyone interest I rolled this into a docker image here. https://github.com/10203/Piped-Backend-Fixes/pkgs/container/piped-backend-fixes%2Fpiped

EDIT: Forgot to add in, this makes recommendations under videos and comments not appear. I don't care but just a warning.

@10203 would you mind building it for "arm64" as well? Would fix this issue for my rasperry pi as well and I'd appreciate it. If I find some time I'll build it myself and share it here.

Weidav avatar Jan 28 '26 21:01 Weidav

Experiencing this issue too. Using the Helm Chart on 8.1.1 (via ArtifactHub).

What's the typical ETA for a merged PR to make it into a release container image? Since this lives within the extractor, which in return is part of the ytproxy and backend, I'd assume that it would take a hot minute...?

Thanks!

IngwiePhoenix avatar Jan 28 '26 21:01 IngwiePhoenix

https://github.com/ac615223s5/Piped-Backend https://hub.docker.com/r/nieveve/piped-backend

ac615223s5 avatar Jan 29 '26 05:01 ac615223s5

https://github.com/ac615223s5/Piped-Backend https://hub.docker.com/r/nieveve/piped-backend

That didn't work for me, it still gives me "The page needs to be reloaded"

andrynhk avatar Jan 29 '26 08:01 andrynhk

It seems like the image is not built for the patch. You can clone and build the repository from @ac615223s5 and it should work like normal (with recommendations and comments included).

git clone https://github.com/ac615223s5/Piped-Backend

cd Piped-Backend

sudo docker build . -t piped-backend-fix

Then replace your current image with piped-backend-fix.

t6fb3m59 avatar Jan 29 '26 10:01 t6fb3m59

    # image: 1337kavin/piped:latest
    build:
      context: https://github.com/ac615223s5/Piped-Backend.git
      dockerfile: Dockerfile

Thanks to @t6fb3m59 I remembered this way to configure the build in the compose file.

Weidav avatar Jan 29 '26 11:01 Weidav

oops I updated it now

It seems like the image is not built for the patch. You can clone and build the repository from @ac615223s5 and it should work like normal (with recommendations and comments included).

git clone https://github.com/ac615223s5/Piped-Backend

cd Piped-Backend

sudo docker build . -t piped-backend-fix

Then replace your current image with piped-backend-fix.

ac615223s5 avatar Jan 29 '26 20:01 ac615223s5

It seems like the image is not built for the patch. You can clone and build the repository from @ac615223s5 and it should work like normal (with recommendations and comments included).

git clone https://github.com/ac615223s5/Piped-Backend

cd Piped-Backend

sudo docker build . -t piped-backend-fix

Then replace your current image with piped-backend-fix.

That just worked for me, much thanks to you @ac615223s5! :)

TaktratenRolli avatar Feb 02 '26 17:02 TaktratenRolli

@ac615223s5 cannot wrap my head around your fix, it boils down to

diff --git a/build.gradle b/build.gradle
index 8be853a3..22d33fbc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,8 +16,8 @@ dependencies {
     implementation 'it.unimi.dsi:fastutil-core:8.5.16'
     implementation 'commons-codec:commons-codec:1.19.0'
     implementation 'org.bouncycastle:bcprov-jdk18on:1.81'
-    implementation 'com.github.FireMasterK:NewPipeExtractor:92809cedefd89ce68bc4de8763e9d5f2760f5899'
-    implementation 'com.github.FireMasterK:nanojson:a507525e549a836c3a8b6ab7090dca38e92942ef'
+    implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.25.1'
+    implementation 'com.github.TeamNewPipe:nanojson:c7a6c1c08d16b6d5ecded34758e6415e07be2166'
     implementation 'com.fasterxml.jackson.core:jackson-core:2.19.2'
     implementation 'com.fasterxml.jackson.core:jackson-annotations:2.19.2'
     implementation 'com.fasterxml.jackson.core:jackson-databind:2.19.2'

By doing that you lose the customization from FireMasterK's fork that, to my understanding, are crucial for Piped, isn't that so?

Fork tree from previously used version: https://github.com/FireMasterK/NewPipeExtractor/commits/92809cedefd89ce68bc4de8763e9d5f2760f5899/, there are 3 relevant patches that are not upstream (?)

orhtej2 avatar Feb 03 '26 10:02 orhtej2

@ac615223s5 cannot wrap my head around your fix, it boils down to

diff --git a/build.gradle b/build.gradle index 8be853a3..22d33fbc 100644 --- a/build.gradle +++ b/build.gradle @@ -16,8 +16,8 @@ dependencies { implementation 'it.unimi.dsi:fastutil-core:8.5.16' implementation 'commons-codec:commons-codec:1.19.0' implementation 'org.bouncycastle:bcprov-jdk18on:1.81'

  • implementation 'com.github.FireMasterK:NewPipeExtractor:92809cedefd89ce68bc4de8763e9d5f2760f5899'
  • implementation 'com.github.FireMasterK:nanojson:a507525e549a836c3a8b6ab7090dca38e92942ef'
  • implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.25.1'
  • implementation 'com.github.TeamNewPipe:nanojson:c7a6c1c08d16b6d5ecded34758e6415e07be2166' implementation 'com.fasterxml.jackson.core:jackson-core:2.19.2' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.19.2' implementation 'com.fasterxml.jackson.core:jackson-databind:2.19.2'

By doing that you lose the customization from FireMasterK's fork that, to my understanding, are crucial for Piped, isn't that so?

Fork tree from previously used version: https://github.com/FireMasterK/NewPipeExtractor/commits/92809cedefd89ce68bc4de8763e9d5f2760f5899/, there are 3 relevant patches that are not upstream (?)

Until they fix the fork the original repo works, unsure what the patches did but I've been running the original exctractor since last week without issues

MatteoAlberghini avatar Feb 03 '26 10:02 MatteoAlberghini

I actually had to apply relevant patches on top of upstream NewPipeExtractor to make it work on my end 🤷

But the idea is sound!

orhtej2 avatar Feb 04 '26 12:02 orhtej2

I've deployed using the official docs: https://docs.piped.video/docs/self-hosting/

For a week having issue with the error. I thought that updates would help but it didn't😢

I can't watch any videos. Stopped watching YouTube vids at all.

What's the fix?

EthicalPrivaSecretarium avatar Feb 09 '26 10:02 EthicalPrivaSecretarium

I've deployed using the official docs: https://docs.piped.video/docs/self-hosting/

For a week having issue with the error. I thought that updates would help but it didn't😢

I can't watch any videos. Stopped watching YouTube vids at all.

What's the fix?

https://github.com/TeamPiped/Piped/issues/4139#issuecomment-3817074926

make this change in your docker compose file and rebuild

MatteoAlberghini avatar Feb 09 '26 11:02 MatteoAlberghini

I've deployed using the official docs: https://docs.piped.video/docs/self-hosting/ For a week having issue with the error. I thought that updates would help but it didn't😢 I can't watch any videos. Stopped watching YouTube vids at all. What's the fix?

#4139 (comment)

make this change in your docker compose file and rebuild

Thanks!

Image

Am I doing it right?

EthicalPrivaSecretarium avatar Feb 09 '26 12:02 EthicalPrivaSecretarium

I've deployed using the official docs: https://docs.piped.video/docs/self-hosting/ For a week having issue with the error. I thought that updates would help but it didn't😢 I can't watch any videos. Stopped watching YouTube vids at all. What's the fix?

#4139 (comment)

make this change in your docker compose file and rebuild

I have the same problem. I'm using the official docker image on a Synology NAS. Tried to build the patched image, but docker said that it requires the BuildKit. I don't know if I can get this for a Synology NAS, I don't have other systems with docker installed.

I received 3 (three) updates for piped-proxy during the last days, but none fixed the "The page needs to be reloaded.". Will there be an official patch?

Oceanwaves avatar Feb 09 '26 20:02 Oceanwaves

I've deployed using the official docs: https://docs.piped.video/docs/self-hosting/ For a week having issue with the error. I thought that updates would help but it didn't😢 I can't watch any videos. Stopped watching YouTube vids at all. What's the fix?

#4139 (comment) make this change in your docker compose file and rebuild

Thanks! Image

Am I doing it right?

I believe so, unsure about the formatting, run docker compose and see if it builds

I've deployed using the official docs: https://docs.piped.video/docs/self-hosting/ For a week having issue with the error. I thought that updates would help but it didn't😢 I can't watch any videos. Stopped watching YouTube vids at all. What's the fix?

#4139 (comment) make this change in your docker compose file and rebuild

I have the same problem. I'm using the official docker image on a Synology NAS. Tried to build the patched image, but docker said that it requires the BuildKit. I don't know if I can get this for a Synology NAS, I don't have other systems with docker installed.

I received 3 (three) updates for piped-proxy during the last days, but none fixed the "The page needs to be reloaded.". Will there be an official patch?

unsure about the official build, but there is also a matrix channel to talk in

depending on how you installed piped you might have to install it differntly, if you installed with docker compose it should work

MatteoAlberghini avatar Feb 09 '26 20:02 MatteoAlberghini

I'm using the docker image from https://github.com/TeamPiped/Piped/issues/4139#issuecomment-3815577745, and there's no need to rebuild. Just pull it or place it in your compose file.

Alifoss avatar Feb 09 '26 20:02 Alifoss