Piped icon indicating copy to clipboard operation
Piped copied to clipboard

Error `IOS player response is not valid`

Open acidghost opened this issue 10 months ago • 87 comments

Official Instance

Describe the bug

New occurrence of #3954.

This was recently fixed (again) upstream: https://github.com/TeamNewPipe/NewPipeExtractor/pull/1272.

I think Piped just needs to bump its dependency.

To Reproduce

This is a flaky bug (not reproducible reliably).

  1. Open any video
  2. See the error

Expected behavior

Video player shows up

Logs/Errors

No response

Browser, and OS with Version.

FireFox 134.0.2, macOS 15

Additional context

No response

acidghost avatar Feb 11 '25 07:02 acidghost

I'm also running into this, almost nearly constantly. I have to refresh the page a good 8-15 times before it'll finally actually play.

Needless to say, this is making my piped instance effectively useless and is a high priority show-stopper imo.

ilar avatar Feb 13 '25 01:02 ilar

Same here, piped, and on android libretube configured to use my own instance is nearly unusable.

Meriemi-git avatar Feb 13 '25 16:02 Meriemi-git

I understand this is free software maintained by volunteers and of course there is no SLA(!) but can the maintainers please ask for whatever they need to get this fixed. Money too. Thanks.

jamesdrake101 avatar Feb 13 '25 16:02 jamesdrake101

This has been fixed in https://github.com/TeamNewPipe/NewPipeExtractor/releases/tag/v0.24.5 , so the fix would be (once again) to update the dependency and rebuild the docker image.

arjanvlek avatar Feb 15 '25 14:02 arjanvlek

So is the only way to use Piped as of right now only within a Docker container? Cause I'm using Firefox.

Metabot24 avatar Feb 16 '25 00:02 Metabot24

I don't think the docker container deployment is working with this either- mine isn't at least.

ilar avatar Feb 16 '25 04:02 ilar

You should host the docker image for https://github.com/TeamPiped/bg-helper-server (1337kavin/bg-helper-server:latest) and set BG_HELPER_URL in config.properties to point to your bg helper server url.

Bnyro avatar Feb 16 '25 19:02 Bnyro

You should host the docker image for https://github.com/TeamPiped/bg-helper-server (1337kavin/bg-helper-server:latest) and set BG_HELPER_URL in config.properties to point to your bg helper server url.

@Bnyro Thank you for the fix, just deployed it on my private instance and it works great. I only have one issue: LibreTube has stopped working. Once i click on a Video i get the Message "Source Error". This could however be a Configuration-Issue on my side.

LibreTube log _ source 1006de6d5012.txt

I attached some logs.

Should i open a new issue in the LibreTube-Repo?

WreckingBANG avatar Feb 16 '25 21:02 WreckingBANG

For the nubs like me that stumbled into this to fix the ios error:

Add to docker-compose.yml:

    bg-helper:
        image: 1337kavin/bg-helper-server:latest
        restart: unless-stopped
        container_name: piped-bg-helper
        labels:
            - "com.centurylinklabs.watchtower.enable=true"

add somewhere in /config/config.properties:

#PO Tokens supplier
BG_HELPER_URL:http://piped-bg-helper:3000

Do a docker-compose pull and docker-compose restart to pull the new container and restart the stack.

Videos seem to work after this.

ikidd avatar Feb 16 '25 22:02 ikidd

@ikidd Does LibreTube work for you?

WreckingBANG avatar Feb 16 '25 22:02 WreckingBANG

@ikidd Does LibreTube work for you?

I don't use Libretube but I downloaded it from Fdroid to test for you. No, it only works if I disable piped-proxy in the server settings. If I don't, Libretube either fails to play the video with a "network error" or it just closes and when I reopen it I get:

org.jsoup.SerializationException: lateinit property streams has not been initialized
at com.github.libretube.ui.fragments.PlayerFragment.access$initializeHighlight(SourceFile:200)
at com.github.libretube.ui.fragments.PlayerFragment$onViewCreated$2$2$1.invokeSuspend(SourceFile:31)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
at kotlinx.coroutines.DispatchedTask.run(SourceFile:113)
at androidx.work.impl.WorkerWrapper$1.run(SourceFile:15)
at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:96)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@8de51fe, Dispatchers.IO]

ikidd avatar Feb 16 '25 22:02 ikidd

@Bnyro Thank you for the fix, just deployed it on my private instance and it works great. I only have one issue: LibreTube has stopped working. Once i click on a Video i get the Message "Source Error". This could however be a Configuration-Issue on my side.

That's the same for all instances unfortunately, I haven't yet figured out what the exact cause is :/

Bnyro avatar Feb 16 '25 22:02 Bnyro

I found the request sending to BG Helper is going through the specified REQWEST_PROXY and went into a timeout if I set an external socks5.

raycheung avatar Feb 17 '25 01:02 raycheung

BG_HELPER_URL:http://piped-bg-helper:3000

Thank you!

~~i tried this, thinking maybe i should swap piped-bg-helper to either my domain or the LAN ip, neither worked, but using literally just http://piped-bg-helper:3000 (copy-pasted exactly that) worked, could someone please explain why http://piped-bg-helper:3000 is being used here, how does the docker know which ip is http://piped-bg-helper?~~

swapping piped-bg-helper to docker's LAN ip (192.168.x.x) worked. I just gotta stop the container, prune all (docker prune -a), then run the docker-compose again.

Update: as I was trying pruning/pulling and restarting the dockers, using just http://piped-bg-helper:3000 now also worked.

Thanks a lot!

R8s6 avatar Feb 18 '25 00:02 R8s6

You should host the docker image for https://github.com/TeamPiped/bg-helper-server (1337kavin/bg-helper-server:latest) and set BG_HELPER_URL in config.properties to point to your bg helper server url.

This works, thanks. I would be interested in having even just a superficial understanding of what this bg-helper-server does, where can I read about it? Also, why isn't the relevant docker-compose.yml block included as part of your Piped-Docker repo (which I am tracking)?

jamesdrake101 avatar Feb 18 '25 00:02 jamesdrake101

Can confirm it's working using the bg-helper-server. @jamesdrake101 looking through the code it uses https://github.com/LuanRT/BgUtils to 'generate PO Tokens', which seems to be needed to bypass youtubes anti-bot-check.

Offtopic @R8s6:

[...] could someone please explain why http://piped-bg-helper:3000 is being used here, how does the docker know which ip is http://piped-bg-helper?

it's the service 'name' (the yaml key of the service you are defining). all containers defined in this docker-compose will know each other by the name of the service, that's why it works. (i'm not 100% sure if the container_name works as well or if it even replaces the other name)

darookee avatar Feb 18 '25 08:02 darookee

This works, thanks. I would be interested in having even just a superficial understanding of what this bg-helper-server does, where can I read about it? Also, why isn't the relevant docker-compose.yml block included as part of your Piped-Docker repo (which I am tracking)?

It's basically an API wrapper around https://github.com/LuanRT/BgUtils, you should read their README.

It should probably be added to the Docker repo as well, it's however still in an early stage and not tested much, so it was still considered "experimental" and thus not added yet. PRs adding it to the Docker repo or documentation would be welcome.

Bnyro avatar Feb 18 '25 08:02 Bnyro

For the nubs like me that stumbled into this to fix the ios error:

Add to docker-compose.yml:

    bg-helper:
        image: 1337kavin/bg-helper-server:latest
        restart: unless-stopped
        container_name: piped-bg-helper
        labels:
            - "com.centurylinklabs.watchtower.enable=true"

add somewhere in /config/config.properties:

#PO Tokens supplier
BG_HELPER_URL:http://piped-bg-helper:3000

Do a docker-compose pull and docker-compose restart to pull the new container and restart the stack.

Videos seem to work after this.

I added this to my setup, the extra service in the docker-compose.yml, and the line in config/config.properties, but I'm still seeing IOS player response is not valid at more or less the same frequency as before.

My full docker compose: https://gist.github.com/abjugard/8f40d150e5a58d9c4820f36d9cc1de03

Am I missing something? Do I need a different version of the backend service or something?

abjugard avatar Feb 18 '25 14:02 abjugard

This works, thanks. I would be interested in having even just a superficial understanding of what this bg-helper-server does, where can I read about it? Also, why isn't the relevant docker-compose.yml block included as part of your Piped-Docker repo (which I am tracking)?

It's basically an API wrapper around https://github.com/LuanRT/BgUtils, you should read their README.

It should probably be added to the Docker repo as well, it's however still in an early stage and not tested much, so it was still considered "experimental" and thus not added yet. PRs adding it to the Docker repo or documentation would be welcome.

Thanks.

Anyway, I declared victory way too early. After adding the bg-helper-server, my mobile clients (notably Yattee) simply refuse to play any video with a generic error message.

EDIT: I found what the problem is with Yattee. After adding the bg-helper-server, the video manifests do not include streams that are compatible with AVPlayer. Yattee has to resort to MPV player, which is and has always been 100.00% broken for me. Not anybody's fault, but sadly YouTube Premium is winning.

jamesdrake101 avatar Feb 18 '25 14:02 jamesdrake101

After adding the bg-helper-server, my mobile clients (notably Yattee) simply refuse to play any video with a generic error message.

The same problem happens with LibreTube unfortunately.

Bnyro avatar Feb 18 '25 16:02 Bnyro

When not using bg-helper I get the "IOS player response is not valid" error most of the time, only fixed by refreshing many times, but then when the video page loads the video always plays perfectly.

When using bg-helper the video pages load instantly first try, but the video never plays and the player shows error 1001 (I think this is caused by a 403 return code of the pipedproxy)

(this is all in the web interface, but I assume it behaves similarly in LibreTube)

JonathanTreffler avatar Feb 18 '25 16:02 JonathanTreffler

Using the bg-helper I get no real changes, myself.

ilar avatar Feb 19 '25 00:02 ilar

Using the bg-helper I get no real changes, myself.

Then you'll need to get an other IP.

Bnyro avatar Feb 19 '25 08:02 Bnyro

With br-helper I have errors "network error" on libretube, on browser works ok while playing video. Without br-helper I have only IOS player response is not valid, Some videos randomly playing.

create issue on libretube

agevlakh avatar Feb 19 '25 12:02 agevlakh

If someone wants me to open my (working) bg-helper service temporarily for testing, please contact me and I'll work with you in DM to give you access for troubleshooting your end and see if it's an IP issue.

ikidd avatar Feb 19 '25 16:02 ikidd

Am I missing something? Do I need a different version of the backend service or something?

yours appears to be correct, please try this:

# stop the containers
docker-compose -f docker-compose.yml down

# pull new images
docker-compose pull

# or, remove old images
docker image prune -a

# restart the containers
docker-compose up -d

for me, this works for desktop browsers, not so much for my iOS yattee app

R8s6 avatar Feb 19 '25 18:02 R8s6

EDIT: I found what the problem is with Yattee. After adding the bg-helper-server, the video manifests do not include streams that are compatible with AVPlayer. Yattee has to resort to MPV player, which is and has always been 100.00% broken for me. Not anybody's fault, but sadly YouTube Premium is winning.

Can confirm. For me, AVPLayer doesn't play at all. MPV player plays initially, but for every video, it abruptly and seemingly randomly becomes silent halfway during playback.

I opened a ticket with Yattee here: https://github.com/yattee/yattee/issues/859

R8s6 avatar Feb 19 '25 19:02 R8s6

It seems that if one uses REQWEST_PROXY combined with BG_HELPER_URL it will not be able to talk to the helper. :(

(Kubernetes, running in the same pod)

samip5 avatar Feb 22 '25 14:02 samip5

I found the request sending to BG Helper is going through the specified REQWEST_PROXY and went into a timeout if I set an external socks5.

@samip5 Yes, I tried as well and checked the code. The request sending to BG Helper would also go through the REQWEST_PROXY.

raycheung avatar Feb 22 '25 15:02 raycheung

It seems that if one uses REQWEST_PROXY combined with BG_HELPER_URL it will not be able to talk to the helper. :(

Well, you can just assign the bg helper container a public port and set BG_HELPER_URL to the public address...

Since PO tokens are IP bound, using the bg helper API (probably) won't be useful to other people, so exposing it publicly should be okay I think.

Bnyro avatar Feb 22 '25 16:02 Bnyro