-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
11 changed files
with
241 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: EPorner API test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest requests bs4 lxml | ||
- name: Test with pytest | ||
run: | | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from ..eporner_api import Client, Gay, Order, LowQuality | ||
|
||
client = Client() | ||
query = "Mia Khalifa" | ||
pages = 2 | ||
per_page = 10 | ||
|
||
|
||
def test_search_1(): | ||
videos = client.search_videos(query, page=pages, per_page=per_page, sorting_gay=Gay.exclude_gay_content, sorting_order=Order.top_rated, sorting_low_quality=LowQuality.exclude_low_quality_content) | ||
for video in videos: | ||
assert len(video.title) > 0 | ||
|
||
|
||
def test_search_2(): | ||
videos = client.search_videos(query, page=pages, per_page=per_page, sorting_gay=Gay.only_gay_content, sorting_order=Order.latest, sorting_low_quality=LowQuality.only_low_quality_content) | ||
for video in videos: | ||
assert len(video.title) > 0 | ||
|
||
|
||
def test_search_3(): | ||
videos = client.search_videos(query, page=pages, per_page=per_page, sorting_gay=Gay.include_gay_content, sorting_order=Order.longest, sorting_low_quality=LowQuality.include_low_quality_content) | ||
for video in videos: | ||
assert len(video.title) > 0 | ||
|
||
|
||
def test_search_4(): | ||
videos = client.search_videos(query, page=pages, per_page=pages, sorting_gay=Gay.exclude_gay_content, sorting_order=Order.shortest, sorting_low_quality=LowQuality.include_low_quality_content) | ||
for video in videos: | ||
assert len(video.title) > 0 | ||
|
||
|
||
def test_search_5(): | ||
videos = client.search_videos(query, page=pages, per_page=per_page, sorting_order=Gay.include_gay_content, sorting_gay=Order.top_weekly, sorting_low_quality=LowQuality.include_low_quality_content) | ||
for video in videos: | ||
assert len(video.title) > 0 | ||
|
||
|
||
def test_search_6(): | ||
videos = client.search_videos(query, page=pages, per_page=per_page, sorting_order=Order.most_popular, sorting_low_quality=LowQuality.include_low_quality_content, sorting_gay=Gay.only_gay_content) | ||
for video in videos: | ||
assert len(video.title) > 0 | ||
|
||
|
||
def test_search_7(): | ||
videos = client.search_videos(query, page=pages, per_page=per_page, sorting_gay=Gay.include_gay_content, sorting_order=Order.top_monthly, sorting_low_quality=LowQuality.include_low_quality_content) | ||
for video in videos: | ||
assert len(video.title) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from ..eporner_api import Client, Quality, Encoding, NotAvailable | ||
|
||
url = "https://www.eporner.com/hd-porn/f8MuayGnGiS/Exciting-Moments-With-Lacey-Duvalle/" | ||
video = Client.get_video(url, enable_html_scraping=True) | ||
|
||
|
||
def test_title(): | ||
assert isinstance(video.title, str) and len(video.title) > 0 | ||
|
||
|
||
def test_video_id(): | ||
assert isinstance(video.video_id, str) and len(video.video_id) > 0 | ||
|
||
|
||
def test_keywords(): | ||
assert isinstance(video.keywords, list) and len(video.keywords) > 0 | ||
|
||
|
||
def test_views(): | ||
assert isinstance(video.views, int) and video.views > 0 | ||
|
||
|
||
def test_rate(): | ||
assert isinstance(video.rate, str) and len(video.rate) > 0 | ||
|
||
|
||
def test_publish_date(): | ||
assert isinstance(video.publish_date, str) and len(video.publish_date) > 0 | ||
|
||
|
||
def test_length_seconds(): | ||
assert isinstance(video.length_seconds, int) > 0 | ||
|
||
|
||
def test_length_minutes(): | ||
assert isinstance(video.length_minutes, str) and len(video.length_minutes) > 0 | ||
|
||
|
||
def test_embed_url(): | ||
assert isinstance(video.embed_url, str) and len(video.embed_url) > 0 | ||
|
||
|
||
def test_thumbnails(): | ||
assert isinstance(video.thumbnails, list) and len(video.thumbnails) > 0 | ||
|
||
|
||
def test_bitrate(): | ||
assert isinstance(video.bitrate, str) and len(video.bitrate) > 0 | ||
|
||
|
||
def test_source_video_url(): | ||
assert isinstance(video.source_video_url, str) and len(video.source_video_url) > 0 | ||
|
||
|
||
def test_rating(): | ||
assert isinstance(video.rating, str) and len(video.rating) > 0 | ||
|
||
|
||
|
||
def test_rating_count(): | ||
assert isinstance(video.rating_count, str) and len(video.rating_count) > 0 | ||
|
||
|
||
def test_author(): | ||
assert isinstance(video.author, str) and len(video.author) > 0 | ||
|
||
|
||
def test_direct_download_url(): | ||
assert isinstance(video.direct_download_link(quality=Quality.BEST, mode=Encoding.mp4_h264), str) | ||
assert isinstance(video.direct_download_link(quality=Quality.HALF, mode=Encoding.mp4_h264), str) | ||
assert isinstance(video.direct_download_link(quality=Quality.WORST, mode=Encoding.mp4_h264), str) | ||
try: | ||
assert isinstance(video.direct_download_link(quality=Quality.BEST, mode=Encoding.av1), str) | ||
assert isinstance(video.direct_download_link(quality=Quality.HALF, mode=Encoding.av1), str) | ||
assert isinstance(video.direct_download_link(quality=Quality.WORST, mode=Encoding.av1), str) | ||
|
||
except NotAvailable: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters