Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Torrent api when uploading
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Requests

Unknown User
2019-07-12 16:02:46
[USER=20288]@m-jay[/USER] i saw here on forums for old v2 version someone posted a code to upload torrents into website instead of storing torrents locally.

Any chance to integrate https://itorrents.org/automation.php  like 1337x and other websites?
Unknown User
2019-09-09 16:41:49
I would call that more of a mirroring service for torrents.

I made an actual API uploading service for TT some years ago, the core really needs this feature.
Screen Shot 2019-09-09 at 17.40.14.png
Screen Shot 2019-09-09 at 17.40.14.png
Unknown User
2019-09-09 17:33:04
"mostvotedplaya, post: 67198, member: 20335":

I would call that more of a mirroring service for torrents.

I made an actual API uploading service for TT some years ago, the core really needs this feature.

The problem is that this script which 1337x uses offer automation for old PHP 5.4 - 5.6 only
Unknown User
2019-09-13 09:56:40
[USER=20349]@leoncoder[/USER] let's use some of your php skills here as I heard you are pretty good at it :D

This is what I developed so far


function itorrents_upload($url,$type,$file){
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_HEADER, 0);
       curl_setopt($ch, CURLOPT_VERBOSE, 1);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
       curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
       curl_setopt($ch, CURLOPT_URL, $url);
       curl_setopt($ch, CURLOPT_POST, true);
       $post = array($type=>"@".$file);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
       $response = curl_exec($ch);
       return $response;
}


[ICODE]itorrents_upload('http://itorrents.org/autoupload.php','torrent',"$torrent_dir/$fname ");[/ICODE]
Unknown User
2019-09-16 15:38:14
To explain this. This part doesn't work with PHP 7.2+
$post = array($type=>"@".$file); and for some reason redirects to cloudflare checking browser from itorrents.

Here is a try n.2 ->

Still no luck

 function itorrents_upload($url,$file){

 $ch = curl_init($url);
 curl_setopt($ch, CURLOPT_POST, 1);
 $data = array('name' => 'torrent',            // Don't change
           'type' => 'application/x-bittorrent',
           'file' => $file );
 curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  $response = curl_exec($ch);
  return $response;
}

   itorrents_upload('http://itorrents.org/autoupload.php',"$torrent_dir/$fname");


[USER=20349]@leoncoder[/USER] any input?
2019-09-16 19:30:02
$post = array($type=>"@".$file);
This line is php5.5 @ is depicted you can try some thing like this

$post = array($type=>curl_file_create(.$file)
Unknown User
2019-09-16 20:49:22
"m-jay, post: 67216, member: 20288":

$post = array($type=>"@".$file);
This line is php5.5 @ is depicted you can try some thing like this

$post = array($type=>curl_file_create(.$file)


Still not working.

Try adding

	function itorrents_upload($type,$file){
       $curl = curl_init();
       curl_setopt($curl, CURLOPT_URL, "http://itorrents.org/autoupload.php");
       curl_setopt($curl, CURLOPT_TIMEOUT, 30);
       curl_setopt($curl, CURLOPT_POST, 1);
       curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$post = array($type=>curl_file_create($file));
       curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
       $response = curl_exec($curl);
       curl_close($curl);
       #echo $response;  
}

itorrents_upload('torrent',"$torrent_dir/$id.torrent");


After rename() part into torrents-upload.php

Then create new .torrent file and upload it.

Test if it exists on ittorrents.org/torrent/YOUR_HASH_UPPERCASE.torrent
Unknown User
2019-09-18 13:13:49
They do not provide a curl example, i would recommend installing the pecl extension as they say on their site.
Unknown User
2019-09-18 13:52:18
"mostvotedplaya, post: 67220, member: 20335":

They do not provide a curl example, i would recommend installing the pecl extension as they say on their site.

http_post_fields is deprecated. It won't work.
Unknown User
2019-09-18 14:15:27

<?php



$curl = curl_init();

curl_setopt_array($curl, [

   CURLOPT_URL        => 'https://itorrents.org/autoupload.php',

   CURLOPT_POST       => 1,

   CURLOPT_POSTFIELDS => [

       'file' => new CurlFile('/tmp/the-x-factor-uk-s15e02-720p-hdtv-x264-ftp.torrent', 'application/x-bittorrent', 'the-x-factor-uk-s15e02-720p-hdtv-x264-ftp')

   ],

   CURLOPT_TIMEOUT        => 5,

   CURLOPT_RETURNTRANSFER => 1,

   CURLOPT_HEADER         => 1,

   CURLOPT_USERAGENT      => 'TT/v2.08'

]);

$data = curl_exec($curl);

curl_close($curl);

var_dump($data);


Triggers an error from cloudflare... but even so if that method not available then soap is active in php7
Unknown User
2019-09-18 14:38:48
I dont know how soap works, never used it

PS: Maybe itorrents api doesn't work anymore as their codes are outdated 4-5 years.
Unknown User
2019-09-18 15:13:25
I was thinking about launching my own project which would be like what they offer, if i decide to go along with it then i will make a library for it.
Unknown User
2019-09-18 16:05:00
"mostvotedplaya, post: 67224, member: 20335":

I was thinking about launching my own project which would be like what they offer, if i decide to go along with it then i will make a library for it.

There's already  a public torrage script on github which is used on itorrents.org -> https://github.com/torrage/Torrage
Unknown User
2019-09-18 16:10:42
Indeed, but there are alot of things missing that would significantly improve the script.
Unknown User
2019-09-18 17:55:03
"mostvotedplaya, post: 67226, member: 20335":

Indeed, but there are alot of things missing that would significantly improve the script.


You can always fork it and edit the code :D
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728