Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How can I download subtitles for a movie by taking video as input using Opensubtitles API (python wrapper)? [closed]

$
0
0

I found a python wrapper for opensubtitles.org's API in github, which has pretty good documentation.So, i started trying out some methods but unfortunately i am getting an error. I figured out that searchsubtitles() method is returning a null list. Can anyone help me?

from pythonopensubtitles.opensubtitles import OpenSubtitlesfrom pythonopensubtitles.utils import Fileimport easyguiost = OpenSubtitles() username=easygui.enterbox("Enter username:")password=easygui.passwordbox("Enter Password:")ost.login(username,password)video_file_path=easygui.fileopenbox()print(video_file_path)video_file=File(video_file_path)video_hash=video_file.get_hash()video_file_size=video_file.sizeprint(video_hash,video_file_size)search_result=ost.search_subtitles([{'sublanguageid': 'all', 'moviehash':video_hash, 'moviebytesize':video_file_size }])id_subtitle = search_result[0].get('IDSubtitle')print(id_subtitle)ost.logout() 

enter image description here


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>