ViewTube / viewtube

▶️ ViewTube: The open source, privacy-conscious way to enjoy your favorite YouTube content. Docs: https://viewtube.wiki, Status: https://uptime.viewtube.io
https://viewtube.io
GNU Affero General Public License v3.0
1.33k stars 77 forks source link

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

Open Klar opened 5 months ago

Klar commented 5 months ago

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/youtubei.js@10.0.0/node_modules/youtubei.js/bundle/node.cjs:1783:11)\n    at VideoInfo.<anonymous> (/home/app/node_modules/.pnpm/youtubei.js@10.0.0/node_modules/youtubei.js/bundle/node.cjs:13761:34)\n    at Generator.next (<anonymous>)\n    at /home/app/node_modules/.pnpm/tslib@2.6.3/node_modules/tslib/tslib.js:169:75\n    at new Promise (<anonymous>)\n    at __awaiter (/home/app/node_modules/.pnpm/tslib@2.6.3/node_modules/tslib/tslib.js:165:16)\n    at VideoInfo.toDash (/home/app/node_modules/.pnpm/youtubei.js@10.0.0/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)
moisout commented 5 months ago

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

Klar commented 5 months ago

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

ang3lo-azevedo commented 5 months ago

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')"

moisout commented 5 months ago

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 commented 5 months ago

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

Klar commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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)

moisout commented 5 months ago

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

FriedrichM commented 5 months ago

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 commented 5 months ago

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

Klar commented 5 months ago

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 commented 4 months ago

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

FriedrichM commented 4 months ago

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

moisout commented 4 months ago

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\:password@proxy.example.com:8555]()"

FriedrichM commented 4 months ago

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

Klar commented 4 months ago

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

mycodedoesnotcompile2 commented 2 months ago

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