Skip to content

Commit

Permalink
add reader
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Sep 10, 2024
1 parent 8de7b09 commit 94a638a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
9 changes: 4 additions & 5 deletions ofscraper/actions/actions/download/managers/alt_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,10 @@ async def _download_fileobject_writer(self, total, l, ele, placeholderObj, item)
common_globals.log.debug(
f"{get_medialog(ele)} [attempt {self._alt_attempt_get(item).get()}/{get_download_retries()}] writing media to disk"
)
await self._download_fileobject_writer_streamer(ele, total, l, placeholderObj)
# if total > constants.getattr("MAX_READ_SIZE"):
# await self._download_fileobject_writer_streamer(ele,total, l, placeholderObj)
# else:
# await self._download_fileobject_writer_reader(ele,total, l, placeholderObj)
if total > constants.getattr("MAX_READ_SIZE"):
await self._download_fileobject_writer_streamer(ele,total, l, placeholderObj)
else:
await self._download_fileobject_writer_reader(ele,total, l, placeholderObj)
common_globals.log.debug(
f"{get_medialog(ele)} [attempt {self._alt_attempt_get(item).get()}/{get_download_retries()}] finished writing media to disk"
)
Expand Down
11 changes: 4 additions & 7 deletions ofscraper/actions/actions/download/managers/main_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,10 @@ async def _download_fileobject_writer(
common_globals.log.debug(
f"{get_medialog(ele)} [attempt {common_globals.attempt.get()}/{get_download_retries()}] writing media to disk"
)
await self._download_fileobject_writer_streamer(
r, ele, tempholderObj, placeholderObj, total
)
# if total > constants.getattr("MAX_READ_SIZE"):
# await self._download_fileobject_writer_streamer(r, ele, tempholderObj, placeholderObj, total)
# else:
# await self._download_fileobject_writer_reader(r,ele, tempholderObj,placeholderObj, total)
if total > constants.getattr("MAX_READ_SIZE"):
await self._download_fileobject_writer_streamer(r, ele, tempholderObj, placeholderObj, total)
else:
await self._download_fileobject_writer_reader(r,ele, tempholderObj,placeholderObj, total)
common_globals.log.debug(
f"{get_medialog(ele)} [attempt {common_globals.attempt.get()}/{get_download_retries()}] finished writing media to disk"
)
Expand Down

0 comments on commit 94a638a

Please sign in to comment.