-1

I have the following code

$api = new Dailymotion();

$api->setGrantType(
        Dailymotion::GRANT_TYPE_PASSWORD,
        $apiKey,
        $apiSecret,
        array(),
        array(
            'username' => $username, // don't forget to sanitize this,
            'password' => $password, // never use POST variables this way
        )
    );
$store = $api->get(
        '/playlist/'.$playlist_id.'/videos?limit=10&page='.$pageNumber,
        array('fields' => array('id', 'title','owner','channel','url','private_id','poster','thumbnail_url','duration')));

Before 3 days this code It worked very fine fine, but now retrieves empty list for private videos from my list on dailyMotion?

Simon H
  • 2,495
  • 4
  • 30
  • 38
  • Try to see if at least connection to your playlist exists like this https://api.dailymotion.com/playlist/x3ecgj/videos?limit=1&page=1 – Aakash Verma Jun 29 '17 at 10:49
  • Thanks alot for your replay but after the check the result = https://api.dailymotion.com/playlist/x4igln/videos?limit=1&page=1 {"page":1,"limit":1,"explicit":false,"total":0,"has_more":false,"list":[]} – user2401582 Jun 29 '17 at 11:37

1 Answers1

0

Try to see if at least connection to your playlist exists by making a call like this with your own playlist id https://api.dailymotion.com/playlist/x3ecgj/videos?limit=1&page=1.

From your comment it seems, your playlist doesn't have any videos and it is clear now I hope. That is why you are getting back an empty list.

Aakash Verma
  • 3,705
  • 5
  • 29
  • 66
  • No My Dear My playlist contains on 10 videos but all this videos private not public !!! – user2401582 Jun 29 '17 at 11:55
  • Yes, so to access private videos, you need to authorize your application using OAuth2.0. Read [here](https://developer.dailymotion.com/api#authentication) and [here](https://stackoverflow.com/questions/30684636/dailymotion-player-for-private-videos). Maybe your login is unsuccessful or something. – Aakash Verma Jun 29 '17 at 12:01