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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xvideos_py-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 565ae8f87ea0f144f1cf98a5b25eec8c12455ed11163797f38b99d4d5e824931
MD5 96eeaf429c9c5ae866427c799a9f44cf
BLAKE2b-256 6befa529e652254ab167a5c27b4f1e870ee719dfbd9ed305bd8794265547279a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xvideos_py-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 de0e6f7cbed099a0010610e84c5918500fa926aef528a901e246e0a314b238f5
MD5 c8cde5d62587a48b00aa52c77dd32ff9
BLAKE2b-256 75ff76697b00ea8f2220f437a29357003fbceacdc3d0eda4c3ae23ec0949b412

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