# HdRezkaApi
<img src="https://shields.io/badge/version-v7.0-blue">
### Install:
```
pip install HdRezkaApi
```
### Usage:
```python
from HdRezkaApi import *
url = "https://hdrezka.ag/ __YOUR_URL__ .html"
rezka = HdRezkaApi(url)
print(rezka.name)
print(rezka.thumbnail)
print( rezka.rating.value )
print( rezka.rating.votes )
print( rezka.translators )
print( rezka.otherParts )
print( rezka.seriesInfo )
print(rezka.type)
print(rezka.type == HdRezkaTVSeries == HdRezkaTVSeries() == "tv_series")
print( rezka.getStream()('720p') ) # if movie
print( rezka.getStream('1', '1')('720p') )
print( dict(rezka.getSeasonStreams('1')) )
```
#### `self.id` - Film id (`post_id`)
#### `self.name` - Film name (`post__title`)
#### `self.type` - `HdRezkaTVSeries` or `HdRezkaMovie`
#### `self.thumbnail` - Film thumbnail url
#### `self.rating` - Film rating (<a href="#hdrezkarating">Hdrezka Rating</a>)
#### `self.translators` - Translators array
#### `self.seriesInfo` - Seasons and Episodes array
#### `self.otherParts` - Other parts of this film
<hr>
### getStream(`season`, `episode`, `translation=None`, `index=0`)
```
getStream(
translation='Дубляж' or translation='56' or index=0
) ^ this is index in translators array
```
If type == movie then there is no need to specify season and episode.
```python
stream = rezka.getStream() # if movie
```
<hr>
### getSeasonStreams(`season`, `translation=None`, `index=0`, `ignore=False`, `progress=None`)
```
getSeasonStreams(
translation='Дубляж' or translation='56' or index=0
) ^ this is index in translators array
```
#### `ignore` - ignore errors
#### `progress` - callback function
```python
def progress(current, all):
percent = round(current * 100 / all)
print(f"{percent}%: {current}/{all}", end="\r")
print( dict(rezka.getSeasonStreams(1, ignore=True, progress=progress)) )
```
Output example:
```
{'1': <HdRezkaStream(season:1, episode:1)>, '2': <HdRezkaStream(season:1, episode:2)>, ...}
```
If an error occurs, an attempt will be made to repeat the request again.<br>
But if the error occurs again, then `None` will be added to the final dict.<br>
To ignore errors and retry requests until a response is received, specify the `ignore=True` option.
```python
for i, stream in rezka.getSeasonStreams('1'):
print(stream)
```
<hr>
<br>
# HdRezkaStream:
#### `self.videos` - dict of videos, where key is resolution and value is url
#### `self.name`
#### `self.translator_id`
#### `self.season` - (`None` if film)
#### `self.episode` - (`None` if film)
#### `self.subtitles` - <a href="#hdrezkastreamsubtitles" >HdRezkaStreamSubtitles</a>
#### `HdRezkaStream(resolutin)` - call object with argument to get url of video
### Usage examples:
```python
stream = rezka.getStream(1, 5)
print( stream('720p') )
print( stream('720') )
print( stream(1080) )
print( stream('Ultra') )
print( stream('1080p Ultra') )
print( stream.videos )
```
<br>
# HdRezkaStreamSubtitles:
#### `self.subtitles` - dict of subtitles
#### `self.keys` - list of subtitles codes
#### `self(id)` - call object with argument to get url of subtitles
### Usage examples:
```python
stream = rezka.getStream(1, 5)
print( stream.subtitles.keys ) # ['en', 'ru']
print( stream.subtitles.subtitles ) # { 'en': {'title': 'English', 'link': 'https:/'}, ... }
print( stream.subtitles('en') ) # 'https:/'
print( stream.subtitles('English') ) # 'https:/'
print( stream.subtitles(0) ) # 'https:/'
# ^ index
```
<br>
# HdRezkaRating:
#### `self.value` - rating value (`float`)
#### `self.votes` - votes amount (`int`)
<hr>
### Proxy usage example:
```python
rezka = HdRezkaApi(url, proxy={'http': 'http://192.168.0.1:80'})
```
Raw data
{
"_id": null,
"home_page": "https://github.com/SuperZombi/HdRezkaApi",
"name": "HdRezkaApi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Super_Zombi",
"author_email": "super.zombi.yt@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/42/ac/de341f4080a22fb0b26c4c30f1d2486acccd17eff84747b9fea34d460368/HdRezkaApi-7.0.1.tar.gz",
"platform": null,
"description": "# HdRezkaApi\r\n\r\n<img src=\"https://shields.io/badge/version-v7.0-blue\">\r\n\r\n### Install:\r\n```\r\npip install HdRezkaApi\r\n```\r\n\r\n### Usage:\r\n\r\n```python\r\nfrom HdRezkaApi import *\r\n\r\nurl = \"https://hdrezka.ag/ __YOUR_URL__ .html\"\r\n\r\nrezka = HdRezkaApi(url)\r\nprint(rezka.name)\r\nprint(rezka.thumbnail)\r\nprint( rezka.rating.value )\r\nprint( rezka.rating.votes )\r\nprint( rezka.translators )\r\nprint( rezka.otherParts )\r\nprint( rezka.seriesInfo )\r\n\r\nprint(rezka.type)\r\nprint(rezka.type == HdRezkaTVSeries == HdRezkaTVSeries() == \"tv_series\")\r\n\r\nprint( rezka.getStream()('720p') ) # if movie\r\nprint( rezka.getStream('1', '1')('720p') )\r\nprint( dict(rezka.getSeasonStreams('1')) )\r\n```\r\n\r\n#### `self.id` - Film id (`post_id`)\r\n#### `self.name` - Film name (`post__title`)\r\n#### `self.type` - `HdRezkaTVSeries` or `HdRezkaMovie`\r\n#### `self.thumbnail` - Film thumbnail url\r\n#### `self.rating` - Film rating (<a href=\"#hdrezkarating\">Hdrezka Rating</a>)\r\n#### `self.translators` - Translators array\r\n#### `self.seriesInfo` - Seasons and Episodes array\r\n#### `self.otherParts` - Other parts of this film\r\n\r\n<hr>\r\n\r\n### getStream(`season`, `episode`, `translation=None`, `index=0`)\r\n```\r\ngetStream(\r\n translation='\u0414\u0443\u0431\u043b\u044f\u0436' or translation='56' or index=0\r\n) ^ this is index in translators array\r\n```\r\nIf type == movie then there is no need to specify season and episode.\r\n```python\r\nstream = rezka.getStream() # if movie\r\n```\r\n<hr>\r\n\r\n### getSeasonStreams(`season`, `translation=None`, `index=0`, `ignore=False`, `progress=None`)\r\n```\r\ngetSeasonStreams(\r\n translation='\u0414\u0443\u0431\u043b\u044f\u0436' or translation='56' or index=0\r\n) ^ this is index in translators array\r\n```\r\n\r\n#### `ignore` - ignore errors\r\n#### `progress` - callback function\r\n\r\n```python\r\ndef progress(current, all):\r\n percent = round(current * 100 / all)\r\n print(f\"{percent}%: {current}/{all}\", end=\"\\r\")\r\n\r\nprint( dict(rezka.getSeasonStreams(1, ignore=True, progress=progress)) )\r\n```\r\n\r\nOutput example:\r\n```\r\n{'1': <HdRezkaStream(season:1, episode:1)>, '2': <HdRezkaStream(season:1, episode:2)>, ...}\r\n```\r\n\r\nIf an error occurs, an attempt will be made to repeat the request again.<br>\r\nBut if the error occurs again, then `None` will be added to the final dict.<br>\r\nTo ignore errors and retry requests until a response is received, specify the `ignore=True` option.\r\n\r\n```python\r\nfor i, stream in rezka.getSeasonStreams('1'):\r\n print(stream)\r\n```\r\n\r\n<hr>\r\n<br>\r\n\r\n# HdRezkaStream:\r\n#### `self.videos` - dict of videos, where key is resolution and value is url\r\n#### `self.name`\r\n#### `self.translator_id`\r\n#### `self.season` - (`None` if film)\r\n#### `self.episode` - (`None` if film)\r\n#### `self.subtitles` - <a href=\"#hdrezkastreamsubtitles\" >HdRezkaStreamSubtitles</a>\r\n#### `HdRezkaStream(resolutin)` - call object with argument to get url of video\r\n\r\n### Usage examples:\r\n\r\n```python\r\nstream = rezka.getStream(1, 5)\r\n\r\nprint( stream('720p') )\r\nprint( stream('720') )\r\nprint( stream(1080) )\r\nprint( stream('Ultra') )\r\nprint( stream('1080p Ultra') )\r\nprint( stream.videos )\r\n```\r\n\r\n<br>\r\n\r\n# HdRezkaStreamSubtitles:\r\n#### `self.subtitles` - dict of subtitles\r\n#### `self.keys` - list of subtitles codes\r\n#### `self(id)` - call object with argument to get url of subtitles\r\n\r\n### Usage examples:\r\n\r\n```python\r\nstream = rezka.getStream(1, 5)\r\n\r\nprint( stream.subtitles.keys ) # ['en', 'ru']\r\nprint( stream.subtitles.subtitles ) # { 'en': {'title': 'English', 'link': 'https:/'}, ... }\r\nprint( stream.subtitles('en') ) # 'https:/'\r\nprint( stream.subtitles('English') ) # 'https:/'\r\nprint( stream.subtitles(0) ) # 'https:/'\r\n# ^ index\r\n```\r\n\r\n<br>\r\n\r\n# HdRezkaRating:\r\n#### `self.value` - rating value (`float`)\r\n#### `self.votes` - votes amount (`int`)\r\n\r\n<hr>\r\n\r\n### Proxy usage example:\r\n```python\r\nrezka = HdRezkaApi(url, proxy={'http': 'http://192.168.0.1:80'})\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "7.0.1",
"project_urls": {
"Homepage": "https://github.com/SuperZombi/HdRezkaApi"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "60284d417e2b0730c706095c8e5ca270243fc4a24eee4f169103922d203994c4",
"md5": "5548c756a6805f5b20755c65967e5511",
"sha256": "7c5b1f1d12e574cd94fe65d2097a51a91242f860e9f42cdb999d6293ce36fdd6"
},
"downloads": -1,
"filename": "HdRezkaApi-7.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5548c756a6805f5b20755c65967e5511",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 10980,
"upload_time": "2024-05-06T16:16:06",
"upload_time_iso_8601": "2024-05-06T16:16:06.759858Z",
"url": "https://files.pythonhosted.org/packages/60/28/4d417e2b0730c706095c8e5ca270243fc4a24eee4f169103922d203994c4/HdRezkaApi-7.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "42acde341f4080a22fb0b26c4c30f1d2486acccd17eff84747b9fea34d460368",
"md5": "bf8900d4d14ecdcad8d8a6a04d08eafb",
"sha256": "ca20b192576c042d9308670f7787e38166920443d094444830b1aed72225c7bb"
},
"downloads": -1,
"filename": "HdRezkaApi-7.0.1.tar.gz",
"has_sig": false,
"md5_digest": "bf8900d4d14ecdcad8d8a6a04d08eafb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 10270,
"upload_time": "2024-05-06T16:16:08",
"upload_time_iso_8601": "2024-05-06T16:16:08.031462Z",
"url": "https://files.pythonhosted.org/packages/42/ac/de341f4080a22fb0b26c4c30f1d2486acccd17eff84747b9fea34d460368/HdRezkaApi-7.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-06 16:16:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SuperZombi",
"github_project": "HdRezkaApi",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "hdrezkaapi"
}