Skip to content

Commit 39d0739

Browse files
committed
fixed Archive.org provider #102
1 parent cc698d5 commit 39d0739

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/Providers/Api/Archive.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public function getType()
5555
}
5656
}
5757

58+
/**
59+
* {@inheritdoc}
60+
*/
61+
public function getProviderName()
62+
{
63+
return 'Internet Archive';
64+
}
65+
5866
/**
5967
* {@inheritdoc}
6068
*/
@@ -76,9 +84,9 @@ public function getAuthorName()
7684
*/
7785
public function getImagesUrls()
7886
{
79-
$images = (array) $this->api->get('misc', 'image');
87+
$images = (array) $this->bag->get('misc[image]');
8088

81-
foreach (array_keys((array) $this->api->get('files')) as $url) {
89+
foreach (array_keys((array) $this->bag->get('files')) as $url) {
8290
$images[] = $url;
8391
}
8492

tests/ArchiveTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,15 @@ public function testOne()
1414
]
1515
);
1616
}
17+
18+
public function testTwo()
19+
{
20+
$this->assertEmbed(
21+
'https://archive.org/details/librivoxaudio',
22+
[
23+
'type' => 'rich',
24+
'providerName' => 'Internet Archive',
25+
]
26+
);
27+
}
1728
}

0 commit comments

Comments
 (0)