caronc / nzb-subliminal

Fetches subtitles for the videos it's provided. It can be easily integrated into NZBGet and SABnzbd too.
GNU General Public License v3.0
103 stars 14 forks source link

IOError 'No such file or directory' when saving srt file #48

Closed wardwygaerts closed 6 years ago

wardwygaerts commented 6 years ago

I want to use your script to search for subs manually. When I use the following commands, I receive an IOError 'No such file or directory':

python Subliminal.py -l nl -p opensubtitles -b -f -m BestScore -S /volume1/Media/Movies/All/MovieTitle/

2018-01-30 12:54:24,753 - 30894 - INFO - Found 1 matched file(s).
2018-01-30 12:54:24,754 - 30894 - INFO - Using basic search mode
2018-01-30 12:54:25,426 - 30894 - INFO - Listing subtitles with provider 'opensubtitles' for video <Movie [u'MovieTitle', 2017]> with languages set([<Language [nl]>])
2018-01-30 12:54:25,579 - 30894 - INFO - Found 4 subtitle(s) on opensubtitles
2018-01-30 12:54:25,736 - 30894 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [nl]> with score 24 into u'MovieTitle.nl.srt'
2018-01-30 12:54:26,283 - 30894 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "/volume1/Scripts/python_modules/nzb-subliminal-master/Subliminal/nzbget/ScriptBase.py", line 3038, in run
    exit_code = main_function(*args, **kwargs)
    File "Subliminal.py", line 1999, in main
    use_nzbheaders=False,
    File "Subliminal.py", line 1675, in subliminal_fetch
    move(move_from, expected_file)
    File "/usr/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
    File "/usr/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
    File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
  IOError: [Errno 2] No such file or directory: u'/tmp/nzbget-ward/MovieTitle/MovieTitle.nl.srt'

So it tries to add the srt file in a tmp directory which I don"t have. I also seems that it uses a directory with my username in it 'nzbget-ward'

caronc commented 6 years ago

This is my fault. I broke it trying to fix issue #45. Sorry about this. I will look into it when I get home tonight and roll back my change.

wardwygaerts commented 6 years ago

thanks for the quick reply. Never used the script before, so didn't knew it worked before :)

I edited the files already myself and eveything is working for me now. Thanks!

caronc commented 6 years ago

Give it another go (you'll have to check out the master branch again). I apologize for introducing a major bug just as you were trying it out for the first time (bad coincidence).

Please let me know if you still have any problems!

wardwygaerts commented 6 years ago

thanks for solving, It's working great! It's running over my full collection atm :)

caronc commented 6 years ago

Awesome, I'm glad to hear you're back in business! I'll close the ticket for now since I think we nailed this particular problem. But please feel free to create a new ticket whenever you have an more issues!