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.9.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

xvideos_py-0.1.9-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xvideos_py-0.1.9.tar.gz
  • Upload date:
  • Size: 10.9 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.9.tar.gz
Algorithm Hash digest
SHA256 68b4ae081842f8f0806010c3c97374b2cc8f45df22ab3269caa90c50fb355e29
MD5 fac7ec456d2abd1a74adea0ec74c2cf4
BLAKE2b-256 4648b09615830175e060eee8c597623091206bbc6809a6d8bc0025c4642887ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xvideos_py-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 12.2 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c8d0a49cdd6f12ebeff86e4954803adfaeb75a4c272ccaf76f08c0717ce51e15
MD5 1c994ce67da3f72eaee472a6072d8743
BLAKE2b-256 8626ee2862fe43ca1177e43c13d712d8ae00fc62d8f2c52a8cfa37b521531edd

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