Как получить более десяти результатов от DailyMotion Video Api? - PullRequest
0 голосов
/ 04 июня 2019

Я использую python для вызова API, он успешно выполняет вызов, но когда я добавляю views_totlal в поле, он ограничивает тягу до 5, независимо от того, сколько я положил для ограничения или разбивки на страницы.Если у меня нет этого поля, я получаю полную запрашиваемую сумму или записи по умолчанию (10 или 100).На канале более 5 видео с количеством просмотров.Вот мой код:

r = d.get('/user/xxxxxxx/videos?sort=visited&fields=thumbnail_480_url,views_total,id,title,likes_total')

Любая идея, что дает или обойти использование API через python или это ошибка на их стороне?

1 Ответ

0 голосов
/ 06 июня 2019

Я пытался воспроизвести вашу проблему, но в обоих случаях я получаю всю информацию:

r = d.get('/user/DailymotionUSA/videos?sort=visited&fields=thumbnail_480_url,views_total,id,title,likes_total&limit=15')

print(json.dumps(r))

r = d.get('/user/DailymotionUSA/videos?sort=visited&fields=thumbnail_480_url,id,title,likes_total&limit=15')

print(json.dumps(r))

Результат:

{
  "page": 1,
  "limit": 15,
  "explicit": false,
  "total": 117,
  "has_more": true,
  "list": [
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/1olai1SufJKvfCijF/x480",
      "views_total": 4701340,
      "id": "xhwpbg",
      "title": "BridgeStone 15 Sec spot",
      "likes_total": 7
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/3L7IG1SunL7OVPKGd/x480",
      "views_total": 461409,
      "id": "xx9evk",
      "title": "The History Channel - Vikings Super Bowl Spot",
      "likes_total": 3
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/1soi51SgrWeOIf4Gt/x480",
      "views_total": 356211,
      "id": "xijg91",
      "title": "SoapBoxRace_15_US_DM_Prestitial",
      "likes_total": 0
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/3NTtN1Siv7i6Umqxo/x480",
      "views_total": 203238,
      "id": "xxmms7",
      "title": "2013 The Oscars Red Carpet Live Stream",
      "likes_total": 7
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/3LCi11Svd6s4ouVfn/x480",
      "views_total": 167418,
      "id": "xx9vy9",
      "title": "2013 Grammy Awards Red Carpet Live Stream",
      "likes_total": 3
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2Vo6O1Sgrf6Ne7Cd5/x480",
      "views_total": 147042,
      "id": "xoxriw",
      "title": "Jennifer Aniston and J.Theroux milk a goat",
      "likes_total": 8
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/2j7zp1SguhjP4ABEH/x480",
      "views_total": 98450,
      "id": "xr0q5v",
      "title": "Playboy Producer For a Day Teaser 1",
      "likes_total": 16
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/3KFRX1SgrW0V1qf5H/x480",
      "views_total": 79681,
      "id": "xx4ich",
      "title": "Official Trailer: Dead Man Down",
      "likes_total": 1
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2XrFk1SvzVBqsuLes/x480",
      "views_total": 67974,
      "id": "xp9a0e",
      "title": "Assassin's Creed 3 - Official Debut Trailer",
      "likes_total": 13
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/26NKY1SguDkqgJf97/x480",
      "views_total": 62389,
      "id": "xkyy3m",
      "title": "Kid Cudi - Mr Rager",
      "likes_total": 59
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2KlDI1S-DXKExQl33/x480",
      "views_total": 60743,
      "id": "xn7pea",
      "title": "Music - The Best! Brightest! Boldest! of 2011",
      "likes_total": 3
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2EdMX1S-DXKl-e2ul/x480",
      "views_total": 54550,
      "id": "xm9axt",
      "title": "Snow White and the Huntsman - Trailer",
      "likes_total": 24
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/1-rMo1S-Cda2MTSbT/x480",
      "views_total": 51503,
      "id": "xjsmuq",
      "title": "Verizon - Rescue",
      "likes_total": 0
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/41vQ91SguvEhgPKv6/x480",
      "views_total": 37585,
      "id": "x14918p",
      "title": "Palo Alto Official Movie Trailer",
      "likes_total": 0
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2lSaj1SrP0z2doZnw/x480",
      "views_total": 36707,
      "id": "xrdru5",
      "title": "Dailymotion & PlayboyTV Present: Zombie Killers",
      "likes_total": 20
    }
  ]
}
{
  "page": 1,
  "limit": 15,
  "explicit": false,
  "total": 117,
  "has_more": true,
  "list": [
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/1olai1SufJKvfCijF/x480",
      "id": "xhwpbg",
      "title": "BridgeStone 15 Sec spot",
      "likes_total": 7
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/3L7IG1SunL7OVPKGd/x480",
      "id": "xx9evk",
      "title": "The History Channel - Vikings Super Bowl Spot",
      "likes_total": 3
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/1soi51SgrWeOIf4Gt/x480",
      "id": "xijg91",
      "title": "SoapBoxRace_15_US_DM_Prestitial",
      "likes_total": 0
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/3NTtN1Siv7i6Umqxo/x480",
      "id": "xxmms7",
      "title": "2013 The Oscars Red Carpet Live Stream",
      "likes_total": 7
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/3LCi11Svd6s4ouVfn/x480",
      "id": "xx9vy9",
      "title": "2013 Grammy Awards Red Carpet Live Stream",
      "likes_total": 3
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2Vo6O1Sgrf6Ne7Cd5/x480",
      "id": "xoxriw",
      "title": "Jennifer Aniston and J.Theroux milk a goat",
      "likes_total": 8
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/2j7zp1SguhjP4ABEH/x480",
      "id": "xr0q5v",
      "title": "Playboy Producer For a Day Teaser 1",
      "likes_total": 16
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/3KFRX1SgrW0V1qf5H/x480",
      "id": "xx4ich",
      "title": "Official Trailer: Dead Man Down",
      "likes_total": 1
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2XrFk1SvzVBqsuLes/x480",
      "id": "xp9a0e",
      "title": "Assassin's Creed 3 - Official Debut Trailer",
      "likes_total": 13
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/26NKY1SguDkqgJf97/x480",
      "id": "xkyy3m",
      "title": "Kid Cudi - Mr Rager",
      "likes_total": 59
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/2KlDI1S-DXKExQl33/x480",
      "id": "xn7pea",
      "title": "Music - The Best! Brightest! Boldest! of 2011",
      "likes_total": 3
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/2EdMX1S-DXKl-e2ul/x480",
      "id": "xm9axt",
      "title": "Snow White and the Huntsman - Trailer",
      "likes_total": 24
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/1-rMo1S-Cda2MTSbT/x480",
      "id": "xjsmuq",
      "title": "Verizon - Rescue",
      "likes_total": 0
    },
    {
      "thumbnail_480_url": "https://s1-ssl.dmcdn.net/v/41vQ91SguvEhgPKv6/x480",
      "id": "x14918p",
      "title": "Palo Alto Official Movie Trailer",
      "likes_total": 0
    },
    {
      "thumbnail_480_url": "https://s2-ssl.dmcdn.net/v/2lSaj1SrP0z2doZnw/x480",
      "id": "xrdru5",
      "title": "Dailymotion & PlayboyTV Present: Zombie Killers",
      "likes_total": 20
    }
  ]
}

У вас есть те же результаты, используя браузер?

...