Skip to content

Commit 52cb867

Browse files
committed
Skip quads that the user does not have download access to
1 parent 7716b41 commit 52cb867

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

planet/api/downloader.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import threading
1717
import time
1818
from .utils import write_to_file
19-
from planet.api.exceptions import RequestCancelled
19+
from planet.api.exceptions import (RequestCancelled, NoPermission)
2020
try:
2121
import Queue as queue
2222
except ImportError:
@@ -466,9 +466,12 @@ def _task(self, t):
466466
def _do(self, task):
467467
func = self._write_tracker(task, None)
468468
writer = write_to_file(self._dest, func, overwrite=False)
469-
self._downloads += 1
470-
self._results.put((task, {'type': 'quad'},
471-
self._client.download_quad(task, writer)))
469+
try:
470+
self._results.put((task, {'type': 'quad'},
471+
self._client.download_quad(task, writer)))
472+
self._downloads += 1
473+
except NoPermission:
474+
_info('No download permisson for %s, skipping', task['id'])
472475

473476

474477
class _MosaicDownloader(_Downloader):

0 commit comments

Comments
 (0)