HDRezka (rezka.ag) Python API
Project description
HDRezka site API.
Install
pip install HDRezka
Example
import asyncio
from hdrezka import Search
async def main():
player = await (await Search('Breaking Bad').get_page(1))[0].player # or just use await 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 = await player.get_stream(1, 1, translator_id) # raise AJAXFail if invalid episode or translator
video = stream.video
print(video.last_url) # best quality (.m3u8)
print(video[video.min].last_url.mp4, end='\n\n') # worst quality (.mp4)
subtitles = stream.subtitles
print(subtitles.default.url) # subtitles.ru.url or subtitles['Русский'].url
if __name__ == '__main__': asyncio.run(main())
Documentation
CHANGELOG
3.0.2
-
post.urls.kind.VideoURLs
__init__(self, data: str | dict)
now raisesTypeError
ifdata
isn't of typestr | dict
(see this issue)
3.0.1
- Now
__await__
method (needawait ...
expression) insteadainit
method
3.0.0
-
Now a fully asynchronous package.
-
post.page.Page
- Implements
__aiter__
and__anext__
methods that list all the pages found. - Instead of
get_pages
, now only theget_page
method
- Implements
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 toAJAX
(PEP-8) -
the
get_stream
method now contains thevideo
attribute and thesubtitle
attribute -
urls
- New function
urls_from_ajax_response -> URLs
- New function
-
urls.short
short_url
,long_url
-
urls.kind
- class
Quality
now inurls.king.quality
(also in __init__)
- class
-
urls.kind.video
- classes
VideoURL
,VideoURLs
- classes
-
urls.kind.subtitle
- classes
SubtitleURL
,SubtitleURLs
- classes
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 toapi.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 withEmptyPage
-
New submodule
post.page
-
post.page
- new
Page
class that will parse any page rezka.ag onInlineItem
(new data class)
- new
-
api.search
Search
now inherited fromPage
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 ispost.urls
-
post.urls
short_url
andlong_url
functions added (caching)short_url
,long_url
,Quality
,URL
now in__all__
-
post.info.fields
- classes
Rating
,Place
,Release
,AgeRating
,Duration
,Poster
created
- classes
0.0.2
- initial version
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.