jellyfin / jellyfin-plugin-opensubtitles

https://jellyfin.org
GNU General Public License v3.0
121 stars 26 forks source link

Significant Amount of Upload Bandwidth Used #56

Open AshtenThePlatypus opened 3 years ago

AshtenThePlatypus commented 3 years ago

Hiya!

I installed this plugin this morning onto a fresh install of Jellyfin through the Ubuntu Repository.

I created an account for OpenSubtitles, but coincidentally, the site went down for maintenance at the same time. I entered my account information into the plugin, and figured I'd try it once the maintenance was done. (Not sure if this is relevant.)

A notification from my router popped up about unusual upload. Over the last 13ish hours, there's been 14GBs of data upload to api.opensubtitles.org, starting from when I first entered my OpenSubtitles login information.

In the logs, this error message has been repeated about every 200ms:

[2021-07-03 22:18:34.749 +00:00] [ERR] Error downloading subtitles from "Open Subtitles"
System.Xml.XmlException: The 'hr' start tag on line 6 position 2 does not match the end tag of 'body'. Line 7, position 3.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
   at System.Xml.XmlTextReaderImpl.ParseEndElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at XmlRpcHandler.XmlRpcGenerator.DecodeMethodResponse(String xmlResponse)
   at OpenSubtitlesHandler.OpenSubtitles.LogInAsync(String username, String password, String language, CancellationToken cancellationToken)
   at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.Login(CancellationToken cancellationToken)
   at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)
uranderu commented 3 years ago

It probably keeps retrying and retrying and retrying. OpenSubtitles is switching to a new API that is giving a lot of users a lot of problems (I don't know if this is related though). What is your schedule on "Downloading missing subtitles"?

AshtenThePlatypus commented 3 years ago

That was my thought as well, though, I was unaware of the API change.

I have it set to download missing subtitles every 15 minutes.

uranderu commented 3 years ago

I don't know about your use case but 15 minutes seems like a high interval rate to me. Especially when it has a lot of content that it can't download subtitles for due to the API issues.

AshtenThePlatypus commented 3 years ago

Hmm... My intent was so that it could download subtitles for movies as soon as they appeared on the filesystem, as I tend to watch videos pretty soon after I add them.

That's a good point you bring up, though. I was thinking it was retrying the same file repeatedly, but if it's working through the whole library, failing, and then trying again 15 minutes later, that would make a lot more sense.

uranderu commented 3 years ago

I don't know if this is possible, but maybe you can set it that it scans for subtitles every time a new entry is added to a library? Jellyfin does have support for scanning libraries when a new file is detected (on certain filesystems).

AshtenThePlatypus commented 3 years ago

Ah! I saw that option, but didn't realize it applied to all actions involving the library. I just thought it would import the movie into the library and then wait for the scheduled tasks to trigger for subtitles.