From c8e2dd0e316cb2eeda8048eac6c1a633cbd0fb9f Mon Sep 17 00:00:00 2001 From: Johannes Habel Date: Tue, 6 Feb 2024 01:03:44 +0100 Subject: [PATCH] 1.1 --- README/Changelog.md | 9 ++++++++- README/Documentation.md | 44 ++++++++++++++++++++++++++++++++++++++++- setup.py | 2 +- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/README/Changelog.md b/README/Changelog.md index 7bb0084..93df4a5 100644 --- a/README/Changelog.md +++ b/README/Changelog.md @@ -1,3 +1,10 @@ # 1.0 -- Initial Commit \ No newline at end of file +- Initial Commit + +# 1.1 + +- implemented searching +- implemented search filters +- unit tests for searching +- updated documentation \ No newline at end of file diff --git a/README/Documentation.md b/README/Documentation.md index 2ab167d..65763aa 100644 --- a/README/Documentation.md +++ b/README/Documentation.md @@ -1,6 +1,6 @@ # XNXX API Documentation -> - Version 1.0 +> - Version 1.1 > - Author: Johannes Habel > - Copryight (C) 2024 > - License: GPL 3 @@ -19,6 +19,9 @@ The ToS of xvideos.com clearly say, that using scrapers / bots isn't allowed. - [Attributes](#attributes) - [Downloading](#downloading-a-video) - [Custom callback](#custom-callback-for-downloading--videos) +- [Searching Videos](#searching) + - [Basic Search](#basic-search) + - [Using Filters](#using-filters) - [Locals](#locals) - [Quality](#the-quality-object) @@ -119,6 +122,45 @@ def custom_callback(pos, total): When downloading a video, you can just specify your callback functions in the `callback` argument +# Searching + +## Basic Search + +```python +from xvideos_api.xvideos_api import Client + +client = Client() +videos = client.search("Mia Khalifa", pages=2) + +for video in videos: + print(video.title) +``` + +- One Page contains 27 videos +- Search filters are by default the ones from xvideos + +## Using Filters + +```python +from xvideos_api.modules.sorting import SortDate, Sort, SortQuality, SortVideoTime +from xvideos_api.xvideos_api import Client + +client = Client() +videos = Client.search("Mia Khalifa", pages=1, sorting_Date=SortDate.Sort_all, sort_Quality=SortQuality.Sort_720p, + sorting_Sort=Sort.Sort_relevance, sorting_Time=SortVideoTime.Sort_short) + +# If you don't specify filters, the default from xvideos.com will be used! +``` + +- Sort: Sorts videos by relevance, views and stuff +- SortQuality: Sorts videos by their quality +- SortDate: Sorts videos by upload date +- SortVideoTime: Sorts videos by their length + + + + + # Locals diff --git a/setup.py b/setup.py index f8ff4e5..11a3e74 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="xvideos_api", - version="1.0", + version="1.1", packages=find_packages(), install_requires=[ "requests", "bs4", "lxml", "ffmpeg-progress-yield"