NIKDISSV-Forever / HDRezka

HDRezka (rezka.ag) Python API
MIT License
10 stars 0 forks source link

Proxy support #3

Closed NIKDISSV-Forever closed 10 months ago

NIKDISSV-Forever commented 10 months ago
          hey there, some sites are blocked, will this lib support proxy???

Originally posted by @10kkm in https://github.com/NIKDISSV-Forever/HDRezka/issues/1#issuecomment-1873000290

NIKDISSV-Forever commented 10 months ago

As of version 3.1.0 you can specify the following:

import asyncio, hdrezka, hdrezka.api.http
async def main():
    hdrezka.api.http.DEFAULT_CLIENT_KWARGS['proxy'] = 'socks5://127.0.0.1:9051'  # here default httpx.AsyncClient kwargs
    player: hdrezka.PlayerSeries = await hdrezka.Player('https://rezka.ag/series/drama/65751-epopeya-imperii-cin-2020.html')
    ...
if __name__ == '__main__': asyncio.run(main())