python-ring-doorbell icon indicating copy to clipboard operation
python-ring-doorbell copied to clipboard

Get video URL link faster

Open MantieReid opened this issue 6 years ago • 1 comments

Is there a way to get the video link for the video faster? I have a few hundred videos, and I retrieve the links for each of them by using

      for x in eventidlist:
      adddownloadurl = doorbell.recording_url(x)
      downloasdurl.append(adddownloadurl)
      print(downloasdurl)
      print("download url number of items is now " + str(len(downloasdurl)) )

But it takes forever to get just one link. At least a good 15-30 seconds or more. When I went straight to ring to get the video url, they gave it to me much more faster. Is there a faster way to get the video url for each video?

MantieReid avatar Sep 21 '19 22:09 MantieReid

I don't get why such simple questions do not get any answers, I'd love to know it too...

EDIT: after experimenting I found out that changing the recording_url function in line 316 from:

def recording_url(self, recording_id):
        """Return HTTPS recording URL."""
        if not self.has_subscription:
            msg = "Your Ring account does not have an active subscription."
            _LOGGER.warning(msg)
            return False

        url = API_URI + URL_RECORDING.format(recording_id)
        req = self._ring.query(url, raw=True)
        if req and req.status_code == 200:
            return req.url
        return False

to

def recording_url(self, recording_id):
      url = API_URI + URL_RECORDING.format(recording_id)
      req = self._ring.query(url, raw=True)
      return req.url

will improve the URL grab times from 30 seconds to like 5 secs

nuketownhf avatar Oct 21 '19 12:10 nuketownhf

There hasn't been any activity on this issue recently. This issue has been automatically marked as stale because of that. It will be closed if no further activity occurs. Please make sure to update to the latest ring_doorbell version and check if that solves the issue. Thank you for your contributions.

github-actions[bot] avatar Apr 18 '24 18:04 github-actions[bot]