Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If --bcl is set as an option, str isn't casted into an int #1323

Closed
nicodoggie opened this issue Feb 28, 2024 · 0 comments
Closed

If --bcl is set as an option, str isn't casted into an int #1323

nicodoggie opened this issue Feb 28, 2024 · 0 comments

Comments

@nicodoggie
Copy link
Contributor

Prerequisites

  • [ x] Did you read FAQ section in readme.md?
  • [ x] Did you test with the latest releases or commit ?
  • [x ] Did you search for existing issues in Issues?

Description

If --bcl is passed as an argument instead as from interactive mode, it isn't parsed as an integer properly a TypeError further down the line

Steps to Reproduce

  1. Run PixivUtil2.py in tags.txt mode with --bcl (example python /home/ensu/.local/share/PixivUtil2/PixivUtil2.py -s 7 --bcl=1000)

Expected behavior: Download images from pixiv with bookmark count configured

Actual behavior: Crash

Log file: snipped to the specific issue

python[40400]:     url = PixivHelper.generate_search_tag_url(tags,
python[40400]:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python[40400]:   File "/home/ensu/.local/share/PixivUtil2/PixivHelper.py", line 938, in generate_search_tag_url
python[40400]:     if blt is not None and blt > 0:
python[40400]:                            ^^^^^^^
python[40400]: TypeError: '>' not supported between instances of 'str' and 'int'
python[40400]: Unknown Error, please check the log file: (<class 'TypeError'>, TypeError("'>' not supported between instances of 'str' and 'int'"), <traceback object at 0x73fed4fa57c0>)

Versions

PixivDownloader2 version 20230105

nicodoggie added a commit to nicodoggie/PixivUtil2 that referenced this issue Feb 28, 2024
Move the bookmark_count casts out of the `else` scope
so that they can be casted even if in non-interactive mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant