reluce / szurubooru-toolkit

Python package and script collection to manage your szurubooru image board.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tag-posts is using working directory as "query" argument

nateify opened this issue · comments

I use Conda on Windows 10 for a virtual Python environment in which I installed szurubooru-toolkit via pip. tag-posts fails due to using the working directory of the terminal as the "query" argument.
After I open CMD I run conda activate booru and then these two commands which fail:
tag-posts.exe --update-implications "id:1"
tag-posts.exe --add-tags "example" "id:1"
Log file:

[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.__init__]: szuru_user = admin
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.__init__]: szuru_url = https://example.booru
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.__init__]: szuru_api_url = https://example.booru/api
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.__init__]: szuru_user = admin
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.__init__]: szuru_url = https://example.booru
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.__init__]: szuru_api_url = https://example.booru/api
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [tag_posts.parse_args]: add_tags = None
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [tag_posts.parse_args]: remove_tags = None
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [tag_posts.parse_args]: update_implications = True
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [tag_posts.parse_args]: query = C:\Users\USER\.conda\envs\booru\Scripts\tag-posts
[DEBUG] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.get_posts]: Getting post from query_url: https://example.booru/api/posts/?query=type%3Aimage%2Canimation+C%3A%5CUsers%5CUSER%5C.conda%5Cenvs%5Cbooru%5CScripts%5Ctag-posts
[CRITICAL] [31.10.2022, 15:47:31 Eastern Daylight Time] [szurubooru.get_posts]: SearchError: Unknown named token: 'c'. Available named tokens: ['ar', 'area', 'aspect-ratio', 'comment', 'comment-count', 'comment-date', 'comment-time', 'content-checksum', 'creation-date', 'creation-time', 'date', 'disliked', 'edit-date', 'edit-time', 'fav', 'fav-count', 'fav-date', 'fav-time', 'feature-count', 'feature-date', 'feature-time', 'file-size', 'flag', 'height', 'id', 'image-ar', 'image-area', 'image-aspect-ratio', 'image-height', 'image-width', 'last-edit-date', 'last-edit-time', 'liked', 'md5', 'note-count', 'note-text', 'pool', 'rating', 'relation-count', 'safety', 'score', 'sha1', 'source', 'submit', 'tag', 'tag-count', 'time', 'type', 'upload', 'uploader', 'width'].
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.__init__]: szuru_user = admin
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.__init__]: szuru_url = https://example.booru
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.__init__]: szuru_api_url = https://example.booru/api
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.__init__]: szuru_user = admin
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.__init__]: szuru_url = https://example.booru
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.__init__]: szuru_api_url = https://example.booru/api
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [tag_posts.parse_args]: add_tags = example
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [tag_posts.parse_args]: remove_tags = None
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [tag_posts.parse_args]: update_implications = False
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [tag_posts.parse_args]: query = C:\Users\USER\.conda\envs\booru\Scripts\tag-posts
[DEBUG] [31.10.2022, 15:48:25 Eastern Daylight Time] [szurubooru.get_posts]: Getting post from query_url: https://example.booru/api/posts/?query=type%3Aimage%2Canimation+C%3A%5CUsers%5CUSER%5C.conda%5Cenvs%5Cbooru%5CScripts%5Ctag-posts
[CRITICAL] [31.10.2022, 15:48:26 Eastern Daylight Time] [szurubooru.get_posts]: SearchError: Unknown named token: 'c'. Available named tokens: ['ar', 'area', 'aspect-ratio', 'comment', 'comment-count', 'comment-date', 'comment-time', 'content-checksum', 'creation-date', 'creation-time', 'date', 'disliked', 'edit-date', 'edit-time', 'fav', 'fav-count', 'fav-date', 'fav-time', 'feature-count', 'feature-date', 'feature-time', 'file-size', 'flag', 'height', 'id', 'image-ar', 'image-area', 'image-aspect-ratio', 'image-height', 'image-width', 'last-edit-date', 'last-edit-time', 'liked', 'md5', 'note-count', 'note-text', 'pool', 'rating', 'relation-count', 'safety', 'score', 'sha1', 'source', 'submit', 'tag', 'tag-count', 'time', 'type', 'upload', 'uploader', 'width'].

Thanks for letting me know. The fix is available in version >0.7.2. Can you quickly test again if it's working for you?

Thanks for the quick fix! It works now.