mirror of
https://github.com/Viren070/AIOStremio.git
synced 2025-12-01 23:24:19 +01:00
feat(torrentio): use proxy in ADDON_PROXY if defined
This commit is contained in:
@@ -24,7 +24,13 @@ class TorrentioService(StreamingService):
|
|||||||
async def _fetch_from_torrentio(self, url: str) -> Dict:
|
async def _fetch_from_torrentio(self, url: str) -> Dict:
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
try:
|
try:
|
||||||
response = await client.get(url)
|
proxies = None
|
||||||
|
if (os.getenv("ADDON_PROXY")):
|
||||||
|
proxies = {
|
||||||
|
"http": os.getenv("ADDON_PROXY"),
|
||||||
|
"https": os.getenv("ADDON_PROXY"),
|
||||||
|
}
|
||||||
|
response = await client.get(url, proxies = proxies)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
logger.debug(f"Torrentio response: {data}")
|
logger.debug(f"Torrentio response: {data}")
|
||||||
|
|||||||
Reference in New Issue
Block a user