Metadata-Version: 2.1
Name: HDRezka
Version: 2.0.1
Summary: HDRezka (rezka.ag) Python API
Home-page: https://github.com/NIKDISSV-Forever/HDRezka
Author: Nikita (NIKDISSV)
Author-email: nikdissv@proton.me
License: MIT
Project-URL: GitHub, https://github.com/NIKDISSV-Forever/HDRezka
Project-URL: Documentation, https://nikdissv-forever.github.io/HDRezka/hdrezka
Keywords: HDRezka,rezka.ag,watch online,api,stream
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Other Audience
Classifier: Intended Audience :: Telecommunications Industry
Classifier: License :: OSI Approved
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# [HDRezka](https://rezka.ag/) site API.

# Install

`pip install HDRezka`

# Example

```python
from hdrezka import Search

player = Search('Breaking Bad')[1, 0].player  # page 1 element 0; or just use Player(646)
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 = player.get_stream(1, 1, translator_id)  # raise AJAXFail if invalid episode or translator
video = stream.video
print(video.last_url)  # best quality
print(video[video.min].last_url.mp4, end='\n\n')

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

# [Documentation](https://nikdissv-forever.github.io/HDRezka/hdrezka)

---

# CHANGELOG

## 2.0.1

- Fixed bug with PIP

## 2.0.0

Backward incompatible changes have been made

- #### New submodules `urls.short`, `urls.kind`, `urls.kind.quality`, `urls.kind.subtitles`, `urls.kind.video`
- Optimizations
- `Ajax` renamed to `AJAX` (PEP-8)
- the `get_stream` method now contains the `video` attribute and the `subtitle` attribute

- ### urls
    - New function `urls_from_ajax_response -> URLs`
- ### urls.short
    - `short_url`, `long_url`
- ### urls.kind
    - class `Quality` now in `urls.king.quality` (also in \_\_init__)
- ### urls.kind.video
    - classes `VideoURL`, `VideoURLs`
- ### urls.kind.subtitle
    - classes `SubtitleURL`, `SubtitleURLs`

## 1.1.3

- bugfixes

## 1.1.2

- added pdoc documentation
- now Python **3.10** has become the minimum compatible version.
- removed all `from __future__ import annotations` statements
- used `match...case` statements
- optimization

- new submodule `api.http`
- `get_response` moved to `api.http` submodule

## 1.1.1

- fixed bug with importing `stream.Post`
- fixed `post.urls.url_short` function

## 1.1.0

- `post.urls.short_url` now even shorter

- ### errors
    - `EmptySearchPage` replaced with `EmptyPage`

- #### New submodule `post.page`

- ### post.page
    - new `Page` class that will parse any page rezka.ag on `InlineItem` (new data class)

- ### api.search
    - `Search` now inherited from `Page`

## 1.0.0

Backward incompatible changes have been made

- bs4 now selects lxml (if it available) once at startup
- new submodule `post`, `post.info`, `post.info.fields`
- class `post.Post` created
- class `post.info.PostInfo` created

- ### stream

    - hint typing fixes
    - `Player` now caching


- ##### `urls` submodule now is `post.urls`


- ### post.urls

    - `short_url` and `long_url` functions added (caching)
    - `short_url`, `long_url`, `Quality`, `URL` now in `__all__`


- ### post.info.fields

    - classes `Rating`, `Place`, `Release`, `AgeRating`, `Duration`, `Poster` created

## 0.0.2

- initial version
