This project provides a command-line interface (CLI) tool to search videos on your Vimeo account using the official Vimeo Python SDK. The tool leverages the Vimeo API to search for videos based on a query string and supports pagination to fetch multiple pages of results.
- Search Videos: Search for videos in your Vimeo account by providing a search string.
- Pagination: Fetch multiple pages of search results.
- Environment Configuration: Securely manage API credentials using a
.env
file. - Customizable Results: Specify the maximum number of results to retrieve.
- Python 3.x
- Vimeo API credentials (Access Token)
-
Clone the Repository
git clone https://github.com/yashasolutions/vimeosearch.git cd vimeosearch
-
Install Dependencies
Use pip to install the required dependencies.
pip install -r requirements.txt
-
Setup Environment Variables
Create a
.env
file in the project directory with your Vimeo API credentials:# https://developer.vimeo.com/ # Create an app - set access preferences and generate token VIMEO_CLIENT_ID="XXX" VIMEO_CLIENT_SECRET="XXX" VIMEO_ACCESS_TOKEN="XXXX"
To search for videos, use the command-line tool as follows:
python vimeo_search.py "your search query" --max_results 100
- search query: The string to search for videos.
--max_results
: (Optional) Maximum number of videos to fetch. Default is 50.
python vimeo_search.py "nature" --max_results 50
This command searches for videos containing the word "nature" in your Vimeo account and fetches up to 50 results.
The tool outputs the search results in JSON format, providing detailed information about each video, including title, files, and more.
If the API request fails, an error message will be displayed with details about the failure.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue.