Arte7 collection support (#819)

* Arte7 collection support
This commit is contained in:
la Bécasse 2018-09-11 23:09:47 +02:00 committed by Teromene
parent c8ace9e3bd
commit 654e502e84

View file

@ -28,6 +28,12 @@ class Arte7Bridge extends BridgeAbstract {
) )
) )
), ),
'Collection (Français)' => array(
'colfr' => array(
'name' => 'Collection id (ex. RC-014095 pour https://www.arte.tv/fr/videos/RC-014095/blow-up/)',
'required' => true
)
),
'Catégorie (Allemand)' => array( 'Catégorie (Allemand)' => array(
'catde' => array( 'catde' => array(
'type' => 'list', 'type' => 'list',
@ -45,6 +51,12 @@ class Arte7Bridge extends BridgeAbstract {
'Sonstiges' => 'AUT' 'Sonstiges' => 'AUT'
) )
) )
),
'Collection (Allemand)' => array(
'colde' => array(
'name' => 'Collection id (ex. RC-014095 pour https://www.arte.tv/de/videos/RC-014095/blow-up/)',
'required' => true
)
) )
); );
@ -54,15 +66,24 @@ class Arte7Bridge extends BridgeAbstract {
$category = $this->getInput('catfr'); $category = $this->getInput('catfr');
$lang = 'fr'; $lang = 'fr';
break; break;
case 'Collection (Français)':
$lang = 'fr';
$collectionId = $this->getInput('colfr');
break;
case 'Catégorie (Allemand)': case 'Catégorie (Allemand)':
$category = $this->getInput('catde'); $category = $this->getInput('catde');
$lang = 'de'; $lang = 'de';
break; break;
case 'Collection (Allemand)':
$lang = 'de';
$collectionId = $this->getInput('colde');
break;
} }
$url = 'https://api.arte.tv/api/opa/v3/videos?sort=-lastModified&limit=10&language=' $url = 'https://api.arte.tv/api/opa/v3/videos?sort=-lastModified&limit=10&language='
. $lang . $lang
. ($category != null ? '&category.code=' . $category : ''); . ($category != null ? '&category.code=' . $category : '')
. ($collectionId != null ? '&collections.collectionId=' . $collectionId : '');
$header = array( $header = array(
'Authorization: Bearer ' . self::API_TOKEN 'Authorization: Bearer ' . self::API_TOKEN