EthanC/CallofDuty.py

startTimestamp and endTimestamp arguments do not work for matches search

Closed this issue · 1 comments

Summary

First up. Great work getting this up and running.
Happy to help out improving where I can.

I'm having an issue with the startTimestamp and endTimestamp parameters on the player.matchesSummary() and player.matches() functions returning empty responses regardless of how far back the parameters go.

API call returns 200 so I suspect it's on their side.
I'm not sure how to check whether the param is available on their API so I haven't done this. Maybe you could point me in the right direction.

Reproduction Steps

import asyncio, json, datetime, callofduty, time
from callofduty import Mode, Platform, Title
from decouple import config

client = await callofduty.Login(USER, PASSWORD)
friends = await client.GetMyFriends()

date_start = datetime.datetime(2000,1,1,0,0)
date_start = int(time.mktime(date_start.timetuple()))

date_end = datetime.datetime(2020,6,23,23, 0)
date_end = int(time.mktime(date_end.timetuple()))

print("date_start: %s | date_end: %s\n" % (date_start, date_end))

me = await client.GetMyAccounts()
matches_with = await me[0].matches(Title.ModernWarfare, Mode.Warzone, startTimestamp=date_start, endTimestamp=date_end)
matches_without = await me[0].matches(Title.ModernWarfare, Mode.Warzone)

print("matches with filters: %s" % (len(matches_with) if matches_with else 0))
print("matches without filters: %s" %len(matches_without))

Expected Results

matches with filters: ???? not zero ???
matches without filters: 10

Actual Results

matches with filters: 0
matches without filters: 10

Checklist

  • I have searched the open Issues for duplicates
  • I have shown the entire traceback, if possible
  • I have removed my token from display, if visible

System Information

don't think it's needed.
Python 3.8.2
callofduty.py 1.2.1

Not sure if it's documented somewhere but the API expects timestamps in milliseconds and yours are in seconds.