simpletracker
simpletracker copied to clipboard
[REQUEST] Automatically add new torrent requests
If a torrent client announced from an unregistered torrent, automatically add it to the system.
Easy. If torrent_id not found then add conditional if check with a INSERT statement to a new 'requests' table. In the works.
How would you go about getting the torrent metadata?
Do you mean add torrent to database or add torrent to client?
Add torrent to database.
I would consult an API (check the one on YTS) and retrieve the data and import into database. It's best to roster these requests into a separate table named 'requests' and cycle through the rows on a cron task, while querying the API for meta result.. then scrape that content as a INSERT to torrents table. You must handle BLOB data so utilizing the bencode class appropriately.
If no matching clause is retrieved from API endpoint, then torrent is not found and we continue; the iteration until complete. Be sure to remove matched request rows while retaining request rows for content not found.