viewtube icon indicating copy to clipboard operation
viewtube copied to clipboard

Error loading video - [GET] "/api/videos/aqz-KE-bpKQ": 500 Internal Server Error

Open Klar opened this issue 1 year ago • 18 comments

Describe the Bug

every video gets the following error:

Error loading video - [GET] "/api/videos/aqz-KE-bpKQ": 500 Internal Server Error

Steps to Reproduce the Bug

  1. search video
  2. click on video
  3. error message

Expected Behaviour

playing video

Device Info

Running 0.16.2, tried on different browsers / devices.

Not sure if it has to do with the setting "Rewrite YouTube Urls"

I get another error when setting it off:

Cannot read properties of undefined (reading 'replace')

Setting off and site refresh (F5):

Cannot read properties of undefined (reading 'name')

viewtube docker log:

[ViewTube] 1      - 6/16/2024, 1:49:33 PM   ERROR [ExceptionsHandler] Streaming data not available - {"stack":["Error: Streaming data not available\n    at Object.toDash (/home/app/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:1783:11)\n    at VideoInfo.<anonymous> (/home/app/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:13761:34)\n    at Generator.next (<anonymous>)\n    at /home/app/node_modules/.pnpm/[email protected]/node_modules/tslib/tslib.js:169:75\n    at new Promise (<anonymous>)\n    at __awaiter (/home/app/node_modules/.pnpm/[email protected]/node_modules/tslib/tslib.js:165:16)\n    at VideoInfo.toDash (/home/app/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/bundle/node.cjs:13751:41)\n    at VideosService.getById (/home/app/server/dist/core/videos/videos.service.js:76:48)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"]}
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'name')
  at authorToName (./client/.output/server/chunks/build/watch-CtRmNfCQ.mjs:1177:32)  
  at ./client/.output/server/chunks/build/watch-CtRmNfCQ.mjs:1185:43  
  at ReactiveEffect.fn (./client/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:933:13)  
  at ReactiveEffect.run (./client/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:166:19)  
  at get value [as value] (./client/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:945:109)  
  at unref (./client/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1044:29)  
  at ./client/.output/server/chunks/build/watch-CtRmNfCQ.mjs:1209:16  
  at renderComponentSubTree (./client/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js:430:9)  
  at ./client/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js:372:25  
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Klar avatar Jun 16 '24 13:06 Klar

Can you try the dev image? It has a fix for the streaming data thing.

moisout avatar Jun 16 '24 14:06 moisout

it seems to be a bit better (loads comments and video info) but the player is not working / loading.

2024-06-16_16-47 2024-06-16_16-48

Klar avatar Jun 16 '24 14:06 Klar

I'm having the same issue everyday on the official instance, the website works for awhile and then I start to the the error "500 Cannot read properties of undefined (reading 'name')"

ang3lo-azevedo avatar Jun 19 '24 11:06 ang3lo-azevedo

I'm having the same issue everyday on the official instance, the website works for awhile and then I start to the the error "500 Cannot read properties of undefined (reading 'name')"

This is because of IP rate limiting by google

moisout avatar Jun 23 '24 01:06 moisout

@Klar I have updated the dev image with better error handling. Could you try it again with the latest image?

moisout avatar Jun 23 '24 01:06 moisout

Thanks for updating.

Sign in to confirm you’re not a bot - This helps protect our community. Learn more

I'm gonna try the Youtube Cookie Method to see if this fixes it.

https://viewtube.wiki/configuration/advanced/#youtube-cookie

Klar avatar Jun 23 '24 10:06 Klar

I tried it like

    environment:
      - VIEWTUBE_DATABASE_HOST=viewtube-mongodb
      - VIEWTUBE_REDIS_HOST=viewtube-redis
      - VIEWTUBE_YOUTUBE_COOKIE="SOCS.... ; PREF=tz= ...."

but still get the samer error message, do I need to make the cookie from the same ip address?

Klar avatar Jun 23 '24 18:06 Klar

I still get the error "Sign in to confirm you’re not a bot - This helps protect our community. Learn more"

it seems the error message is somehow not correct or my environment variable for youtube cookie is not working. Any way to debug this a bit better? (I don't see the youtube cookie message in my docker logs)

Klar avatar Jun 26 '24 20:06 Klar

I think that's a new thing YouTube is doing. It just means they don't trust your IP. You could use a proxy, or run ViewTube through a VPN. Or switch your IP address, but that might not be that easy. I will update if i figure out anything

moisout avatar Jun 27 '24 21:06 moisout

Are you using a reverse proxy like nginx i have tried it with and without that and its working only without nginx, maybe its the encryption thats getting added

FriedrichM avatar Jul 05 '24 07:07 FriedrichM

ok maybe its not that now its not working with or without the proxy again

FriedrichM avatar Jul 05 '24 07:07 FriedrichM

I am using haproxy. I haven't changed the setup, only updated the dockerfile version.

I will test the same setup on another server (IP) and let you know if it works.

Klar avatar Jul 05 '24 08:07 Klar

new IP / Server same error (Sign in to confirm you’re not a bot - This helps protect our community. Learn more)

Klar avatar Jul 06 '24 17:07 Klar

i got it working on my home machine what kind of proxy do i need to use to test from my remote server with VIEWTUBE_PROXY_URL? http https socks ? do is put the url like this myproxurl:port or like this http://myproxurl:port

FriedrichM avatar Jul 08 '24 11:07 FriedrichM

i got it working on my home machine what kind of proxy do i need to use to test from my remote server with VIEWTUBE_PROXY_URL? http https socks ? do is put the url like this myproxurl:port or like this http://myproxurl:port

It supports http, https and socks proxies.

For example: VIEWTUBE_PROXY_URL="https://proxy.example.com:8555" With authentication: VIEWTUBE_PROXY_URL="socks://username:[email protected]:8555"

moisout avatar Jul 08 '24 13:07 moisout

i got it working for a brief time using a socksproxy to my home network but now its not working again. it loads the thumbnail which it didnt before and the result form api/videos/id looks much more complete but the loading animation wont stop and the play button is not showing even on viewtube.io

FriedrichM avatar Jul 10 '24 14:07 FriedrichM

FYI: https://github.com/yt-dlp/yt-dlp/issues/10128

Klar avatar Jul 14 '24 05:07 Klar

https://github.com/TeamPiped/Piped/issues/3658#issuecomment-2367959839

mycodedoesnotcompile2 avatar Sep 23 '24 11:09 mycodedoesnotcompile2