PHPackages                             tryhackx/flarum-magnet-link - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tryhackx/flarum-magnet-link

ActiveFlarum-extension

tryhackx/flarum-magnet-link
===========================

Magnet Link BBCode extension for Flarum with tracker scraping and click counting

2.0.6(1mo ago)164↓50%MITPHPPHP ^8.2

Since Mar 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/TryHackX/flarum-magnet-link)[ Packagist](https://packagist.org/packages/tryhackx/flarum-magnet-link)[ RSS](/packages/tryhackx-flarum-magnet-link/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

**TryHackX Magnet Link**
========================

[](#tryhackx-magnet-link)

A powerful, secure, and highly customizable extension for Flarum that allows users to seamlessly share and manage Magnet links.

It provides real-time BitTorrent tracker scraping, click statistics, advanced security (hiding raw URIs behind secure hashes), and interactive UI elements like discussion tooltips and custom names.

**🚀 Versions &amp; Compatibility**
----------------------------------

[](#-versions--compatibility)

This extension is developed in parallel to support both legacy and modern Flarum installations:

- **Version 2.x (Current: 2.0.6):** Fully compatible with the latest Flarum 2.x routing and frontend architecture.
- **Version 1.x (Current: 1.0.6):** Supports legacy Flarum 1.8.0 and above.

**✨ Features**
--------------

[](#-features)

### **Core Functionality**

[](#core-functionality)

- **Secure Embedding**: Raw magnet URIs are never exposed in the HTML source code. They are protected by SHA256 tokens and retrieved securely via API. Guests cannot see or access magnet links in any way (if restricted).
- **Text Editor Integration**: Adds a handy magnet icon to the Flarum text editor, allowing users to quickly wrap selected text or insert the \[magnet\]\[/magnet\] BBCode.
- **Multilingual**: Full support for English and Polish languages.

### **Real-Time Statistics (Scraper)**

[](#real-time-statistics-scraper)

- **Tracker Scraping**: Scrapes HTTP/HTTPS/UDP trackers to display live **Seeders, Leechers, and Completed** downloads (powered by the Scrapeer library).
- **Advanced Display Options**: Choose between showing average stats, average max downloads, or max overall stats across all trackers.
- **Performance Control**: Configurable timeouts and max tracker limits to ensure forum performance isn't impacted.
- **Manual Refresh**: Users can click the refresh button on any magnet link to fetch the latest swarm statistics instantly.

### **Interactive UI Enhancements**

[](#interactive-ui-enhancements)

- **Discussion List Tooltips**: Hovering over a discussion on the homepage reveals a clean tooltip displaying the magnet links inside it along with their current stats.
- **Frontend Caching**: Implemented a 5-minute client-side cache for both individual magnet links and discussion tooltips to significantly reduce API calls.
- **Custom Magnet Names**: Post authors can rename their magnet links directly from the frontend UI without editing the raw post content.
- **File Size Display**: Extracts and formats human-readable file sizes (if provided in the magnet URI xl= parameter).

### **Analytics &amp; Protection**

[](#analytics--protection)

- **Click Tracking**: Live-updating click counters for each magnet link. Shared counters ensure the same link used across different posts shares the exact same statistics.
- **Anti-Spam &amp; IP Banning**: Built-in protection against click-spamming, including configurable cooldowns, self-click intervals, and temporary IP bans.

### **Access Control**

[](#access-control)

- **Granular Permissions**: Restrict viewing of magnet links based on Flarum User Groups.
- **Email Confirmation**: Option to require users to have confirmed email addresses before viewing links.
- **Guest Control**: Hide or show magnet links to unregistered guests.

**🔐 How it Works (Security)**
-----------------------------

[](#-how-it-works-security)

1. The user inserts \[magnet\]magnet:?xt=...\[/magnet\] into a post.
2. Upon saving the post, the magnet link is validated, saved to the database, and **replaced with a unique SHA256 token**.
3. In the page HTML, **ONLY** the token is visible. The actual magnet URI is never exposed.
4. When a user clicks the link, JavaScript sends the token to the API.
5. The API validates permissions (Group, Guest status, Email verification) and returns the magnet link **only** to authorized users.
6. The browser opens the magnet link.

**📦 Installation**
------------------

[](#-installation)

Choose the command corresponding to your Flarum version:

**For Flarum 2.x:**

```
composer require tryhackx/flarum-magnet-link:"^2.0"
```

**For Flarum 1.x:**

```
composer require tryhackx/flarum-magnet-link:"^1.0"
```

### **🔄 Updating**

[](#-updating)

```
composer update tryhackx/flarum-magnet-link
php flarum migrate
php flarum cache:clear
```

**⚙️ Configuration**
--------------------

[](#️-configuration)

Go to your Flarum Administration Panel → Extensions → Magnet Link.

1. **General &amp; Visibility Settings**: Control who can see magnet links (Guests, Unverified Users) and set up group permissions.
2. **Scraper Settings**: Enable/disable the tracker scraper, enforce HTTP(S)-only trackers (useful if your host blocks UDP), and adjust display logic (Average vs Max).
3. **Click Tracking &amp; Bans**: Configure intervals, max clicks, and temporary ban durations for spam protection.
4. **Display &amp; UI**: Enable the discussion list tooltip, set the maximum number of magnets to preview, and allow post authors to rename their links.

**🛠 Usage**
-----------

[](#-usage)

Users can simply paste a magnet link wrapped in the BBCode, use the editor button, or highlight text and click the editor button:

\[magnet\]magnet:?xt=urn:btih:EXAMPLEHASH&amp;dn=Example.File\[/magnet\]

**Database Structure**
----------------------

[](#database-structure)

- magnet\_links - Stores tokens, info hashes, and encrypted full URIs.
- magnet\_clicks - Stores click history.
- magnet\_bans - Stores temporary IP bans.
- magnet\_custom\_names - Stores custom display names set by post authors.

**🚨 Troubleshooting**
---------------------

[](#-troubleshooting)

- **UDP Trackers are not working:** Enable the "HTTP(S) Trackers Only" option in settings or ensure the sockets PHP extension is installed and enabled on your server.
- **500 Error from API:** Check your Flarum/PHP logs. Ensure that you have run the migrations: php flarum migrate.
- **Links are not rendering:** Clear the Flarum cache: php flarum cache:clear.

**🔗 Links &amp; Credits**
-------------------------

[](#-links--credits)

- [GitHub Repository](https://github.com/TryHackX/flarum-magnet-link)
- [Report an Issue](https://github.com/TryHackX/flarum-magnet-link/issues)
- Scraper library: [Scrapeer](https://github.com/medariox/scrapeer) by medariox
- Extension author: TryHackX © 2026

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance88

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

4

Last Release

59d ago

Major Versions

1.0.2 → 2.0.02026-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/21efa76fc04b119116af8bed43651ffee8de017be7318127f6e3996dc29b0974?d=identicon)[TryHackX](/maintainers/TryHackX)

---

Tags

extensiontorrentbbcodeflarumtrackermagnet

### Embed Badge

![Health badge](/badges/tryhackx-flarum-magnet-link/health.svg)

```
[![Health](https://phpackages.com/badges/tryhackx-flarum-magnet-link/health.svg)](https://phpackages.com/packages/tryhackx-flarum-magnet-link)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

13126.1k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

2033.8k](/packages/flarum-lang-french)[flarum/gdpr

Features for GDPR, PII management

1425.2k15](/packages/flarum-gdpr)[fof/subscribed

Additional user subscriptions for your forum

1327.5k2](/packages/fof-subscribed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
