From e116e37648439db730f6c5df7f3b6fdb8e23a17c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 13 May 2016 00:31:57 +0200 Subject: [PATCH 1/7] Transmission client --- .../Command/TransmissionStatsCommand.php | 2 +- src/Transmission/Transmission.php | 68 +++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/Transmission/Transmission.php diff --git a/src/Transmission/Command/TransmissionStatsCommand.php b/src/Transmission/Command/TransmissionStatsCommand.php index 5562602..51fc68e 100644 --- a/src/Transmission/Command/TransmissionStatsCommand.php +++ b/src/Transmission/Command/TransmissionStatsCommand.php @@ -8,9 +8,9 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Command\Command; use Api\ConfigLoader; use Symfony\Component\Console\Input\ArrayInput; -use Vohof\Transmission; use Transmission\Client\GuzzleClient; use Helper\Formater; +use Transmission\Transmission; class TransmissionStatsCommand extends Command { diff --git a/src/Transmission/Transmission.php b/src/Transmission/Transmission.php new file mode 100644 index 0000000..8c4f871 --- /dev/null +++ b/src/Transmission/Transmission.php @@ -0,0 +1,68 @@ + + */ +class Transmission extends BaseTransmission +{ + public function __construct(array $config, ClientAbstract $client = null) + { + parent::__construct($config, $client); + + $this->config = $config; + + foreach(array('host', 'endpoint') as $requirement) + { + if ( ! isset($config[$requirement])) + { + throw new \InvalidArgumentException("Missing argument: $requirement"); + } + } + + if (is_null($client)) + { + $options = array(); + + if (isset($config['username']) and isset($config['password'])) + { + $options = array( + 'request.options' => array( + 'auth' => array($config['username'], $config['password']) + ) + ); + } + + $this->client = new GuzzleClient($config['host'], $options); + } + else + { + $this->client = $client; + } + + $this->client->setEndpoint($config['endpoint']); + } + + // public function add($url, $isEncoded = false, $options = array()) + // { + // $options[$isEncoded ? 'metainfo' : 'filename'] = $url; + + // return $this->client->request('torrent-add', $options); + // } + + // public function foo() + // { + // $options = [ + // 'fields' => static::$fields, + // 'ids' => ['all'], + // ]; + // + // return $this->client->request('torrent-get', $options); + // } +} + From f174796f74c93ded4600dc4d65bbf460e82a561a Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 21 Nov 2016 01:35:25 +0100 Subject: [PATCH 2/7] API domain updated --- src/Api/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index eb1a167..f9c52a0 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -13,7 +13,7 @@ class Client public function __construct() { - $this->client = new GuzzleClient(['base_url' => 'https://api.t411.ch']); + $this->client = new GuzzleClient(['base_url' => 'https://api.t411.li']); } public function getAuthorization($username, $password) From ecb6b89518094e2ad3249fb37f3565ec4be3b6e3 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 25 Mar 2017 22:14:50 +0100 Subject: [PATCH 3/7] Change api.t411.li to api.t411.ai --- src/Api/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index f9c52a0..3eec534 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -13,7 +13,7 @@ class Client public function __construct() { - $this->client = new GuzzleClient(['base_url' => 'https://api.t411.li']); + $this->client = new GuzzleClient(['base_url' => 'https://api.t411.ai']); } public function getAuthorization($username, $password) From cd4fdf792753196093e390140a2d4f3064312400 Mon Sep 17 00:00:00 2001 From: Anthony Tournier Date: Thu, 8 Jun 2017 21:13:11 +0200 Subject: [PATCH 4/7] Update API URL --- src/Api/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index 3eec534..f9adfdd 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -13,7 +13,7 @@ class Client public function __construct() { - $this->client = new GuzzleClient(['base_url' => 'https://api.t411.ai']); + $this->client = new GuzzleClient(['base_url' => 'https://api.t411.al']); } public function getAuthorization($username, $password) From 942c1a880f1e739cdc8acca75ccb73eb6e7a680e Mon Sep 17 00:00:00 2001 From: Anthony Tournier Date: Thu, 8 Jun 2017 21:13:22 +0200 Subject: [PATCH 5/7] Ignore vendor directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 75eb339..5dd6f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ app/config.yml composer.lock tags *.swp +vendor \ No newline at end of file From b820ea081358701c9c00c4462965eeb90d16f9f2 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 28 Jun 2017 23:01:52 +0200 Subject: [PATCH 6/7] Update 'README.md' This project is abandoned, T411 is down. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bf9a6c1..ac6ddd4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**is This project is abandoned. T411 is down since 2017-06-26.** + # t411-console t411-console provides a console line tool for searching torrents on the tracker t411.me. From 0bb857a2886efe417ab15e669e2fd9a64ff56075 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 28 Jun 2017 23:02:23 +0200 Subject: [PATCH 7/7] Update 'README.md' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac6ddd4..79d5818 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**is This project is abandoned. T411 is down since 2017-06-26.** +**This project is abandoned. T411 is down since 2017-06-26.** # t411-console