remove aiohttp session
This commit is contained in:
		@@ -1,7 +1,6 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
import json
 | 
			
		||||
import sys
 | 
			
		||||
import urllib.parse
 | 
			
		||||
import os
 | 
			
		||||
import base64
 | 
			
		||||
import logging
 | 
			
		||||
@@ -10,7 +9,6 @@ import tornado.web
 | 
			
		||||
import tornado.routing
 | 
			
		||||
import stream_providers
 | 
			
		||||
import aiohttp
 | 
			
		||||
import aiohttp_socks
 | 
			
		||||
 | 
			
		||||
logging.basicConfig(format='[%(filename)s:%(lineno)d] %(message)s', stream=sys.stdout, level=logging.INFO)
 | 
			
		||||
logger = logging.getLogger(__name__)
 | 
			
		||||
@@ -36,12 +34,6 @@ class ProxyElem():
 | 
			
		||||
    def local(self):
 | 
			
		||||
        timeout = aiohttp.ClientTimeout(total=5)
 | 
			
		||||
        return aiohttp.ClientSession(timeout=timeout)
 | 
			
		||||
    def session(self):
 | 
			
		||||
        connector = None
 | 
			
		||||
        if self.proxy is not None:
 | 
			
		||||
            connector = aiohttp_socks.ProxyConnector.from_url("socks5://" + self.proxy)
 | 
			
		||||
        timeout = aiohttp.ClientTimeout(total=2)
 | 
			
		||||
        return aiohttp.ClientSession(connector=connector, timeout=timeout)
 | 
			
		||||
    def __repr__(self):
 | 
			
		||||
        return str(self.proxy)
 | 
			
		||||
    async def proxy_url(self, urls):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user