Claude
Skills
Sign in
Back

borrow

Included with Lifetime
$97 forever

Search and borrow media or documents using API. Use when users request to: (1) Search for media across multiple sources, (2) Download content via links, (3) Find media/documents to borrow

Backend & APIsscripts

What this skill does


# Torrent Search & Download

## Prerequisites

- API at `http://localhost:3000`
  ```bash
  # Clone to /tmp and start
  cd /tmp && git clone https://github.com/prateekmedia/Borrow
  cd Borrow && npm install && npm start &
  ```
- `jq` for JSON parsing

## Search

```bash
scripts/search.sh <source> "<query>" [page]
scripts/search.sh piratebay "ubuntu iso" 1
scripts/search.sh yts "big buck bunny" 1
```

### Sources

List available sources:
```bash
scripts/search.sh --list-sources
```

### Get Magnet Link

```bash
# First result
scripts/search.sh piratebay "ubuntu" 1 | head -1 | cut -f4

# Filter by seeders (>10), get first magnet
scripts/search.sh piratebay "ubuntu" 1 | awk -F'\t' '$3+0 > 10 {print $4; exit}'
```

## Download

```bash
# Basic download
node scripts/download.js "magnet:?xt=urn:btih:..." /tmp/downloads

# With custom timeout (default: 10800s)
node scripts/download.js "magnet:?xt=urn:btih:..." /tmp/downloads --timeout 3600

# JSON output for automation
node scripts/download.js "magnet:?xt=urn:btih:..." /tmp/downloads --json
```

## Complete Workflow

```bash
MAGNET=$(scripts/search.sh piratebay "ubuntu iso" 1 | head -1 | cut -f4)
node scripts/download.js "$MAGNET" /tmp/downloads
```

## Troubleshooting

| Issue | Fix |
|-------|-----|
| API not responding | `cd /tmp/Borrow && npm start &` |
| Download slow/hangs | Filter for seeders > 20; try different source |
Files: 3
Size: 11.9 KB
Complexity: 33/100
Category: Backend & APIs

Related in Backend & APIs