MyDlink-API-Python icon indicating copy to clipboard operation
MyDlink-API-Python copied to clipboard

Only getting the first 2 Video URLS

Open fynnsh opened this issue 2 years ago • 0 comments

Hello,

i used the example code

import argparse
import logging

from mydlink_api.mydlink import MyDlink

if __name__ == "__main__":
    logger = logging.getLogger(None)
    logger.setLevel(logging.INFO)

    parser = argparse.ArgumentParser(
        description="API to Connect MyDlink Cloud Devices")
    parser.add_argument('-e', '--email', dest='email', help='MyDlink email example [email protected]')
    parser.add_argument('-p', '--password', dest='password', help='MyDlink password example Start123')
    args = parser.parse_args()

    mydlink = MyDlink(password=args.password, email=args.email, disable_unverified_https_warn=True)

    device_list_json = mydlink.get_device_list()
    device_info_json = mydlink.get_device_details(mac=device_list_json[0]['mac'],
                                                  mydlink_id=device_list_json[0]['mydlink_id'])

    date_list = [2023, 4, 12]
    events_list = mydlink.get_event_list_meta_infos(year=date_list[0], month=date_list[1], day=date_list[2])
    print(events_list)
    mydlink_event_recordings = mydlink.get_mydlink_cloud_recordings_urls(year=date_list[0], month=date_list[1],
                                                                         day=date_list[2])
    print(mydlink_event_recordings)

I only get the first two Links of Videos from that day... Is there a way to get all the Recordings from that day?

Also the feature to get images in an array does not seem to work.. If i just use your Examplecode i get the following error:

Traceback (most recent call last): File "/home/pi/bin/dlink/runner.py", line 30, in <module> cloud_img_list.append(mydlink.get_mydlink_cloud_img_url(mydlink_id=device_list_json[0]['mydlink_id'], File "/usr/local/lib/python3.9/dist-packages/mydlink_api/mydlink.py", line 154, in get_mydlink_cloud_img_url imagepath = response_content['data']['list'][0]['path'] IndexError: list index out of range

fynnsh avatar Apr 12 '23 21:04 fynnsh