jellyfin / jellyfin-plugin-opensubtitles

Home Page:https://jellyfin.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subtitles aren't downloaded automatically for me.

sander1095 opened this issue · comments

Hello!

I have set up my plugin, but it doesn't seem to work.

I can run the scheduled task to download missing subtitles, but nothing happens. The OS API overview also says no downloads occurred.
WHen I go to the show I downloaded (Which is identified by Jellyfin correctly), the subtitles show "off". When I click on edit -> find subtitles, some do appear.. but this is only after I messed around with the plugin, created an new API consumer, connected it to my plugin, deleted the plugin, reinstalled the plugin and reconfigured it..

I am still expecting it to automatically download subtitles, though..

Could anyone help me out? Or point me in the direction of the logs? I am running jellyfin on a raspberry pi 3b+

image
image

The easiest way to approach this would be to check the logs, you can find them in the "Logs" section of the "Advanced" category in the server administration page (should be just above plugins & scheduled tasks). Look for lines containing opensubtitles, if there are exceptions (errors) please report them here so I can look into it :)

Another thing worth checking is whether the Only download subtitles that are a perfect match for my video files option is turned on in the settings of your libraries, if that option is turned on the plugin will only download subtitles that match your files perfectly (subtitles made for that exact version of the movie/episode, it does that by computing a hash of the file)

Hello, thanks for your quick reply!

Only download subtitles that are a perfect match for my video files

I turned this off, let's see how that goes over time.

The easiest way to approach this would be to check the logs

Good point 🤦‍♂️.

I just checked... but there are none there. They should be stored in /var/logs/jellyfin, but that folder is empty. 😕
I do use log2ram and then wrote log2ram write, but there are still none appearing.

I ran the following to get some logs anyway, but nothing shows up about opensubtitles...

journalctl --identifier jellyfin -f

Apr 28 18:26:56 raspberrypi jellyfin[4159]: [18:26:56] [INF] Executing Download missing subtitles
Apr 28 18:26:56 raspberrypi jellyfin[4159]: [18:26:56] [INF] Download missing subtitles Completed after 0 minute(s) and 0 seconds
Apr 28 18:26:56 raspberrypi jellyfin[4159]: [18:26:56] [INF] ExecuteQueuedTasks
Apr 28 18:32:30 raspberrypi jellyfin[4159]: [18:32:30] [INF] Executing Download missing subtitles
Apr 28 18:32:30 raspberrypi jellyfin[4159]: [18:32:30] [WRN] Slow HTTP Response from https://XXXXXXXXXX/ScheduledTasks/Running/2c66a88bca43e565d7f8099f825478f1 to 84.83.54.235 in 0:00:01.0701074 with Status Code 204

Thanks again, I am curious for your reply.

If you know a way to make (more) logs magically appear, I'd love to know! I am pretty new to linux :)

The Download missing subtitles task ended quite quickly (Completed after 0 minute(s) and 0 seconds), how many items do you have in your library and which version of jellyfin and the plugin are you using?

As for logs, I am not sure why they would be missing, for me they are found in /var/lib/jellyfin/log/ but they should also be listed in the Logs section in the dashboard - clicking on an entry should open the full log in a new tab.

I also suggest enabling debug logging, running the subtitle download task and then checking the logs (or running journalctl -u jellyfin -f)

Running tree . | tail -1 in my media folder reports 1716 files, possibly some being subtitle files and stuff.

I use Jellyfin version 10.7.7 and OpenSubtitles 12.0.0.0.

Going to the logs section in the dsahboard results in an empty screen; the JSON response also only returns an empty array.

I will try the debug logging as well. I am posting this comment now because my laptop is almost out of battery; I will edit with debug logging results!

Update:

Well, even after changing the logging levels, I don't see any changes in the log levels from journalctl... I tried restarting the service multiple times.. It's a bit difficult to find out what is going wrong here, lol.

Anyway, When I download subitltes manaully, I do see this in the logs, so the plugin is at least functioning:

Apr 30 17:52:18 raspberrypi jellyfin[3664]: [17:52:18] [INF] Remaining downloads: 17
Apr 30 17:52:18 raspberrypi jellyfin[3664]: [17:52:18] [INF] Saving subtitles to /mnt/usb_hdd/media/series/Friends (1994) [tmdbid-1668]/Season 04/Friends.S04E04.1080p.Bluray.5.1.x265-LION[UTR].eng.srt

Yeah it seems like the plugin is working correctly 🤔

One way to check if debug logging is properly enabled is to do manual subtitle searches and look for lines like

[00:53:16] [DBG] [31] Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader: Search query: {"languages": "en", "moviehash": "8f3c49659fa2e081", "type": "movie", "query": "redacted", "imdb_id": "424600"}

If they don't appear something is not correctly configured 😕

Jellyfin 10.8 is now out, which means the plugin can now be updated to the latest version, can you check if this is still happening?

Hi
I did notice recently that my plugin stopped working in the late of May.
I use JF 10.8.1 and plugin version 18. When I put in my username, passwd and api key. I got OK, I can download 20 in a day.

But it failed somehow. Cant find anything in logs, beside this:
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitlesHandler.OpenSubtitlesRequestHelper.SendRequestAsync(String url, HttpMethod method, Object body, Dictionary2 headers, CancellationToken cancellationToken) at Jellyfin.Plugin.OpenSubtitles.OpenSubtitlesHandler.RequestHandler.SendRequestAsync(String endpoint, HttpMethod method, Object body, Dictionary2 headers, String apiKey, Int32 attempt, CancellationToken cancellationToken)
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitlesHandler.OpenSubtitles.SearchSubtitlesAsync(Dictionary`2 options, String apiKey, CancellationToken cancellationToken)
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
at MediaBrowser.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)

And on opensubtiltes's site, i can see that 0/20 subtitles is downloaded..

Hi
I did notice recently that my plugin stopped working in the late of May.
I use JF 10.8.1 and plugin version 18. When I put in my username, passwd and api key. I got OK, I can download 20 in a day.

But it failed somehow. Cant find anything in logs, beside this:
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitlesHandler.OpenSubtitlesRequestHelper.SendRequestAsync(String url, HttpMethod method, Object body, Dictionary2 headers, CancellationToken cancellationToken) at Jellyfin.Plugin.OpenSubtitles.OpenSubtitlesHandler.RequestHandler.SendRequestAsync(String endpoint, HttpMethod method, Object body, Dictionary2 headers, String apiKey, Int32 attempt, CancellationToken cancellationToken)
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitlesHandler.OpenSubtitles.SearchSubtitlesAsync(Dictionary`2 options, String apiKey, CancellationToken cancellationToken)
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
at MediaBrowser.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)

And on opensubtiltes's site, i can see that 0/20 subtitles is downloaded..

The error message is incomplete unfortunately, it's missing the most important part :/

Can you try to obtain more logs? You can manually download a subtitle through the web UI which should produce an error if something is broken.

Might be worth saying that opensubtitles had some issues a few days ago, I too noticed some error messages in my logs but those are expected.

No more logs than that from a scheduled task was showing...

But I tried a manual search.. it worked.
[2022-07-16 11:19:10.101 -07:00] [INF] [259] Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader: Remaining downloads: 99
[2022-07-16 11:19:10.490 -07:00] [INF] [49] MediaBrowser.Providers.Subtitles.SubtitleManager: Saving subtitles to "/data/movies/Trainspotting 1996/Trainspotting 1996 BluRay x264 720p AC3 - NTR.nor.srt"
[2022-07-16 11:19:10.493 -07:00] [WRN] [84] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "https:/xxxxx/Items/503c3e1e2cefcf39464a39c541f5d8f9/RemoteSearch/Subtitles/e02a34f56233e3e5e7765144ca8f184f_srt-nor-202417" to "xx.xxxxxx.xxx" in 0:00:02.6507303 with Status Code 204

But when a scheduled is running, it scans, but find nothing to download.

If manual searching and downloading worked then that error must've been caused by an API outage (those happen every once in a while and there's nothing that can be done about it)

As for subtitles not being downloaded, the simple explanation could be that there are no subtitles available for your files (very likely if you have perfect match enabled)

I've also found this to be a problem, by investigation shows very little in the way of logs, and I never get results when I search manually, which led me to believe that it was a file-naming issue.

I decided to check the meta data, as in the Discord chat a long time ago someone mentioned that this was used for the searches, everything looked good, but one thing that was missing was the imdb id field, I decided to add that manually by searching for my shows on imdb and copy-pasting from the URL, and then try searching for subtitles again.

Tested on two shows from the same series and another from a different series, and when I manually search I get good results almost instantly!

Is there a way to populate the imdb id in the meta-data automatically, either from Sonarr/Radarr or Jellyfin?

Can this plugin work without that ID?

When the IMDb id is missing the filename is sent to the opensubtitles API, searching by filename is obviously not accurate which results in none or poor results :/

As for populating the IMDb id automatically, this should work out of box on any jellyfin installation, you just have to enable it in library settings under metadata downloaders

Right that makes sense as my episodes have been renamed by sonarr to follow the Show/Season/EpisodeName convention, maybe I should make it match the Jellyfin convention a little more closely.

Strange that it always came back with no results though.

I checked my settings and I found that I do have metadata scraping enabled, but not for episode level, so I've enabled it now and will see if that works.

Another thing worth checking is whether the Only download subtitles that are a perfect match for my video files option is turned on in the settings of your libraries

Well, those were an intense couple of hours I just wasted on debugging something that actually worked

Just want to summarize this for anyone else who runs into this problem:

  • ensure you have the opensubtitle plugin installed and authenticated/logged in
  • navigate to your administrator dashboard -> libraries
  • select the library containing the media you wish to bulk download subtitles for

Screen Shot 2023-01-05 at 10 22 09 AM

  • scroll down to the opensubtitles section, select your language(s) and modify the perfect match option to fit your preferences
    Screen Shot 2023-01-05 at 10 22 43 AM
  • select the library containing the media you wish to bulk download subtitles for

After pressing ok, does it automatically download all subtitles?

I don't think so, I believe you have to run the "Download missing subtitles" task for it to start

commented

Also, if you have too much missing subs, it is supposed to choke up, if you don't have the open subtitles premium api subscription.

  • select the library containing the media you wish to bulk download subtitles for

After pressing ok, does it automatically download all subtitles?

not immediately, but it should queue and run as part of the scheduled task. You can also manually trigger it as mentioned above.

I had the same issue Completed after 0 minute(s) and 0 seconds.

In my case, the problem turned out to be that I did not have subtitle download language specified in the library settings
image

After ticking English and starting Download missing subtitles it started working