Skip to main content

HDRezka site API

Install

pip install HDRezka

Example

import asyncio
import os

from hdrezka import Search
from hdrezka.api.http import login_global


async def main():
    await login_global(os.environ['LOGIN_NAME'], os.environ['LOGIN_PASSWORD'])
    player = await (await Search('Breaking Bad').get_page(1))[0].player
    # or use url (await Player('series/thriller/646-vo-vse-tyazhkie-2008.html'))
    print(player.post.info, end='\n\n')

    translator_id = None  # default
    for name, id_ in player.post.translators.name_id.items():
        if 'субтитры' in name.casefold(): translator_id = id_; break

    stream = await player.get_stream(1, 1, translator_id, )  # raise AJAXFail if invalid episode or translator
    video = stream.video
    print(await video.last_url[-1])  # best quality (.m3u8) (last source)
    # source - is not a finished link, await will return the link after the redirect
    print(await video[video.min].last_url[0].mp4, end='\n\n')  # worst quality (.mp4) (first source)

    subtitles = stream.subtitles
    print(subtitles.default.url)  # subtitles.ru.url or subtitles['Русский'].url


if __name__ == '__main__': asyncio.run(main())

Bypass Blocking

Custom HOST

from hdrezka.url import Request

Request.HOST = 'https://hdrezka.club/'

If the specified domain is protected by Cloudflare, successful response retrieval from the server cannot be guaranteed and may be inconsistent. See this file.

Proxies

pip install hdrezka[socks]

tor

import httpx

import hdrezka.api.http

hdrezka.api.http.DEFAULT_CLIENT = httpx.AsyncClient(
    headers={'User-Agent': 'Mozilla/5.0'},
    proxy='socks5://localhost:9050'
)

Log In (recommended for now)

Create an account on HDRezka.

If registration is temporarily disabled, try logging in via social media and resetting your password (so that you have one completely).

Call hdrezka.api.http.login_global - this function will send a request to hdrezka.api.http.Request.REDIRECT_URL,
which will redirect to an active mirror. The function will then store the retrieved mirror globally in Request.HOST
and save the cookies in hdrezka.api.http.DEFAULT_CLIENT.

import os

from hdrezka.api.http import login_global


async def main():
    await login_global(os.environ['LOGIN_NAME'], os.environ['LOGIN_PASSWORD'])

This method will also help if HDRezka considers your IP suspicious, suggests changing your VPN (proxy), and returns a 403 error.

Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hdrezka-4.0.4.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hdrezka-4.0.4-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file hdrezka-4.0.4.tar.gz.

File metadata

  • Download URL: hdrezka-4.0.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/7.1.2-zen1

File hashes

Hashes for hdrezka-4.0.4.tar.gz
Algorithm Hash digest
SHA256 0255835eef316da178e7357c62f7149a53a409a5ff379ddfd868007c6d093832
MD5 e84a1846a0fc279b3dbbc7521d448ec8
BLAKE2b-256 a053c7c8089e08050cfbcdd21de4493ef62228acb1eb0d87fd170324b2f41a81

See more details on using hashes here.

File details

Details for the file hdrezka-4.0.4-py3-none-any.whl.

File metadata

  • Download URL: hdrezka-4.0.4-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/7.1.2-zen1

File hashes

Hashes for hdrezka-4.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8b4a11ad7834653cf7b1dff6576237567abb3a9f9dbb89571d8d1332377212f0
MD5 4135755622caaf97285f08df958b42d1
BLAKE2b-256 c0ee7a58e3326332cc9acc706e47d58c76ff4416e13f419fa8779749f30a2fc7

See more details on using hashes here.

Release history Release notifications | RSS feed

5.2.0

2 files

5.1.0

2 files

5.0.0

2 files

This release

4.0.4 This release

2 files

4.0.3

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.3.1

2 files

3.3.0

2 files

3.2.3

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.0.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page