animetosho2mks: Force font/sfnt as mime type
This commit is contained in:
parent
3b5459b2b2
commit
1d2bf8c88a
|
@ -3,7 +3,6 @@
|
||||||
from subprocess import run
|
from subprocess import run
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
import glob
|
import glob
|
||||||
import mimetypes
|
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,9 +25,6 @@ class SubtitleTrack:
|
||||||
class Attachment:
|
class Attachment:
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.mimetype = mimetypes.guess_type(self.filename)[0]
|
|
||||||
if self.mimetype is None:
|
|
||||||
raise Exception(f"Cannot guess mimetype of attachment {self.mimetype}")
|
|
||||||
|
|
||||||
|
|
||||||
class AnimeToshoFile:
|
class AnimeToshoFile:
|
||||||
|
@ -64,7 +60,7 @@ class AnimeToshoFile:
|
||||||
command.extend(
|
command.extend(
|
||||||
[
|
[
|
||||||
"--attachment-mime-type",
|
"--attachment-mime-type",
|
||||||
attachment.mimetype,
|
"font/sfnt",
|
||||||
"--attach-file",
|
"--attach-file",
|
||||||
os.path.join(self.base, "attachments", attachment.filename),
|
os.path.join(self.base, "attachments", attachment.filename),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue