Skip to content

Commit 5722d73

Browse files
author
agrandiere
committed
Merge branch 'dev'
2 parents 6e1ab40 + dda13cd commit 5722d73

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ composer.phar
33

44
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
55
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
6-
composer.lock
6+
composer.lock
7+
*.iml
8+
9+
*.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ $output = $client->check(['nudity', 'type', 'properties', 'wad', 'face'])->set_b
6262
The first step to detect nudity in a video stream is to submit the video stream to the API.
6363

6464
```php
65-
$client->check(['nudity'])->video('http://www.quirksmode.org/html5/videos/big_buck_bunny.webm', 'https://example.com/yourcallback')
65+
$client->check(['nudity', 'wad'])->video('http://www.quirksmode.org/html5/videos/big_buck_bunny.webm', 'https://example.com/yourcallback')
6666
```
6767

6868
# Feedback

src/Check.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public function set_bytes($image) {
3636
}
3737

3838
public function video($videoUrl, $callbackUrl) {
39-
$url = '1.0/video/moderation.json';
40-
$r = $this->http->request('GET', $url, ['query' => ['api_user' => $this->api_user, 'api_secret' => $this->api_secret, 'stream_url' => $videoUrl,'callback_url' => $callbackUrl]]);
39+
$url = '1.0/video/check.json';
40+
$r = $this->http->request('GET', $url, ['query' => ['api_user' => $this->api_user, 'api_secret' => $this->api_secret, 'stream_url' => $videoUrl,'callback_url' => $callbackUrl, 'models' => $this->models]]);
4141

4242
return json_decode($r->getBody());
4343
}

tests/StackTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function test_nudityModel()
1717
$output2 = $client->check(['nudity'])->set_file(__DIR__ . '/assets/image.jpg');
1818
$this->assertEquals('success', $output2->status);
1919

20-
$output3 = $client->check(['nudity','wad','properties','type','face', 'celebrities'])->set_bytes($binaryFile);
20+
$output3 = $client->check(['nudity','wad','properties','type','faces', 'celebrities'])->set_bytes($binaryFile);
2121
$this->assertEquals('success', $output3->status);
2222
}
2323

@@ -26,13 +26,13 @@ public function test_allModel()
2626
$client = new SightengineClient('1234', 'test');
2727
$binaryFile = fopen(__DIR__ . '/assets/image.jpg', 'r');
2828

29-
$output = $client->check(['nudity','wad','properties','type','face', 'celebrities'])->set_url('https://sightengine.com/assets/img/examples/example5.jpg');
29+
$output = $client->check(['nudity','wad','properties','type','faces', 'celebrities'])->set_url('https://sightengine.com/assets/img/examples/example5.jpg');
3030
$this->assertEquals('success', $output->status);
3131

32-
$output2 = $client->check(['nudity','wad','properties','type','face', 'celebrities'])->set_file(__DIR__ . '/assets/image.jpg');
32+
$output2 = $client->check(['nudity','wad','properties','type','faces', 'celebrities'])->set_file(__DIR__ . '/assets/image.jpg');
3333
$this->assertEquals('success', $output2->status);
3434

35-
$output3 = $client->check(['nudity','wad','properties','type','face', 'celebrities'])->set_bytes($binaryFile);
35+
$output3 = $client->check(['nudity','wad','properties','type','faces', 'celebrities'])->set_bytes($binaryFile);
3636
$this->assertEquals('success', $output3->status);
3737
}
3838

@@ -56,5 +56,13 @@ public function test_feedback()
5656
$feedback4 = $client->feedback('nudity','raw', __DIR__ . '/assets/image.jpg');
5757
$this->assertEquals('success', $feedback4->status);
5858
}
59+
60+
public function test_video()
61+
{
62+
$client = new SightengineClient('1234', 'test');
63+
$output = $client->check(['nudity','wad','properties','type','faces', 'celebrities'])->video('https://sightengine.com/assets/stream/examples/funfair.mp4','http://requestb.in/1nm1vw11');
64+
65+
$this->assertEquals('success', $output->status);
66+
}
5967
}
6068
?>

0 commit comments

Comments
 (0)