morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.68k stars 210 forks source link

Embedded Subtitles transform ass to srt #2514

Open MiguelAngelLV opened 1 month ago

MiguelAngelLV commented 1 month ago

Describe the bug When Bazarr extracts an ass subtitle from mkv, the file is converted to .srt (not only the extension, complete conversion).

I have selected "use original format" and the problem persists.

To Reproduce Steps to reproduce the behavior:

  1. Enable Embedded Provider
  2. Enable "User original format"
  3. "Download" an ass subtitle from a mkv

Expected behavior Get an .ass subtitle

Screenshots

image

image

image

image

Software (please complete the following information):

Additional context Add any other context about the problem here.

hnorgaar commented 1 month ago

Both your Sonarr and Radarr version is years old, so please update

MiguelAngelLV commented 1 month ago

Updated the Sonarr and Radarr version in the issue description, although I actually use bazarr manually normally.

hnorgaar commented 1 month ago

If you any post scripts as sync, that might change your format or Sub-Zero Modifications

MiguelAngelLV commented 1 month ago

I don't have any post process:

image

morpheus65535 commented 2 weeks ago

@vitiko98 Could you take a moment to check this one please?

vitiko98 commented 2 weeks ago

I will need some debug logs from your part. This is probably caused by a fallback command from ffmpeg's adapter.

This is a test over a normal container with ASS subtitles, and the Subtitle interface is getting the respective format:

image

MiguelAngelLV commented 2 weeks ago
2024-06-18 10:39:59|INFO    |subliminal_patch.core_persistent|Downloading subtitle <EmbeddedSubtitle: [Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].es.ass [<Language: alpha3=spa>]> with score 360|
2024-06-18 10:39:59|INFO    |subliminal_patch.core           |Downloading subtitle <EmbeddedSubtitle: [Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].es.ass [<Language: alpha3=spa>]>|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: english|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Found extra language ('por', 'BR')|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: portuguese(brazil)|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Found extra language ('spa', 'MX')|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: spanish(latin_america)|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: spanish|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: french|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: german|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: italian|
2024-06-18 10:39:59|DEBUG   |fese.tags                       |Detected tags class: <class 'fese.tags.FFprobeMkvSubtitleTags'>|
2024-06-18 10:39:59|DEBUG   |fese.disposition                |Generic disposition title found: russian|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Found subtitle streams: [<ASS: FFprobeMkvSubtitleTags: en@GENERIC>, <ASS: FFprobeMkvSubtitleTags: pt-BR@GENERIC>, <ASS: FFprobeMkvSubtitleTags: es-MX@GENERIC>, <ASS: FFprobeMkvSubtitleTags: es@GENERIC>, <ASS: FFprobeMkvSubtitleTags: fr@GENERIC>, <ASS: FFprobeMkvSubtitleTags: de@GENERIC>, <ASS: FFprobeMkvSubtitleTags: it@GENERIC>, <ASS: FFprobeMkvSubtitleTags: ru@GENERIC>]|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/4d07dab166da43448aa66343ccd229f5.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/84ff934bead9080ba7793804e5110321.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/e449c34ceb522658ed17b041ae61c6cb.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/df6b08f1429fb87ca322af06acdef581.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/0e2edc5a7104f0cb9d9c89ca04e37084.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/c5786fda36789823f1ec054bbaf495e0.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/223c97ac1fe8e87187de7c3eaa2f730c.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Appending subtitle path: /config/cache/embeddedsubtitlesprovider/46f35750b3569d7addda6e9a550804a7.ass|
2024-06-18 10:39:59|DEBUG   |fese.container                  |Extracting subtitle with command /usr/bin/ffmpeg -v warning -y -i /media/shows/A Salad Bowl of Eccentrics/[Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].mkv -map 0:2 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/4d07dab166da43448aa66343ccd229f5.ass -map 0:3 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/84ff934bead9080ba7793804e5110321.ass -map 0:4 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/e449c34ceb522658ed17b041ae61c6cb.ass -map 0:5 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/df6b08f1429fb87ca322af06acdef581.ass -map 0:6 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/0e2edc5a7104f0cb9d9c89ca04e37084.ass -map 0:7 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/c5786fda36789823f1ec054bbaf495e0.ass -map 0:8 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/223c97ac1fe8e87187de7c3eaa2f730c.ass -map 0:9 -c:s copy -f ass /config/cache/embeddedsubtitlesprovider/46f35750b3569d7addda6e9a550804a7.ass|
2024-06-18 10:40:03|INFO    |engineio.server                 |L4UyzmmD6tjQIUmwAAAA: Client is gone, closing socket|
2024-06-18 10:40:03|INFO    |engineio.server                 |L4UyzmmD6tjQIUmwAAAA: Client is gone, closing socket|
2024-06-18 10:40:19|INFO    |engineio.server                 |mRCzOlrX1s0ux2leAAAC: Sending packet PING data None|
2024-06-18 10:40:19|INFO    |engineio.server                 |mRCzOlrX1s0ux2leAAAC: Received packet PONG data |
2024-06-18 10:40:30|DEBUG   |urllib3.connectionpool          |Starting new HTTP connection (1): ***.***.***.***:7878|
2024-06-18 10:40:30|DEBUG   |urllib3.connectionpool          |http://***.***.***.***:7878 "GET /api/system/status?apikey=(removed) HTTP/1.1" 404 0|
2024-06-18 10:40:30|DEBUG   |urllib3.connectionpool          |Starting new HTTP connection (1): ***.***.***.***:7878|
2024-06-18 10:40:30|DEBUG   |urllib3.connectionpool          |http://***.***.***.***:7878 "GET /api/v3/system/status?apikey=(removed) HTTP/1.1" 200 None|
2024-06-18 10:40:30|DEBUG   |root                            |BAZARR got this Radarr version from its API: 5.6.0.8846|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.providers.embeddedsubtitles|Found modifiers for <ASS: FFprobeMkvSubtitleTags: es@GENERIC> type: {<function _clean_ass_subtitles at 0x7f7da562a0>}|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.providers.embeddedsubtitles|Running <function _clean_ass_subtitles at 0x7f7da562a0> modifier for /config/cache/embeddedsubtitlesprovider/df6b08f1429fb87ca322af06acdef581.ass|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.providers.embeddedsubtitles|Cleaned lines: 33|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.providers.embeddedsubtitles|Lines written to output path: /config/cache/embeddedsubtitlesprovider/df6b08f1429fb87ca322af06acdef581.ass|
2024-06-18 10:40:39|INFO    |subliminal_patch.subtitle       |Guessing encoding for language es|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.subtitle       |Trying encodings ['utf-8', 'windows-1252', 'iso-8859-15', 'iso-8859-9', 'iso-8859-4', 'iso-8859-1']|
2024-06-18 10:40:39|INFO    |subliminal_patch.subtitle       |Guessed encoding utf-8|
2024-06-18 10:40:39|ERROR   |subliminal_patch.subtitle       |PySRT-parsing failed, trying pysubs2|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.subtitle       |Trying parsing with PySubs2|
2024-06-18 10:40:39|DEBUG   |root                            |at line 1: section heading [Script Info]|
2024-06-18 10:40:39|DEBUG   |root                            |at line 12: section heading [V4+ Styles]|
2024-06-18 10:40:39|DEBUG   |root                            |at line 28: section heading [Events]|
2024-06-18 10:40:39|INFO    |subliminal_patch.subtitle       |Got format: ass|
2024-06-18 10:40:39|DEBUG   |root                            |BAZARR Subtitles file downloaded for this file: /media/shows/A Salad Bowl of Eccentrics/[Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].mkv|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.core           |Subtitle formats requested: ('srt',)|
2024-06-18 10:40:39|DEBUG   |subliminal_patch.core           |Saving <EmbeddedSubtitle: [Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].es.ass [<Language: alpha3=spa>]> to '/media/shows/A Salad Bowl of Eccentrics/[Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].es.srt'|
2024-06-18 10:40:39|DEBUG   |root                            |BAZARR Subtitles file saved to disk: /media/shows/A Salad Bowl of Eccentrics/[Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].es.srt|
2024-06-18 10:40:39|DEBUG   |root                            |Sync checker: <function sync_checker at 0x7f82342660>|
2024-06-18 10:40:39|DEBUG   |root                            |Checker data [{'blacklisted_languages': [], 'blacklisted_providers': ['embeddedsubtitles', 'subtitulamostv']}] for <EmbeddedSubtitle: [Erai-raws] Henjin no Salad Bowl - 11 [1080p][Multiple Subtitle][FDD51DB0].es.ass [<Language: alpha3=spa>]>|
2024-06-18 10:40:39|DEBUG   |root                            |BAZARR Sync checker not passed. Won't sync.|
2024-06-18 10:40:39|DEBUG   |urllib3.connectionpool          |Starting new HTTP connection (1): ***.***.***.***:8989|
2024-06-18 10:40:39|DEBUG   |urllib3.connectionpool          |http://***.***.***.***:8989 "POST /api/v3/command?apikey=(removed) HTTP/1.1" 201 None|
2024-06-18 10:40:39|INFO    |socketio.server                 |emitting event "data" to all [/]|
2024-06-18 10:40:39|INFO    |engineio.server                 |mRCzOlrX1s0ux2leAAAC: Sending packet MESSAGE data 2["data",{"type":"series","action":"update","payload":50}]|
2024-06-18 10:40:39|INFO    |socketio.server                 |emitting event "data" to all [/]|
2024-06-18 10:40:39|INFO    |engineio.server                 |mRCzOlrX1s0ux2leAAAC: Sending packet MESSAGE data 2["data",{"type":"episode-wanted","action":"delete","payload":4055}]|
2024-06-18 10:40:39|INFO    |socketio.server                 |emitting event "data" to all [/]|
2024-06-18 10:40:39|INFO    |engineio.server                 |mRCzOlrX1s0ux2leAAAC: Sending packet MESSAGE data 2["data",{"type":"episode-history","action":"update","payload":null}]|
2024-06-18 10:40:39|DEBUG   |apprise                         |Language set to en|
MiguelAngelLV commented 2 weeks ago

