mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
add subliminal for subtitle download. #253
This commit is contained in:
parent
47289c903a
commit
c3889c01b1
149 changed files with 34173 additions and 33 deletions
21
libs/subliminal/compat.py
Normal file
21
libs/subliminal/compat.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import socket
|
||||
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
from xmlrpclib import ServerProxy, Transport
|
||||
from httplib import HTTPConnection
|
||||
elif sys.version_info[0] == 3:
|
||||
from xmlrpc.client import ServerProxy, Transport
|
||||
from http.client import HTTPConnection
|
||||
|
||||
|
||||
class TimeoutTransport(Transport, object):
|
||||
def __init__(self, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, *args, **kwargs):
|
||||
super(TimeoutTransport, self).__init__(*args, **kwargs)
|
||||
self.timeout = timeout
|
||||
|
||||
def make_connection(self, host):
|
||||
h = HTTPConnection(host, timeout=self.timeout)
|
||||
return h
|
Loading…
Add table
Add a link
Reference in a new issue