Autoblog de Mitsukarenai

Ce site n'est pas le site officiel de Mitsukarenai
C'est un blog automatisé qui réplique les articles de

Magnetik NyaaTorrents

Sun, 27 May 2012 15:04:12 +0000 - (source)


(r4 is in testing phase)



* = Magnetik = *

* Lightweight Infohash Database *


[ changelog ]

{release 4 – Nyaa}


- torrent information now depending on NyaaID

- database structure changed: « ref » becomes « info », « track » becomes « stat »

- info table: nyaaid, cat, date, submitter, btih, name, tname, size

- stat table: nyaaid, updated, seed, leech

** introducing NyaaID storage (torrent id on Nyaa), category storage (categories from Nyaa), submit date (date of submission of torrent on Nyaa), submitter (username on Nyaa)

- add.php handles more parameters

- fulldb.php and search.php show NyaaID, category, download button, seed/leech-count.

- index.php shows the new things of the database

- search.php now refuses any search string below 3 characters, and returns a maximum of 100 results (most recent)

- NEW: rss.php (last 100)

- NEW: fulldb.php with modes: « nyaaid » for nyaaids, « btih » for BTIH, « xml » for a XML database dump and « csv » for a csv database dump

- torrent detail now has link back to Nyaa

- fulldb.php has a « jump to page X » function

- fulldb.php lists in decending order (most recent at page 1)

- search.php and index.php adapted to search for name or submitter

- minor CSS tweaks

{release 3 – Nyaa}

- moar comments !

- added fixes to insert « bizarre » torrent names correctly

- name transmission, stored separately from torrent name (make sure to replace « & » by something else like « and » in the GET request, or the name will be cut – take a look at the bash feeders)

- limited output, pagination and counts for fulldb.php

- information update (update.php)

- countermesure against « database locked » (busyTimeout lets it breathe up to 10 seconds)

- config.php now including footer (to easily add tracking javascripts, or stuff)

{release 2 – Nyaa}

-fork for NyaaTorrents (download and parsing of torrent files)

-database structure simplified

{release 1}

-first public release, working HTML, insertion, search and full listing.

[ how Magnetik was born ]

In the 23th, February 2012, some time after Megaupload’s shutdown, many concerns appeared about The Pirate Bay (for example, DNS censoring in UK). While the P2P structure allows the data to remain even if the website is shut down, the BitTorrent technology is lacking a real search function. BitTorrent should be as decentralized as possible, and therefor the usage of .torrent files should be avoided (the connections being established with the DHT).

While better solutions are integrated in the BitTorrent clients (like the gossip-protocol search of Tribler), one can simply host a « little Pirate Bay » that, in combination with the search engines, should provide many many different sources from where getting the most important information about a torrent (it’s name, btih and size – well we can add the seed- and leechcount, giving a hint of the torrent’s popularity).

I started working with a full-PHP system, the torrent data being stored in infohash-named PHP files. Well it IS working, but created thousands of little files in the db/ subfolder.

Manipulating a real database ? Well ok, but it shouldn’t rely on a heavyweight like MySQL or PostGreSQL (not very easy to backup and restore). So I started messing around with SQLite3. And here we are :)

[ SQLite3 ? Does it work on my hosting ? ]

Better check out before you get started ! My secondary host supports both SQLite2 and SQLite3, it didn’t helped me when I writed the queries. Hopefully it’s 100% SQLite3 and has maximal compatibility.

Take a look at phpinfo() if SQLite3 is enabled on your hosting. If something’s wrong, please report and suggest fixes :)


- customize « config.php » (you may want to change the title, description, the CSS, the table structure… and the addition password !)

- upload

- begin populating your database with add.php (the file is commented, read it !)

Quite straightforward: add.php?p=password&id=id&s=seed&l=leech&n=name

>> it is recommended to do this with a bash script, parsing the HTML to extract the data, then GET-ing it to add.php with wget –spider

>> you may want to do this in a SSL context (HTTPS) to avoid internet service provider sniffing


Quite straightforward: update.php?p=password&id=id&s=seed&l=leech


The author of this software doesn’t encourage counterfeit content distribution.

The author cannot be held liable of any misuse of this software. The code is neutral, only a human can do illegal things with it.

It is the user’s sole responsability for downloading and sharing illegal content.

The information returned by the database can be inaccurate, obsolete or plain fake: automated processes can’t always succeed.

To comply with some countries’ laws, the hostmaster can be asked to remove manually any information about an obviously illegal torrent in the database.

flattr this!

Powered by VroumVroumBlog 0.1.31 - RSS Feed
Download config articles