The problem may be this:

2024-06-18 10:40:39|DEBUG   |subliminal_patch.core           |Subtitle formats requested: ('srt',)|

But I have checked "use original format".

Maybe there is another option for request format?

vitiko98 commented 2 weeks ago

Logs did the trick. I think this is related to an attribute from Subtitle.

Please try again in upcoming beta.

MiguelAngelLV commented 1 week ago

I tried beta 10, the problem persists:

2024-06-24 15:51:35|DEBUG   |subliminal_patch.subtitle       |Trying parsing with PySubs2|
2024-06-24 15:51:35|DEBUG   |root                            |at line 1: section heading [Script Info]|
2024-06-24 15:51:35|DEBUG   |root                            |at line 12: section heading [V4+ Styles]|
2024-06-24 15:51:35|DEBUG   |root                            |at line 27: section heading [Events]|
2024-06-24 15:51:35|INFO    |subliminal_patch.subtitle       |Got format: ass|
2024-06-24 15:51:35|DEBUG   |root                            |BAZARR Subtitles file downloaded for this file: /media/shows/Mushoku Tensei - Jobless Reincarnation/Season 2/[Judas] Mushoku Tensei - S02E23.mkv|
2024-06-24 15:51:35|DEBUG   |subliminal_patch.subtitle       |Will assume srt format|
2024-06-24 15:51:35|DEBUG   |subliminal_patch.core           |Subtitle formats requested: ('srt',)|
2024-06-24 15:51:35|DEBUG   |subliminal_patch.core           |Saving <EmbeddedSubtitle: [Judas] Mushoku Tensei - S02E23.es.ass [<Language: alpha3=spa;hi=True>]> to '/media/shows/Mushoku Tensei - Jobless Reincarnation/Season 2/[Judas] Mushoku Tensei - S02E23.es.hi.srt'|
2024-06-24 15:51:35|DEBUG   |root                            |BAZARR Subtitles file saved to disk: /media/shows/Mushoku Tensei - Jobless Reincarnation/Season 2/[Judas] Mushoku Tensei - S02E23.es.hi.srt|
2024-06-24 15:51:35|DEBUG   |root                            |Sync checker: <function sync_checker at 0x7fb9bb6660>|
2024-06-24 15:51:35|DEBUG   |root                            |Checker data [{'blacklisted_languages': [], 'blacklisted_providers': ['embeddedsubtitles', 'subtitulamostv']}] for <EmbeddedSubtitle: [Judas] Mushoku Tensei - S02E23.es.ass [<Language: alpha3=spa;hi=True>]>|
2024-06-24 15:51:35|DEBUG   |root                            |BAZARR Sync checker not passed. Won't sync.|
2024-06-24 15:51:35|DEBUG   |urllib3.connectionpool          |Starting new HTTP connection (1): ***.***.***.***:8989|
2024-06-24 15:51:35|DEBUG   |urllib3.connectionpool          |http://***.***.***.***:8989 "POST /api/v3/command?apikey=(removed) HTTP/1.1" 201 None|

Maybe _og_format is not updated?

vitiko98 commented 1 week ago

@MiguelAngelLV Manual download or automatic download?

MiguelAngelLV commented 1 week ago

@vitiko98 manual

vitiko98 commented 1 week ago

So it might be related to the REST API.

This is the payload for manual episode subtitles:

image

The code in api/providers/provider_episodes.py is expecting it to be a literal boolean string:

image

Consequentially, the code in bazarr/subtitles/manual.py will return False no matter the payload.

image

I made a commit to mitigate this. Please try again in upcoming beta.

morpheus65535 commented 4 hours ago

@MiguelAngelLV can you confirm if the issue is fixed?