Skip to main content

A powerful Python library to scrape xvideos.com

Project description

Here's how you can update your README.md to include the details and download functions for your xvideos-py library.

Updated README.md

# xvideos-py
A powerful Python library to scrape xvideos.com.

## 💻 Installation

```bash
$ pip install xvideos-py

🍑 Usage

🍒 Importing the Library

from xvideos import XVideos

🍒 Retrieve Fresh Videos

xvideos = XVideos()

# Retrieve fresh videos from the first page
fresh = xvideos.fresh(page=1)

# Log details of the retrieved videos
print(fresh['videos'])  # List of video objects with properties like url, path, title, duration, profile, views
print(fresh['pagination']['pages'])  # List of available page numbers

🍒 Retrieve Verified Videos

# Retrieve verified videos from the first page
verified = xvideos.get_verified(page=1)

# Log details of the retrieved videos
print(verified['videos'])  # List of verified video objects with properties like url, path, title, duration, profile, views
print(verified['pagination'])  # List of available page numbers

🍒 Search Videos

# Search for videos with a specific keyword
search_results = xvideos.search(page=1, k="example", sort="relevance")

# Log details of the search results
print(search_results['videos'])  # List of video objects with properties based on the search parameters
print(search_results['pagination'])  # List of available page numbers

🍐 Params explanation

Parameter Default Options
page 1 (any positive integer)
k "" (any search keyword)
sort "relevance" "uploaddate", "rating", "length", "views", "random"
datef "all" "today", "week", "month", "3month", "6month", "all"
durf "allduration" "1-3min", "3-10min", "10min_more", "10-20min", "20min_more", "allduration"
quality "all" "hd", "1080P", "all"
pewmium False False, True

🍒 Retrieve Video Details

# Retrieve details of a specific video
video_url = "https://www.xvideos.com/video12345678/example_video"
details = xvideos.details(video_url)

# Log details of the retrieved video
print(details)  # Dictionary with properties like title, url, duration, image, views, videoType, description, files, models, tags, likePercentage, dislikePercentage, commentsCount

🍒 Download Videos

# Download high-quality version of a specific video
video_url = "https://www.xvideos.com/video12345678/example_video"
filename = "example_video_high"
downloaded_path = xvideos.download_high(video_url, filename)

print(f"High quality video saved at: {downloaded_path}")

# Download low-quality version of a specific video
filename = "example_video_low"
downloaded_path = xvideos.download_low(video_url, filename)

print(f"Low quality video saved at: {downloaded_path}")

🍑 Development

🍒 Running Tests

To run tests, you can use pytest. Ensure you have it installed in your development environment.

$ pytest

🐼 @me

You can find me on twitter as 🐤 @osinthappyemo or on instagram as 🍢 @osintxv

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xvideos_py-0.1.7.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

xvideos_py-0.1.7-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file xvideos_py-0.1.7.tar.gz.

File metadata

  • Download URL: xvideos_py-0.1.7.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for xvideos_py-0.1.7.tar.gz
Algorithm Hash digest
SHA256 2943c97ef91f738d7f9f9cbac9056a445949ca7f2478ec7b044a551294a868b8
MD5 d392c6b2669bd9ac5b0971b37196f2df
BLAKE2b-256 abcddead1810395034d864100a4368a563bf7f1af39ed4ecfdc3ffb6778020f7

See more details on using hashes here.

File details

Details for the file xvideos_py-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: xvideos_py-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for xvideos_py-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 051154af1e87a7bac80ce46bd35f6f5f2923107bfa8fd56c048f6445fa11707b
MD5 5775ac3ef8f7d3e637adffb3dab86a64
BLAKE2b-256 8f3bd3b71a7eb165106baf638e5cff98a92638fa8940b42fc2cde6206f6d2c57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page