Skip to main content

No project description provided

Project description

HdRezkaApi

Works with the new API from 01.05.2022


Install:

pip install HdRezkaApi

Usage:

from HdRezkaApi import *

url = "https://hdrezka.ag/   __YOUR_URL__   .html"

rezka = HdRezkaApi(url)
print(rezka.name)
print( rezka.getTranslations() )
print( rezka.getOtherParts() )
print( rezka.getSeasons() )

print( rezka.getStream()('720p') ) # if movie
print( rezka.getStream('1', '1')('720p') )
print( rezka.getSeasonStreams('1') )

self.id - Film id (post_id)

self.name - Film name (post__title)

self.type - video.tv_series or video.movie

self.translators - Translators array

self.seriesInfo - Seasons and Episodes array


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):
	print(str(current) + "/" + str(all))

print( 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. In order not to add None, but simply to ignore, specify the ignore=True parameter.



HdRezkaStream:

self.videos - dict of videos, where key is resolution and value is url

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

HdRezkaStreamSubtitles(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

Project details


Download files

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

Source Distribution

HdRezkaApi-5.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

HdRezkaApi-5.0-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page