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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file xvideos-py-0.1.8.tar.gz.

File metadata

  • Download URL: xvideos-py-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 abd826f0ed13ed4d8a4cae98b9502793cd9a4a8b12fcca8d5a6718f6de0f7902
MD5 09142fd370a49f2314fca59ca07b2ab3
BLAKE2b-256 1a49a27feb4abc49532ede2d0657c951dd26cc3ae8499b287d4b74084a47b719

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xvideos_py-0.1.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3850a67c6e14c4f70a300d95823f470c53d7cabd6f5512c6e4992cf1847b7e01
MD5 1bcb4a16ef2fb1a2de89bb97ac549da0
BLAKE2b-256 819881e27917ef80f5beb0cd1608ed8ebfa5503f4c540c23d76f2982872801d0

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