mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 18:47:09 -07:00
Added chmod to 644 for subtitles (#1817)
I ran into problems with permissions. Default sublimal write files with 0600 permission.
This commit is contained in:
parent
06d91c6928
commit
623e619534
1 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,8 @@ import subliminal
|
|||
import core
|
||||
from core import logger
|
||||
|
||||
import os
|
||||
|
||||
for provider in subliminal.provider_manager.internal_extensions:
|
||||
if provider not in [str(x) for x in subliminal.provider_manager.list_entry_points()]:
|
||||
subliminal.provider_manager.register(str(provider))
|
||||
|
@ -38,5 +40,9 @@ def import_subs(filename):
|
|||
video = subliminal.scan_video(filename)
|
||||
subtitles = subliminal.download_best_subtitles({video}, languages)
|
||||
subliminal.save_subtitles(video, subtitles[video])
|
||||
|
||||
for subtitle in subtitles[video]:
|
||||
subtitle_path = subliminal.subtitle.get_subtitle_path(video.name, subtitle.language)
|
||||
os.chmod(subtitle_path, 0o644)
|
||||
except Exception as e:
|
||||
logger.error('Failed to download subtitles for {0} due to: {1}'.format(filename, e), 'SUBTITLES')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue