try except import

This commit is contained in:
Roy Olav Purser 2021-11-18 23:02:14 +01:00
parent 4bd5ed6ccc
commit c959eb07b6
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -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):