A Flask-based REST API that enables searching files in your Downloads directory through HTTP endpoints or a web interface. Access your files locally or through a public URL using Loophole tunneling.
Try out the web interface at: https://qx2yrxe9wc.ac1.ai/. (you have to start the server and tunnel with loophole, steps are below)
- Search files by name in Downloads directory
- Filter files by extension
- Get file metadata (name, path, size)
- Web interface for easy searching
- Automatic tunneling via Loophole for public access
- Python 3.7+
- Loophole CLI
- Flask
- macOS
- Open Interpreter
- Clone the repository:
git clone https://github.com/RishaanDevz/File-Search-API
cd File-Search-API
- Install dependencies:
pip install flask open-interpreter
-
Install Loophole CLI following instructions from their website (https://loophole.cloud/download)
- Run
loophole account login
then run the sign in process with the URL and code that loophole provides. Refer to debug-loophole.md if any errors come up.
- Run
- Open
app.py
and replaceinsert-subdomain-here
with your desired Loophole subdomain:
subprocess.run(["loophole", "http", "8000", "--hostname", "your-subdomain"])
- Start the server:
python app.py
- Access the API endpoints:
Search by filename:
GET /search/<search_term>
Example response:
{
"search_term": "document",
"results": [
{
"filename": "document.pdf",
"path": "/Users/username/Downloads/document.pdf",
"size": 1234567
}
],
"count": 1
}
Search by extension:
GET /files/<extension>
Example response:
{
"extension": "pdf",
"results": [
{
"filename": "document.pdf",
"path": "/Users/username/Downloads/document.pdf",
"size": 1234567
}
],
"count": 1
}
Access the user-friendly web interface at https://qx2yrxe9wc.ac1.ai/ to:
- Search files without using API endpoints directly
- View file listings with size information
- Filter by file extensions
- Access your files through an intuitive interface
- The API exposes file information from your Downloads directory
- Use with caution when exposing through Loophole
- Try to make your subdomain something that only YOU would know, and never, EVER, share your loophole URL.
System Integration
- Run as a LaunchDaemon/Service for persistent availability
File Transfer & Notifications
- Email integration for sending found files
- Discord bot integration for file delivery
Enhanced Features
- Content-based search for text files
- Search filters (date, size, type)
- Configurable search locations beyond Downloads folder (eventually be able to search the full system)
Feel free to contribute to any of these features or suggest new ones!