# -*- coding: utf-8 -*- import logging from datetime import datetime import hashlib import os import re import socket import struct import requests from requests.exceptions import SSLError from six.moves.xmlrpc_client import ProtocolError from .exceptions import ServiceUnavailable logger = logging.getLogger(__name__) def hash_opensubtitles(video_path): """Compute a hash using OpenSubtitles' algorithm. :param str video_path: path of the video. :return: the hash. :rtype: str """ bytesize = struct.calcsize(b'