Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtitles aren't downloaded automatically for me. #104

Open
sander1095 opened this issue Apr 27, 2022 · 28 comments
Open

Subtitles aren't downloaded automatically for me. #104

sander1095 opened this issue Apr 27, 2022 · 28 comments

Comments

@sander1095
Copy link

sander1095 commented Apr 27, 2022

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

@MBR-0001
Copy link
Contributor

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)

@sander1095
Copy link
Author

sander1095 commented Apr 28, 2022

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 :)

@MBR-0001
Copy link
Contributor

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)

@sander1095
Copy link
Author

sander1095 commented Apr 30, 2022

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

@MBR-0001
Copy link
Contributor

MBR-0001 commented May 1, 2022

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 😕

@MBR-0001
Copy link
Contributor

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?

@gartner2000
Copy link

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..

@MBR-0001
Copy link
Contributor

MBR-0001 commented Jul 5, 2022

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.

@gartner2000
Copy link

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.

@MBR-0001
Copy link
Contributor

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)

@abienz
Copy link

abienz commented Aug 15, 2022

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?

@MBR-0001
Copy link
Contributor

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

@abienz
Copy link

abienz commented Aug 15, 2022

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.

@rwjack
Copy link

rwjack commented Nov 5, 2022

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

@slickwarren
Copy link

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

@monitor22
Copy link

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

After pressing ok, does it automatically download all subtitles?

@MBR-0001
Copy link
Contributor

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

@rwjack
Copy link

rwjack commented Mar 28, 2023

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.

@slickwarren
Copy link

  • 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.

@Meravici
Copy link

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

@AllegraCodes
Copy link

I had the same problem, I hadn't ticked a language and it just said "Completed after 0 minutes and 0 seconds". Additional logging would be nice.

@tcurdt
Copy link

tcurdt commented Aug 11, 2024

On opensubtitles I can see that files are being downloaded - but they are just not stored for me.
Shouldn't they be just next to the videos likes this?

Screenshot 2024-08-11 at 21 43 25

@MBR-0001
Copy link
Contributor

On opensubtitles I can see that files are being downloaded - but they are just not stored for me. Shouldn't they be just next to the videos likes this?

Screenshot 2024-08-11 at 21 43 25

It should, if it fails (FS permissions?) it stores them in the jellyfin metadata folder

All saving should be logged, successful or not

@tcurdt
Copy link

tcurdt commented Aug 11, 2024

It should, if it fails (FS permissions?) it stores them in the jellyfin metadata folder

Yeah, it's a permission thing and they get stored in find /config/metadata/ -name "*.srt"

Thanks for the pointer!

@tcurdt
Copy link

tcurdt commented Aug 11, 2024

Is there a way to specify auto download only for certain series?

@MBR-0001
Copy link
Contributor

Currently it's library based, that logic is stored in the server so a functionality like that should/could be requested at https://features.jellyfin.org/

@Silverbullet069
Copy link

Silverbullet069 commented Oct 10, 2024

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

Thank youuuu. I've been wondering about why my subtitles aren't being downloaded. It's because I have this setting on. Is it on by default? If yes then I think this is not a really good design.

@MBR-0001
Copy link
Contributor

@Silverbullet069 This option is turned on by default (at least in 10.9), while it might seem like a good idea to have it off by default in this scenario, it also might result in a library with subtitles that don't match audio/video, which, in my opinion, sounds like unwanted behavior, so a double edged sword...

might be worth starting a feature request on https://features.jellyfin.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests