ankenyr / jellyfin-youtube-metadata-plugin

Youtube Metadata Plugin for Jellyfin
GNU Affero General Public License v3.0
518 stars 33 forks source link

Endlessly repeated requests lead to resource exhaustion #113

Open APT37 opened 1 month ago

APT37 commented 1 month ago

Hi, I've been using this plugin for a long time and this is the first time I've encountered a problem with it. Thank you for the great work.

Observation

DNS statistics ![download](https://github.com/user-attachments/assets/a73133a7-ac58-4e5e-8ea6-7970b1b9f574)

Jellyfin's logs show that the plugin tried to refresh the metadata every 3 minutes, but that's all there is. The plugin's scheduled task uses the default 24h setting, real time monitoring is enabled though. I did not add or delete any files in the library while this was going on.

Jellyfin's Log (relevant entries only) ``` [2024-09-15 03:22:03.172 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:25:02.772 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:28:03.452 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:31:02.880 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:34:03.411 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:37:03.024 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:40:02.689 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:43:03.404 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:46:02.846 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:49:03.612 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:52:03.246 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:55:02.924 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 03:58:02.492 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:01:02.938 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:04:03.489 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:07:03.025 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:10:02.795 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:13:03.494 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:16:03.199 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:19:03.118 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:22:03.272 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:25:02.855 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:28:03.613 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:31:44.639 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:34:02.778 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:37:03.428 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:40:03.057 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:43:02.707 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:46:03.178 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:49:02.864 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:52:03.443 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:55:02.979 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. [2024-09-15 04:58:02.664 +02:00] [INF] "youtube" ("/mnt/jellyfin/youtube") will be refreshed. ```

Assumption

What I think happened is that my server's IP got banned from YouTube temporarily, which the plugin didn't handle properly, therefore it tries to fetch the metadata endlessly. This uses up all the RAM of the system for some reason, maybe because of an error in the plugin or Jellyfin itself, maybe because of C#'s garbage collection algorithm... I can't say. Maybe it's yt-dlp and not the plugin or Jellyfin; which I think is less likely, though.

Conclusion

It really is a shot in the dark, I apologize for not being able to provide more evidence of what might've caused the problem.

Thank you for your time and have a nice day.

ankenyr commented 1 month ago

Might be that your location in Pyongyang is blocked by Youtube. Not sure how I feel about helping the DPRK enjoy their Youtube videos....but then again, I don't want to get hacked. /s

If this is still going on can you enable debug logging and grab the logs?

APT37 commented 1 month ago

Might be that your location in Pyongyang is blocked by Youtube.

Since we receive the death penalty for using ad-blockers, it's unlikely that the dirty capitalists at YouTube would block us permanently.

Not sure how I feel about helping the DPRK enjoy their Youtube videos....but then again, I don't want to get hacked. /s

:fortune_cookie: Wise choice, you filthy american pig. :fortune_cookie:

If this is still going on can you enable debug logging and grab the logs?

For better or worse, it didn't happen since. I'll enable debug logging and wait for the next crash.

Thank you for your time and have a nice day!

ankenyr commented 1 month ago

Just remember your plugin is "Made in 🇺🇸America🇺🇸" Fuck yea