Skip to content

Commit f8a4f8f

Browse files
committed
- optimized imports
1 parent 672bf6d commit f8a4f8f

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pip install --upgrade git+https://github.com/EchterAlsFake/EPorner_API.git
5252

5353

5454
```python
55-
from eporner_api.eporner_api import Client, Quality
55+
from eporner_api import Client, Quality
5656
# Initialize a Client object
5757
client = Client()
5858

README/Documentation.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ If you are using this, you may face legal actions, so it's at your own risk!
3939
# Importing the API
4040

4141
```python
42-
from eporner_api.eporner_api import Client, Quality
43-
from eporner_api.modules.errors import * # These are the exceptions
44-
from eporner_api.modules.sorting import * # These are sorting used for searching
42+
from eporner_api import Client, Quality, errors, sorting
4543
```
4644

4745

@@ -50,7 +48,7 @@ from eporner_api.modules.sorting import * # These are sorting used for searchin
5048
The video object has the following attributes:
5149

5250
```python
53-
from eporner_api.eporner_api import Client, Quality, Encoding
51+
from eporner_api import Client, Quality, Encoding
5452

5553
client = Client()
5654
video = client.get_video("<video_url>", enable_html_scraping=False)
@@ -125,7 +123,7 @@ Your function needs to take the arguments `pos` and `total`
125123
It's as simple as doing:
126124

127125
```python
128-
from eporner_api.eporner_api import Client
126+
from eporner_api import Client
129127
client = Client()
130128
pornstar = client.get_pornstar("https://www.eporner.com/pornstar/riley-reid/", enable_html_scraping=True)
131129
videos = pornstar.videos(pages=2)
@@ -143,7 +141,7 @@ for video in videos:
143141
You can search videos using
144142

145143
```python
146-
from eporner_api.eporner_api import Client
144+
from eporner_api import Client
147145

148146
client = Client()
149147
videos = client.search_videos(query, etc...)
@@ -170,7 +168,7 @@ Returns a [Video](#video-object) Object (as a Generator)
170168
You can also get Videos by a Category
171169

172170
```python
173-
from eporner_api.eporner_api import Client, Category
171+
from eporner_api import Client, Category
174172

175173
videos = Client().get_videos_by_category(category=Category.ASIAN) # or something else,
176174

@@ -208,7 +206,7 @@ The Quality object has three types:
208206

209207

210208
```python
211-
from base_api.modules.quality import Quality
209+
from eporner_api import Quality
212210

213211
quality = Quality.BEST
214212
quality = Quality.HALF
@@ -226,10 +224,9 @@ Videos on EPorner are available in AV1 and MP4 (H264) format.
226224
<br>I recommend MP4 (H264)
227225

228226
```python
229-
from eporner_api.modules.locals import Encoding
230-
231-
encoding = Encoding.mp4_h264 # Recommended!
232-
encoding = Encoding.av1
227+
from eporner_api import locals
228+
encoding = locals.Encoding.mp4_h264 # Recommended!
229+
encoding = locals.Encoding.av1
233230
```
234231

235232

@@ -247,9 +244,9 @@ The sorting objects are needed for searching.
247244
- top_weekly
248245
- top_monthly
249246
```python
250-
from eporner_api.modules.sorting import Order
247+
from eporner_api import sorting
251248

252-
order = Order.latest
249+
order = sorting.Order.latest
253250
# etc...
254251
```
255252

@@ -259,9 +256,9 @@ order = Order.latest
259256
- only_gay_content
260257

261258
```python
262-
from eporner_api.modules.sorting import Gay
259+
from eporner_api import sorting
263260

264-
gay = Gay.exclude_gay_content
261+
gay = sorting.Gay.exclude_gay_content
265262
# etc...
266263
```
267264

@@ -272,9 +269,9 @@ gay = Gay.exclude_gay_content
272269
- only_low_quality_content
273270

274271
```python
275-
from eporner_api.modules.sorting import LowQuality
272+
from eporner_api import sorting
276273

277-
quality_sorting = LowQuality.exclude_low_quality_content
274+
quality_sorting = sorting.LowQuality.exclude_low_quality_content
278275
# etc...
279276
```
280277

@@ -283,9 +280,9 @@ quality_sorting = LowQuality.exclude_low_quality_content
283280
All categories are in the Category class.
284281
```python
285282

286-
from eporner_api.modules.locals import Category
287-
Category.AMATEUR
288-
Category.ASMR
283+
from eporner_api import locals
284+
locals.Category.AMATEUR
285+
locals.Category.ASMR
289286

290287
# etc...
291288
```

eporner_api/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__all__ = ["Client", "locals", "Quality", "progressbar", "sorting", "errors", "consts",
2+
"Video"]
3+
4+
from eporner_api.eporner_api import *
5+
from eporner_api.modules import locals, progressbar, sorting, errors, consts

eporner_api/eporner_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import html
2-
32
import requests
43
import json
54
import argparse

0 commit comments

Comments
 (0)