Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

opensubtitles api updated?? #52

Open
avictor0826 opened this issue Mar 25, 2018 · 2 comments
Open

opensubtitles api updated?? #52

avictor0826 opened this issue Mar 25, 2018 · 2 comments

Comments

@avictor0826
Copy link

avictor0826 commented Mar 25, 2018

hi Nicoddemus

Wonderful utility! only a movie buff can understand the importance of the utility

I was not able to retrieve any results with ss.py with the below error.
_C:\Users\av>python C:\Python27\Scripts\ss.py Doctor.Strange.2016.1080p.6CH.MkvCage.mkv
Languages: eng

Downloading

Traceback (most recent call last):
  File "C:\Python27\Scripts\ss.py", line 507, in <module>
    sys.exit(main(sys.argv))  # pragma: no cover
  File "C:\Python27\Scripts\ss.py", line 382, in main
    subtitle_filename = future.result()
  File "C:\Python27\lib\site-packages\concurrent\futures\_base.py", line 455, in result
    return self.__get_result()
  File "C:\Python27\lib\site-packages\concurrent\futures\thread.py", line 63, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Python27\Scripts\ss.py", line 184, in search_and_download
    subtitle_url, subtitle_ext = find_subtitle(movie_filename, language=language)
  File "C:\Python27\Scripts\ss.py", line 111, in find_subtitle
    search_result = search_results[0]
KeyError: 0

Seems we were trying to access a dict as a list

ss.py: line no 110 : search_result = search_results[0]

I tried modifying it to the below and it worked
ss.py: line no 110 : search_result = search_results[search_results.keys()[0]]`

Please see if its an issue and fix it. If not, please let me know if I am missing something
Python version : 2.7

Thanks
AV

@nicoddemus
Copy link
Owner

Hi @avictor0826 thanks for writing!

It might take a awhile for me to get to this (I've not used this project in a long time), so if you have the time to come up with a PR I would gladly review it and merge it. 👍

@nicoddemus
Copy link
Owner

nicoddemus commented Apr 2, 2018

Hi @avictor0826 I just tried ss without modifications and it worked just fine for a couple of videos I had laying around. I even used Python 2.7 as you. Can you try it again please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants