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

Cannot download images when the tag has ampersand and semicolon #13

Closed
dyskette opened this issue Jan 3, 2017 · 5 comments
Closed

Cannot download images when the tag has ampersand and semicolon #13

dyskette opened this issue Jan 3, 2017 · 5 comments

Comments

@dyskette
Copy link

dyskette commented Jan 3, 2017

Examples:

ruby danbooru.rb -b konachan -d ~/Pictures 'allison_&_lillia'
ruby danbooru.rb -b konachan -d ~/Pictures 'robotics;notes'

These create a folder with the tag, the file files.bbs inside, and exits.

@dyskette dyskette changed the title Cannot download images when the tag has ampersand Cannot download images when the tag has ampersand and semicolon Jan 3, 2017
xeron added a commit that referenced this issue Jan 5, 2017
xeron added a commit that referenced this issue Jan 5, 2017
@xeron xeron closed this as completed in 2ee19a0 Jan 5, 2017
xeron added a commit that referenced this issue Jan 5, 2017
Use CGI.encode for parameters. Fixes #13.
@xeron
Copy link
Owner

xeron commented Jan 5, 2017

@dyskette thank you for reporting this! Should be fixed now.

The problem was related to usage of ruby's URI.escape which is actually deprecated and doesn't follow RFC. I removed it completely and now using CGI.escape to encode parameters.

@dyskette
Copy link
Author

dyskette commented Jan 5, 2017

Right, thank you.

The escaping is fixed, and now those tags work. However, now it just takes one tag. If I put 2 or more, it prints the tags in the terminal, creates the folder (with bbs file inside) and exits.

@xeron
Copy link
Owner

xeron commented Jan 6, 2017

Oh shi~

So I should escape everything except + because they use + for tags separation.

@xeron
Copy link
Owner

xeron commented Jan 6, 2017

Fixed in #16.

@dyskette
Copy link
Author

dyskette commented Jan 6, 2017

Confirmed, it works OK now. Thanks.

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

2 participants