try except import
This commit is contained in:
parent
4bd5ed6ccc
commit
c959eb07b6
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user