HdRezkaApi


NameHdRezkaApi JSON
Version 9.1.0 PyPI version JSON
download
home_pagehttps://github.com/SuperZombi/HdRezkaApi
SummaryHDRezka Python API
upload_time2025-02-16 18:41:17
maintainerNone
docs_urlNone
authorSuper_Zombi
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements beautifulsoup4 requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HdRezkaApi

<img src="https://shields.io/badge/version-v9.1.0-blue"> <a href="#donate"><img src="https://shields.io/badge/💲-Support_Project-2ea043"></a>

## Install:
```
pip install HdRezkaApi
```

## Table of Contents:
1. [Usage](#usage)
2. [Film Information](#film-information)
3. [getStream](#getstream)
4. [getSeasonStreams](#getseasonstreams)
5. [HdRezkaStream](#hdrezkastream)
6. [HdRezkaStreamSubtitles](#hdrezkastreamsubtitles)
7. [HdRezkaRating](#hdrezkarating)
8. [Proxy](#proxy)
9. [Cookies](#cookies)
10. [HdRezkaSearch](#hdrezkasearch)
11. [HdRezkaSession](#hdrezkasession)

<hr>

## 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')) )
```

## Film Information

| Attribute                        | Description                          |
|----------------------------------|--------------------------------------|
| <a id="film-id" href="#film-id">`self.id`</a>| Film ID                  |
| <a id="film-name" href="#film-name">`self.name`</a>| Film name          |
| <a id="film-description" href="#film-description">`self.description`</a>| Film description |
| <a id="film-type" href="#film-type">`self.type`</a> | `HdRezkaTVSeries` or `HdRezkaMovie`  |
| <a id="film-thumbnail" href="#film-thumbnail">`self.thumbnail`</a>     | Film thumbnail URL|
| <a id="film-thumbnailhq" href="#film-thumbnailhq">`self.thumbnailHQ`</a>| Film thumbnail in high quality |
| <a id="film-rating" href="#film-rating">`self.rating`</a> |Film rating ([HdRezkaRating](#hdrezkarating)) |
| <a id="film-otherparts" href="#film-otherparts">`self.otherParts`</a>|Other parts of this film `[{Film_name: url}]`|
| <a id="film-translators" href="#film-translators">`self.translators`</a>|[Translators dict by id](#translators)|
| <a id="film-translators-names" href="#film-translators-names">`self.translators_names`</a>|[Translators dict by names](#translators_names)|
| <a id="film-seriesinfo" href="#film-seriesinfo">`self.seriesInfo`</a>| [Series info](#seriesInfo) by translators|
| <a id="film-episodesinfo" href="#film-episodesinfo">`self.episodesInfo`</a>|All [seasons and episodes](#episodesInfo)|

#### `translators`
```
{
	Translator_id: {
		name: Translator_name,
		premium: bool
	}
}
```
#### `translators_names`
```
{
	Translator_name: {
		id: Translator_id,
		premium: bool
	}
}
```

#### `seriesInfo`
```
{
	Translator_id: {
		translator_name,
		seasons: {1, 2},
		episodes: {
			1: {1, 2, 3},
			2: {1, 2, 3}
		}
	}
}
```

#### `episodesInfo`
```
[
	{
		season: 1, season_text,
		episodes: [
			{
				episode: 1, episode_text,
				translations: [
					{translator_id, translator_name, premium}
				]
			}
		]
	}
]
```

<hr>

### getStream
`getStream(season, episode, translation=None, index=0)`
```
getStream(
    translation='Дубляж' or translation='56' or index=0
)                                               ^ this is index in translators array
```
If type is movie then there is no need to specify season and episode.
```python
stream = rezka.getStream() # if movie
```
<hr>

### getSeasonStreams
`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>

# HdRezkaStream

| Attribute              | Description                                             |
|------------------------|---------------------------------------------------------|
|<a id="stream-videos" href="#stream-videos">`self.videos`</a>|Dict of videos where the key is resolution and value is list of URLs|
|<a id="stream-name" href="#stream-name">`self.name`</a>| Film name                |
|<a id="stream-translatorid" href="#stream-translatorid">`self.translator_id`</a>  | Translator ID |
|<a id="stream-season" href="#stream-season">`self.season`</a> | Season number (`None` if film)    |
|<a id="stream-episode" href="#stream-episode">`self.episode`</a>| Episode number (`None` if film) |
|<a id="stream-subtitles" href="#stream-subtitles">`self.subtitles`</a>| [HdRezkaStreamSubtitles](#hdrezkastreamsubtitles) object|
|<a id="stream-call" href="#stream-call">`HdRezkaStream(resolution)`</a>|Call object with argument to get the URL of the 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 )
```
```
{
	'360p': ['https://sambray.org/...mp4', 'https://stream.voidboost.cc/...mp4'],
	'480p': ['https://sambray.org/...mp4', 'https://stream.voidboost.cc/...mp4'],
	'720p': ['https://sambray.org/...mp4', 'https://stream.voidboost.cc/...mp4'],
}
```


# HdRezkaStreamSubtitles
| Attribute              | Description                   |
|------------------------|-------------------------------|
|<a id="subtitles" href="#subtitles">`self.subtitles`</a>|Dict of subtitles where the key is the language code and value is the subtitle information|
| <a id="subtitles-keys" href="#subtitles-keys">`self.keys`</a>|List of available subtitle language codes|
| <a id="subtitles-call" href="#subtitles-call">`self(id)`</a> |Call object with argument to get URL of subtitles|

### Usage examples:

```python
stream = rezka.getStream(1, 5)

print( stream.subtitles.subtitles )  # { 'en': {'title': 'English', 'link': 'https:/'}, ...  }
print( stream.subtitles.keys )       # ['en', 'ru']
print( stream.subtitles('en') )      # 'https:/'
print( stream.subtitles('English') ) # 'https:/'
print( stream.subtitles(0) )         # 'https:/'
#                       ^ index
```


# HdRezkaRating
| Attribute                         | Description                                      |
|-----------------------------------|--------------------------------------------------|
| <a id="rating-value" href="#rating-value">`self.value`</a> | Rating value (`float`)  |
| <a id="rating-votes" href="#rating-votes">`self.votes`</a> | Number of votes (`int`) |

<hr>

# Proxy
```python
rezka = HdRezkaApi(url, proxy={'http': 'http://192.168.0.1:80'})
```

# Cookies
```python
rezka = HdRezkaApi(url, cookies={"dle_user_id": user_id, "dle_password": password_hash})
```
If you are not sure:
```python
rezka = HdRezkaApi(url, cookies=HdRezkaApi.make_cookies(user_id, password_hash))
```
Manually login:
```python
rezka = HdRezkaApi(url)
rezka.login("your_email@gmail.com", "your_password1234")
```
<hr>

# HdRezkaSearch
`HdRezkaSearch(origin, proxy, headers, cookies)(query, find_all=False)`
### Fast search
```python
results = HdRezkaSearch("https://hdrezka.ag/")("film name")
```
```
[
	{
		'title': 'Film name',
		'url': 'https://hdrezka.ag/__FILM_URL.html',
		'rating': 7.8
	}
]
```
### Advanced search
```python
results = HdRezkaSearch("https://hdrezka.ag/", cookies)("film name", find_all=True)
for page in results:
	for result in page:
		print(result)
```
```
{
	'title': 'Film name',
	'url': 'https://hdrezka.ag/__FILM_URL.html',
	'image': 'https://hdrezka.ag/image.jpg',
	'type': HdRezkaType()
}
```

#### HdRezkaType

`HdRezkaTVSeries`, `HdRezkaMovie`, `HdRezkaCartoon`, `HdRezkaAnime`.

#### All pages
```python
print(results.all_pages)
```
```
[
	[ {'title', 'url', 'image', 'type'}, ...],
	[ {'title', 'url', 'image', 'type'}, ...],
	...
]
```
#### Flatten results
```python
print(results.all)
```
```
[
	{'title', 'url', 'image', 'type'},
	{'title', 'url', 'image', 'type'},
	...
]
```
#### Specific page
```python
print(results.get_page(2)) # page number
# or
print(results[1]) # index
```

[Searching with session](#searching-with-session)
<hr>


# HdRezkaSession
HdRezkaSession allows you to log in once and not send login requests every time.

You can also specify origin to make requests to a same site. Origin in full urls will be ignored.<br>
In the next example, the request will be made to the url: `"https://rezka_mirror.com/__YOUR_URL__.html"`
```python
with HdRezkaSession("https://rezka_mirror.com/") as session:
	session.login("email@gmail.com", "password")
	rezka = session.get("https://hdrezka.ag/__URL_PATH__.html")
```
Also when specifying origin you can specify only url path.
```python
with HdRezkaSession("https://rezka_mirror.com/") as session:
	rezka = session.get("__URL_PATH__.html")
```
<br>

You can also not specify origin and then requests will be made to the URL you specified.<br>
But then you won't be able to use login().
```python
with HdRezkaSession() as session:
	rezka = session.get("https://hdrezka.ag/__URL_PATH__.html")
```
```python
with HdRezkaSession(cookies=cookies, headers=headers, proxy=proxy) as session:
	# or inline seting up
	session.cookies = cookies
	session.headers = headers
	session.proxy = proxy
```

### Searching with session
#### Fast search
```python
with HdRezkaSession("https://rezka_mirror.com/") as session:
	results = session.search("film name")
```
#### Advanced search
```python
with HdRezkaSession("https://rezka_mirror.com/") as session:
	session.login("email@gmail.com", "password")
	results = session.search("film name", find_all=True)
	for page in results:
		for result in page:
			print(result)
```
[More info](#hdrezkasearch)

<hr>

## 💲Donate

<table>
	<tr>
		<td>
			<img width="18px" src="https://www.google.com/s2/favicons?domain=https://donatello.to&sz=256">
		</td>
		<td>
			<a href="https://donatello.to/super_zombi">Donatello</a>
		</td>
	</tr>
	<tr>
		<td>
		<img width="18px" src="https://www.google.com/s2/favicons?domain=https://www.donationalerts.com&sz=256">
		</td>
		<td>
		<a href="https://www.donationalerts.com/r/super_zombi">Donation Alerts</a>
		</td>
	</tr>
</table>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SuperZombi/HdRezkaApi",
    "name": "HdRezkaApi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Super_Zombi",
    "author_email": "super.zombi.yt@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/d4/576890df4515a45bd77a7dfb767504d6bdbebb512cca8c3653e4f1561b9a/hdrezkaapi-9.1.0.tar.gz",
    "platform": null,
    "description": "# HdRezkaApi\r\n\r\n<img src=\"https://shields.io/badge/version-v9.1.0-blue\"> <a href=\"#donate\"><img src=\"https://shields.io/badge/\ud83d\udcb2-Support_Project-2ea043\"></a>\r\n\r\n## Install:\r\n```\r\npip install HdRezkaApi\r\n```\r\n\r\n## Table of Contents:\r\n1. [Usage](#usage)\r\n2. [Film Information](#film-information)\r\n3. [getStream](#getstream)\r\n4. [getSeasonStreams](#getseasonstreams)\r\n5. [HdRezkaStream](#hdrezkastream)\r\n6. [HdRezkaStreamSubtitles](#hdrezkastreamsubtitles)\r\n7. [HdRezkaRating](#hdrezkarating)\r\n8. [Proxy](#proxy)\r\n9. [Cookies](#cookies)\r\n10. [HdRezkaSearch](#hdrezkasearch)\r\n11. [HdRezkaSession](#hdrezkasession)\r\n\r\n<hr>\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## Film Information\r\n\r\n| Attribute                        | Description                          |\r\n|----------------------------------|--------------------------------------|\r\n| <a id=\"film-id\" href=\"#film-id\">`self.id`</a>| Film ID                  |\r\n| <a id=\"film-name\" href=\"#film-name\">`self.name`</a>| Film name          |\r\n| <a id=\"film-description\" href=\"#film-description\">`self.description`</a>| Film description |\r\n| <a id=\"film-type\" href=\"#film-type\">`self.type`</a> | `HdRezkaTVSeries` or `HdRezkaMovie`  |\r\n| <a id=\"film-thumbnail\" href=\"#film-thumbnail\">`self.thumbnail`</a>     | Film thumbnail URL|\r\n| <a id=\"film-thumbnailhq\" href=\"#film-thumbnailhq\">`self.thumbnailHQ`</a>| Film thumbnail in high quality |\r\n| <a id=\"film-rating\" href=\"#film-rating\">`self.rating`</a> |Film rating ([HdRezkaRating](#hdrezkarating)) |\r\n| <a id=\"film-otherparts\" href=\"#film-otherparts\">`self.otherParts`</a>|Other parts of this film `[{Film_name: url}]`|\r\n| <a id=\"film-translators\" href=\"#film-translators\">`self.translators`</a>|[Translators dict by id](#translators)|\r\n| <a id=\"film-translators-names\" href=\"#film-translators-names\">`self.translators_names`</a>|[Translators dict by names](#translators_names)|\r\n| <a id=\"film-seriesinfo\" href=\"#film-seriesinfo\">`self.seriesInfo`</a>| [Series info](#seriesInfo) by translators|\r\n| <a id=\"film-episodesinfo\" href=\"#film-episodesinfo\">`self.episodesInfo`</a>|All [seasons and episodes](#episodesInfo)|\r\n\r\n#### `translators`\r\n```\r\n{\r\n\tTranslator_id: {\r\n\t\tname: Translator_name,\r\n\t\tpremium: bool\r\n\t}\r\n}\r\n```\r\n#### `translators_names`\r\n```\r\n{\r\n\tTranslator_name: {\r\n\t\tid: Translator_id,\r\n\t\tpremium: bool\r\n\t}\r\n}\r\n```\r\n\r\n#### `seriesInfo`\r\n```\r\n{\r\n\tTranslator_id: {\r\n\t\ttranslator_name,\r\n\t\tseasons: {1, 2},\r\n\t\tepisodes: {\r\n\t\t\t1: {1, 2, 3},\r\n\t\t\t2: {1, 2, 3}\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\n#### `episodesInfo`\r\n```\r\n[\r\n\t{\r\n\t\tseason: 1, season_text,\r\n\t\tepisodes: [\r\n\t\t\t{\r\n\t\t\t\tepisode: 1, episode_text,\r\n\t\t\t\ttranslations: [\r\n\t\t\t\t\t{translator_id, translator_name, premium}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n]\r\n```\r\n\r\n<hr>\r\n\r\n### getStream\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 is 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\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\tpercent = round(current * 100 / all)\r\n\tprint(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\tprint(stream)\r\n```\r\n\r\n<hr>\r\n\r\n# HdRezkaStream\r\n\r\n| Attribute              | Description                                             |\r\n|------------------------|---------------------------------------------------------|\r\n|<a id=\"stream-videos\" href=\"#stream-videos\">`self.videos`</a>|Dict of videos where the key is resolution and value is list of URLs|\r\n|<a id=\"stream-name\" href=\"#stream-name\">`self.name`</a>| Film name                |\r\n|<a id=\"stream-translatorid\" href=\"#stream-translatorid\">`self.translator_id`</a>  | Translator ID |\r\n|<a id=\"stream-season\" href=\"#stream-season\">`self.season`</a> | Season number (`None` if film)    |\r\n|<a id=\"stream-episode\" href=\"#stream-episode\">`self.episode`</a>| Episode number (`None` if film) |\r\n|<a id=\"stream-subtitles\" href=\"#stream-subtitles\">`self.subtitles`</a>| [HdRezkaStreamSubtitles](#hdrezkastreamsubtitles) object|\r\n|<a id=\"stream-call\" href=\"#stream-call\">`HdRezkaStream(resolution)`</a>|Call object with argument to get the URL of the 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{\r\n\t'360p': ['https://sambray.org/...mp4', 'https://stream.voidboost.cc/...mp4'],\r\n\t'480p': ['https://sambray.org/...mp4', 'https://stream.voidboost.cc/...mp4'],\r\n\t'720p': ['https://sambray.org/...mp4', 'https://stream.voidboost.cc/...mp4'],\r\n}\r\n```\r\n\r\n\r\n# HdRezkaStreamSubtitles\r\n| Attribute              | Description                   |\r\n|------------------------|-------------------------------|\r\n|<a id=\"subtitles\" href=\"#subtitles\">`self.subtitles`</a>|Dict of subtitles where the key is the language code and value is the subtitle information|\r\n| <a id=\"subtitles-keys\" href=\"#subtitles-keys\">`self.keys`</a>|List of available subtitle language codes|\r\n| <a id=\"subtitles-call\" href=\"#subtitles-call\">`self(id)`</a> |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.subtitles )  # { 'en': {'title': 'English', 'link': 'https:/'}, ...  }\r\nprint( stream.subtitles.keys )       # ['en', 'ru']\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\r\n# HdRezkaRating\r\n| Attribute                         | Description                                      |\r\n|-----------------------------------|--------------------------------------------------|\r\n| <a id=\"rating-value\" href=\"#rating-value\">`self.value`</a> | Rating value (`float`)  |\r\n| <a id=\"rating-votes\" href=\"#rating-votes\">`self.votes`</a> | Number of votes (`int`) |\r\n\r\n<hr>\r\n\r\n# Proxy\r\n```python\r\nrezka = HdRezkaApi(url, proxy={'http': 'http://192.168.0.1:80'})\r\n```\r\n\r\n# Cookies\r\n```python\r\nrezka = HdRezkaApi(url, cookies={\"dle_user_id\": user_id, \"dle_password\": password_hash})\r\n```\r\nIf you are not sure:\r\n```python\r\nrezka = HdRezkaApi(url, cookies=HdRezkaApi.make_cookies(user_id, password_hash))\r\n```\r\nManually login:\r\n```python\r\nrezka = HdRezkaApi(url)\r\nrezka.login(\"your_email@gmail.com\", \"your_password1234\")\r\n```\r\n<hr>\r\n\r\n# HdRezkaSearch\r\n`HdRezkaSearch(origin, proxy, headers, cookies)(query, find_all=False)`\r\n### Fast search\r\n```python\r\nresults = HdRezkaSearch(\"https://hdrezka.ag/\")(\"film name\")\r\n```\r\n```\r\n[\r\n\t{\r\n\t\t'title': 'Film name',\r\n\t\t'url': 'https://hdrezka.ag/__FILM_URL.html',\r\n\t\t'rating': 7.8\r\n\t}\r\n]\r\n```\r\n### Advanced search\r\n```python\r\nresults = HdRezkaSearch(\"https://hdrezka.ag/\", cookies)(\"film name\", find_all=True)\r\nfor page in results:\r\n\tfor result in page:\r\n\t\tprint(result)\r\n```\r\n```\r\n{\r\n\t'title': 'Film name',\r\n\t'url': 'https://hdrezka.ag/__FILM_URL.html',\r\n\t'image': 'https://hdrezka.ag/image.jpg',\r\n\t'type': HdRezkaType()\r\n}\r\n```\r\n\r\n#### HdRezkaType\r\n\r\n`HdRezkaTVSeries`, `HdRezkaMovie`, `HdRezkaCartoon`, `HdRezkaAnime`.\r\n\r\n#### All pages\r\n```python\r\nprint(results.all_pages)\r\n```\r\n```\r\n[\r\n\t[ {'title', 'url', 'image', 'type'}, ...],\r\n\t[ {'title', 'url', 'image', 'type'}, ...],\r\n\t...\r\n]\r\n```\r\n#### Flatten results\r\n```python\r\nprint(results.all)\r\n```\r\n```\r\n[\r\n\t{'title', 'url', 'image', 'type'},\r\n\t{'title', 'url', 'image', 'type'},\r\n\t...\r\n]\r\n```\r\n#### Specific page\r\n```python\r\nprint(results.get_page(2)) # page number\r\n# or\r\nprint(results[1]) # index\r\n```\r\n\r\n[Searching with session](#searching-with-session)\r\n<hr>\r\n\r\n\r\n# HdRezkaSession\r\nHdRezkaSession allows you to log in once and not send login requests every time.\r\n\r\nYou can also specify origin to make requests to a same site. Origin in full urls will be ignored.<br>\r\nIn the next example, the request will be made to the url: `\"https://rezka_mirror.com/__YOUR_URL__.html\"`\r\n```python\r\nwith HdRezkaSession(\"https://rezka_mirror.com/\") as session:\r\n\tsession.login(\"email@gmail.com\", \"password\")\r\n\trezka = session.get(\"https://hdrezka.ag/__URL_PATH__.html\")\r\n```\r\nAlso when specifying origin you can specify only url path.\r\n```python\r\nwith HdRezkaSession(\"https://rezka_mirror.com/\") as session:\r\n\trezka = session.get(\"__URL_PATH__.html\")\r\n```\r\n<br>\r\n\r\nYou can also not specify origin and then requests will be made to the URL you specified.<br>\r\nBut then you won't be able to use login().\r\n```python\r\nwith HdRezkaSession() as session:\r\n\trezka = session.get(\"https://hdrezka.ag/__URL_PATH__.html\")\r\n```\r\n```python\r\nwith HdRezkaSession(cookies=cookies, headers=headers, proxy=proxy) as session:\r\n\t# or inline seting up\r\n\tsession.cookies = cookies\r\n\tsession.headers = headers\r\n\tsession.proxy = proxy\r\n```\r\n\r\n### Searching with session\r\n#### Fast search\r\n```python\r\nwith HdRezkaSession(\"https://rezka_mirror.com/\") as session:\r\n\tresults = session.search(\"film name\")\r\n```\r\n#### Advanced search\r\n```python\r\nwith HdRezkaSession(\"https://rezka_mirror.com/\") as session:\r\n\tsession.login(\"email@gmail.com\", \"password\")\r\n\tresults = session.search(\"film name\", find_all=True)\r\n\tfor page in results:\r\n\t\tfor result in page:\r\n\t\t\tprint(result)\r\n```\r\n[More info](#hdrezkasearch)\r\n\r\n<hr>\r\n\r\n## \ud83d\udcb2Donate\r\n\r\n<table>\r\n\t<tr>\r\n\t\t<td>\r\n\t\t\t<img width=\"18px\" src=\"https://www.google.com/s2/favicons?domain=https://donatello.to&sz=256\">\r\n\t\t</td>\r\n\t\t<td>\r\n\t\t\t<a href=\"https://donatello.to/super_zombi\">Donatello</a>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td>\r\n\t\t<img width=\"18px\" src=\"https://www.google.com/s2/favicons?domain=https://www.donationalerts.com&sz=256\">\r\n\t\t</td>\r\n\t\t<td>\r\n\t\t<a href=\"https://www.donationalerts.com/r/super_zombi\">Donation Alerts</a>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "HDRezka Python API",
    "version": "9.1.0",
    "project_urls": {
        "Homepage": "https://github.com/SuperZombi/HdRezkaApi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4c111ae9b60c450df3a1b17c59ad83838a5d0928778c8f1c580d3fdf2ab5f14",
                "md5": "f21c1cd97ed686a81fd269ae6043561b",
                "sha256": "5b3a0457bf22c8036283c2c42bac676213ff2fa1bc51048049e9a4ff2020c78d"
            },
            "downloads": -1,
            "filename": "HdRezkaApi-9.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f21c1cd97ed686a81fd269ae6043561b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 12456,
            "upload_time": "2025-02-16T18:41:15",
            "upload_time_iso_8601": "2025-02-16T18:41:15.889620Z",
            "url": "https://files.pythonhosted.org/packages/b4/c1/11ae9b60c450df3a1b17c59ad83838a5d0928778c8f1c580d3fdf2ab5f14/HdRezkaApi-9.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7d4576890df4515a45bd77a7dfb767504d6bdbebb512cca8c3653e4f1561b9a",
                "md5": "01ece7afee0f1543e18304dfb1592b84",
                "sha256": "50551bc6ca10da694b526acb66fe13a561dbdaf3dafc011c28810d293e477cd6"
            },
            "downloads": -1,
            "filename": "hdrezkaapi-9.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "01ece7afee0f1543e18304dfb1592b84",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11068,
            "upload_time": "2025-02-16T18:41:17",
            "upload_time_iso_8601": "2025-02-16T18:41:17.949875Z",
            "url": "https://files.pythonhosted.org/packages/c7/d4/576890df4515a45bd77a7dfb767504d6bdbebb512cca8c3653e4f1561b9a/hdrezkaapi-9.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-16 18:41:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SuperZombi",
    "github_project": "HdRezkaApi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "beautifulsoup4",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "hdrezkaapi"
}
        
Elapsed time: 1.05225s