pip install HdRezkaApi
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.rating
- Film rating (Hdrezka Rating)
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(
translation='Дубляж' or translation='56' or index=0
) ^ this is index in translators array
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)
self.subtitles
- HdRezkaStreamSubtitles
stream = rezka.getStream(1, 5)
print( stream('720p') )
print( stream('720') )
print( stream(1080) )
print( stream('Ultra') )
print( stream('1080p Ultra') )
print( stream.videos )
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
rezka = HdRezkaApi(url, proxy={'http': 'http://192.168.0.1:80'})