core: cf: testing

providers: subscene: testing
This commit is contained in:
panni
2019-05-08 04:14:04 +02:00
parent 97e93cd10a
commit dc0a8deb40
2 changed files with 10 additions and 5 deletions
@@ -49,17 +49,22 @@ class CipherSuiteAdapter(HTTPAdapter):
##########################################################################################################################################################
def init_poolmanager(self, *args, **kwargs):
kwargs['ssl_context'] = create_urllib3_context(ciphers=self.cipherSuite)
if hasattr(ssl, 'PROTOCOL_TLS'):
kwargs['ssl_context'] = create_urllib3_context(ssl_version=getattr(ssl, 'PROTOCOL_TLSv1_3', ssl.PROTOCOL_TLSv1_2), ciphers=self.cipherSuite)
else:
kwargs['ssl_context'] = create_urllib3_context(ssl_version=ssl.PROTOCOL_TLSv1)
return super(CipherSuiteAdapter, self).init_poolmanager(*args, **kwargs)
##########################################################################################################################################################
def proxy_manager_for(self, *args, **kwargs):
kwargs['ssl_context'] = create_urllib3_context(ciphers=self.cipherSuite)
if hasattr(ssl, 'PROTOCOL_TLS'):
kwargs['ssl_context'] = create_urllib3_context(
ssl_version=getattr(ssl, 'PROTOCOL_TLSv1_3', ssl.PROTOCOL_TLSv1_2), ciphers=self.cipherSuite)
else:
kwargs['ssl_context'] = create_urllib3_context(ssl_version=ssl.PROTOCOL_TLSv1)
return super(CipherSuiteAdapter, self).proxy_manager_for(*args, **kwargs)
##########################################################################################################################################################
class CloudScraper(Session):
def __init__(self, *args, **kwargs):
@@ -244,7 +244,7 @@ def get_first_film(soup, section, year=None, session=None):
def search(term, release=True, session=None, year=None, limit_to=SearchTypes.Exact):
soup = soup_for("%s/subtitles/%s?q=%s" % (SITE_DOMAIN, "release" if release else "title", term), session=session)
soup = soup_for("%s/subtitles/%s?q=%s" % (SITE_DOMAIN, "release" if release else "search", term), session=session)
if "Subtitle search by" in str(soup):
rows = soup.find("table").tbody.find_all("tr")