chostakovitch / pychee Goto Github PK
View Code? Open in Web Editor NEWClient for Lychee written in Python
License: GNU Affero General Public License v3.0
Client for Lychee written in Python
License: GNU Affero General Public License v3.0
The type hint seems to indicate that there may not be a return for the get_public_album
method, however, it seems like a return should be there, given the description.
Provided the albumID and passwords, return whether the album can be accessed or not. The API won't work if password if empty, even if no password.
âšī¸ See: https://github.com/Chostakovitch/pychee/blob/main/pychee/pychee.py#L161
First of all thanks for this Library. I want to do a sync script which syncs folders in an album with the same name. The easiest ways seems to be pychee. I tried the sample code first and got this error.
Traceback (most recent call last): File "sync_folder.py", line 6, in <module> client = pychee.LycheeClient('https://foto.hans2.de') File "/home/hans/.local/lib/python3.8/site-packages/pychee/pychee.py", line 69, in __init__ csrf_token = unquote(init_response.cookies['XSRF-TOKEN']) File "/usr/lib/python3/dist-packages/requests/cookies.py", line 328, in __getitem__ return self._find_no_duplicates(name) File "/usr/lib/python3/dist-packages/requests/cookies.py", line 399, in _find_no_duplicates raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) KeyError: "name='XSRF-TOKEN', domain=None, path=None"
Any idea what causes this? My Lychee version is 4.5.1.
Thanks!
Hello
This seems to be what I need, I am trying to automate importing large contunously expandin photo collection to Lychee and Lychees native cli-import does not offer fine grained enough control.
Unfortunately I am total beginner in python and have hard time getting up to speed with pychee.
Could you provide couple of basic examples: how to create new album "X" for user 0, how to import photo to album X
Also a question: can pychee import a photo by symlink, its not very clear to me even after reading through https://github.com/Chostakovitch/pychee/blob/main/pychee/pychee.py
As I've been using this library, I've bitten myself a couple times expecting a specific response type that I was not given. I wonder if it would make sense to use Python dataclass
es to help constrain response data-structures into a predictable format, making it easier to program against the Lychee API.
What do you think?
@dataclass
class PhotoData:
some_attribute: str
another_attr: int
...
def get_photo(self, photo_id) -> dict:
"""Get information about a photo."""
data = {'photoID': photo_id}
response = self._session.post('Photo::get', json=data)
response.raise_for_status() # Raises an error if an unexpected HTTP response is returned
return PhotoData(**response.json())
I got this error on my server:
Illuminate\Foundation\Http\FormRequest::failedValidation:155 The album i ds must be an array.
This is how I call it:
lychee.set_albums_title(['4go0N77DsRw60KTJ3LHzUxbC'], 'test')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. đđđ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google â¤ī¸ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.