manojmj92 / subtitle-downloader

Python script to automatically download subtitles for any movie/tv series episode.
GNU General Public License v3.0
780 stars 238 forks source link

Fix subtitle download to work across cross-device boundaries #32

Closed mohanraj-r closed 8 years ago

mohanraj-r commented 8 years ago

When I tried to run the subtitle downloader on a video file located in my SD card connected via USB I got the following error

$ python subtitle-downloader.py /Volumes/Untitled/4.mp4
Error in fetching subtitle for /Volumes/Untitled/4.mp4
('Error', (<type 'exceptions.OSError'>, OSError(18, 'Cross-device link'), <traceback object at 0x1068e
eb48>))

Seems like os.rename() doesn't work well across device boundaries. But changing it to shutil.move() fixes the issue.