Skip to content

Commit

Permalink
Merge pull request #140 from cardenastw/master
Browse files Browse the repository at this point in the history
New get_file serve
  • Loading branch information
N4S4 authored Nov 21, 2023
2 parents d05b67f + 27fe59b commit b7fe2d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synology_api/filestation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations
from typing import Optional, Any
import os
import io
import time
from datetime import datetime

Expand Down Expand Up @@ -1215,4 +1216,9 @@ def get_file(self,
if chunk: # filter out keep-alive new chunks
f.write(chunk)

if mode == r'serve':
with session.get(url, stream=True, verify=verify) as r:
r.raise_for_status()
return io.BytesIO(r.content)

# TODO SYNO.FileStation.Thumb to be done

0 comments on commit b7fe2d5

Please sign in to comment.