try except import
This commit is contained in:
		@@ -1,5 +1,10 @@
 | 
			
		||||
import youtube_dl
 | 
			
		||||
import streamlink
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    import streamlink
 | 
			
		||||
except Exception as e:
 | 
			
		||||
    print(e)
 | 
			
		||||
 | 
			
		||||
import requests
 | 
			
		||||
import asyncio
 | 
			
		||||
import html.parser
 | 
			
		||||
@@ -9,13 +14,17 @@ import subprocess
 | 
			
		||||
import json
 | 
			
		||||
import re
 | 
			
		||||
 | 
			
		||||
streamlink_sessions = {}
 | 
			
		||||
streamlink_default_session = streamlink.Streamlink()
 | 
			
		||||
try:
 | 
			
		||||
    streamlink_sessions = {}
 | 
			
		||||
    streamlink_default_session = streamlink.Streamlink()
 | 
			
		||||
def setup(proxies):
 | 
			
		||||
    for proxy in proxies:
 | 
			
		||||
        streamlink_sessions[proxy] = streamlink.Streamlink()
 | 
			
		||||
        streamlink_sessions[proxy].set_option("http-proxy", "socks5://" + proxy)
 | 
			
		||||
        streamlink_sessions[proxy].set_option("https-proxy", "socks5://" + proxy)
 | 
			
		||||
    try:
 | 
			
		||||
        for proxy in proxies:
 | 
			
		||||
            streamlink_sessions[proxy] = streamlink.Streamlink()
 | 
			
		||||
            streamlink_sessions[proxy].set_option("http-proxy", "socks5://" + proxy)
 | 
			
		||||
            streamlink_sessions[proxy].set_option("https-proxy", "socks5://" + proxy)
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
 | 
			
		||||
class DummyLogger():
 | 
			
		||||
    def debug(self, msg):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user