A powerful Python library to scrape xvideos.com
Project description
xvideos-py
A powerful Python library to scrape xvideos.com.
💻 Installation
$ 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
Release history Release notifications | RSS feed
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.2.0.tar.gz
(10.8 kB
view details)
Built Distribution
File details
Details for the file xvideos-py-0.2.0.tar.gz
.
File metadata
- Download URL: xvideos-py-0.2.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e7f6cc95b318e4a4177acf97af398cdd99bfc7ce09611b581aa3f424d8f4da4 |
|
MD5 | cc2f869a69262ca897cd1e3cc4c29edb |
|
BLAKE2b-256 | b9103dd1ab6ed867b35a4a5525ab2c70565a3b80cde96c7b5a73193bbf87569f |
File details
Details for the file xvideos_py-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: xvideos_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd7a37399592459b480e1e8461b23e86b08406b58b911c55c7a69c3bf769896 |
|
MD5 | 13cca57793fd863272da885edcf878a4 |
|
BLAKE2b-256 | d115915467c06842c1212c82502a8185290547938b3901431329c459bf4f17ac |