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
Metadata
Release files for xvideos-py 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xvideos-py-0.2.0.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xvideos_py-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.9 kB
Release files / xvideos-py-0.2.0.tar.gz
| Download URL | xvideos-py-0.2.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e7f6cc95b318e4a4177acf97af398cdd99bfc7ce09611b581aa3f424d8f4da4
|
|
BLAKE2b-256 checksum How to use checksums |
b9103dd1ab6ed867b35a4a5525ab2c70565a3b80cde96c7b5a73193bbf87569f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.5
|
Release files / xvideos_py-0.2.0-py3-none-any.whl
| Download URL | xvideos_py-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
acd7a37399592459b480e1e8461b23e86b08406b58b911c55c7a69c3bf769896
|
|
BLAKE2b-256 checksum How to use checksums |
d115915467c06842c1212c82502a8185290547938b3901431329c459bf4f17ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.5
|