No project description provided
Project description
HdRezkaApi
Install:
pip install HdRezkaApi
Usage:
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 (Hdrezka Rating)
self.translators - Translators array
self.seriesInfo - Seasons and Episodes array
self.otherParts - Other parts of this film
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.
stream = rezka.getStream() # if movie
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
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.
But if the error occurs again, then None will be added to the final dict.
To ignore errors and retry requests until a response is received, specify the ignore=True option.
for i, stream in rezka.getSeasonStreams('1'):
print(stream)
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 - HdRezkaStreamSubtitles
HdRezkaStream(resolutin) - call object with argument to get url of video
Usage examples:
stream = rezka.getStream(1, 5)
print( stream('720p') )
print( stream('720') )
print( stream(1080) )
print( stream('Ultra') )
print( stream('1080p Ultra') )
print( stream.videos )
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:
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
HdRezkaRating:
self.value - rating value (float)
self.votes - votes amount (int)
Proxy usage example:
rezka = HdRezkaApi(url, proxy={'http': 'http://192.168.0.1:80'})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file HdRezkaApi-7.1.0.tar.gz.
File metadata
- Download URL: HdRezkaApi-7.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a02457144b19a66894e481bcd5fbd5bd621c4d872648c3d708328e3febb63eb9
|
|
| MD5 |
9687cf672bfe5a841f4f613e974abd9c
|
|
| BLAKE2b-256 |
2a5efc01b30308989b7f967aa8396779ec59b46c30f59ef08ae546ecf5655d52
|
File details
Details for the file HdRezkaApi-7.1.0-py3-none-any.whl.
File metadata
- Download URL: HdRezkaApi-7.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
634aac11c14f36f1ca6c0fa2739e4dad189f3763a8496cdac4e9b11d2579b708
|
|
| MD5 |
165df01437936ad3f9011e6542d4d130
|
|
| BLAKE2b-256 |
b0f6574f50c4d02a429b98b3c79599279eaf8a4f70662775273c8064545d137f
|