Skip to content

RishaanDevz/File-Search-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

File Search API

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.

Live Demo

Try out the web interface at: https://qx2yrxe9wc.ac1.ai/. (you have to start the server and tunnel with loophole, steps are below)

Features

  • 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

Prerequisites

  • Python 3.7+
  • Loophole CLI
  • Flask
  • macOS
  • Open Interpreter

Installation

  1. Clone the repository:
git clone https://github.com/RishaanDevz/File-Search-API
cd File-Search-API
  1. Install dependencies:
pip install flask open-interpreter
  1. 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.

Configuration

  1. Open app.py and replace insert-subdomain-here with your desired Loophole subdomain:
subprocess.run(["loophole", "http", "8000", "--hostname", "your-subdomain"])

Usage

  1. Start the server:
python app.py
  1. 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
}

Web Interface

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

Security Considerations

  • 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.

Future Ideas

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages