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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xvideos_py-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 c3199e1979b487c26ec1d14a8a5d5271b713822407df38687dd0d90f330a506a
MD5 690ab9bf97a89643bceede9472dc3f1b
BLAKE2b-256 2a20710419c3a9bcd61eb0e67d31cc7b98d07a5ee313f81dbfc47ebfee137873

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xvideos_py-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3e1904256260f98e8d4cabe29c9693cafddbe77960284c5c77a2069d086157f1
MD5 37f6659491af94b68ed0571bc9d184f5
BLAKE2b-256 d6f9d7d28cf163087491a00156b1c85c3471c44e45c57e698aefe721086bfb8b

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