def share(self, *remotepaths: str, password: Optional[str] = None) -> PcsSharedLink: info = self._baidupcs.share(*remotepaths, password=password) link = PcsSharedLink.from_(info)._replace(paths=list(remotepaths), password=password) return link
def list_shared(self, page: int = 1) -> List[PcsSharedLink]: """List shared link on a page To use api, `STOKEN` must be in `cookies` """ info = self._baidupcs.list_shared(page) return [PcsSharedLink.from_(v) for v in info["list"]]
def share(self, *remotepaths: str, password: Optional[str] = None) -> PcsSharedLink: """Share `remotepaths` to public with a optional password To use api, `STOKEN` must be in `cookies` """ info = self._baidupcs.share(*remotepaths, password=password) link = PcsSharedLink.from_(info)._replace(paths=list(remotepaths), password=password) return link
def share(self, *remotepaths: str, password: Optional[str] = None, period: int = 0) -> PcsSharedLink: """Share `remotepaths` to public with a optional password To use api, `STOKEN` must be in `cookies` period (int): The days for expiring. `0` means no expiring """ info = self._baidupcs.share(*remotepaths, password=password, period=period) link = PcsSharedLink.from_(info)._replace(paths=list(remotepaths), password=password) return link
def list_shared(self, page: int = 1) -> List[PcsSharedLink]: info = self._baidupcs.list_shared(page) return [PcsSharedLink.from_(v) for v in info["list"]]