danrahn / PlexSubtitleExtractor

Save subtitles added to Plex via upload and on-demand search
11 stars 1 forks source link

AttributeError: 'SubtitleBlob' object has no attribute 'file' #3

Open Aabayoumy opened 7 months ago

Aabayoumy commented 7 months ago

Hi It's save some subtitle then i got this error !

Writing /media/MediaHDD/Movies/Bears.2014.1080p.BluRay.H264.AAC-RARBG/Bears.2014.1080p.BluRay.H264.AAC-RARBG.ara.srt Writing /media/MediaHDD/Movies/All Quiet on the Western Front (2022)/All Quiet on the Western Front (2022) {imdb-tt1016150} [WEBRip-480p][AAC 2.0][x264]-ION10.ara.srt Writing /media/MediaHDD/TVSHOW/The IT Crowd/Season 01/The IT Crowd - S01E01 - Yesterday's Jam.ara.srt Writing /media/MediaHDD/TVSHOW/The IT Crowd/Season 01/The IT Crowd - S01E02 - Calamity Jen.ara.srt Writing /media/MediaHDD/Movies/The Beekeeper (2024) {imdb-tt15314262}/The Beekeeper (2024)[WEBRip-720p][YTS.MX].ar.srt Writing /media/MediaHDD/Movies/Dune (2021) {imdb-tt1160419}/Dune (2021)[Bluray-720p][YTS.MX].ara.srt Writing /media/MediaHDD/Movies/Anatomy of a Fall (2023) {imdb-tt17009710}/Anatomy of a Fall (2023)[Bluray-720p][YTS.MX].ara.srt Writing /media/MediaHDD/Movies/The Big Short (2015) [1080p] [YTS.AG]/The.Big.Short.2015.1080p.BluRay.x264-[YTS.AG].ara.srt Traceback (most recent call last): File "/home/abayoumy/Downloads/PlexSubtitleExtractor/ExtractSubtitles.py", line 265, in process() File "/home/abayoumy/Downloads/PlexSubtitleExtractor/ExtractSubtitles.py", line 106, in process write_subtitles(blobs, save_dir, cmd_args) File "/home/abayoumy/Downloads/PlexSubtitleExtractor/ExtractSubtitles.py", line 163, in write_subtitles filename = subtitle.get_name(save_dir == None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/abayoumy/Downloads/PlexSubtitleExtractor/ExtractSubtitles.py", line 25, in get_name folder, basename = os.path.split(self.file) ^^^^^^^^^ AttributeError: 'SubtitleBlob' object has no attribute 'file'

Aabayoumy commented 7 months ago

i removed sub from this movies and download a gain it;s working but got eror on another one can you add error handeling so it;s will contain to next item if have error? also will be great to report at end with error movies

last requist :) can you add option to remove subtitle from plex after success extract?

danrahn commented 7 months ago

Thanks for the report! I think this might happen if you have a subtitle file that isn't associated with any media item in the main Plex database (which also means that it's impossible to say what specific movie it's for unfortunately). My quick fix for that is here: 79fef3b526b3aa7934ab2f3e94349926d154d245.

As for the request to then remove subtitles from Plex after extracting, that's something I can investigate in the future, but probably not something I have the bandwidth to implement right now.