• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

API does not accept image in URLs with space or "%20"

dr_brown

Chevereto Member
▶🚶‍Reproduction steps
I am writing a python parser that copies text information in html. When processing text, and selecting links to pictures, there are pictures in the URL that may contain spaces. When I try to upload a picture using API, with such a URL I get an error. Although the browser line opens such links normally, all spaces are replaced by% 20 and everything is ok.
Here is an example of a function where I process text and upload pictures by api:
Python:
for image in images:
        try:
            image_clr = urllib.parse.quote(image['src'], safe='-._~:/?#[]@!$&\'()*+,;=')
            pic_req = Request(url_api.format(key_api, image_clr))
            pic = urlopen(pic_req).read().decode('UTF-8')
            if pic == 'Invalid file source':
                continue
        except HTTPError:
            continue
        else:
            upload_image.append(image['src'])
            pic_image.append(pic)

As you can see, I use the line processing function, which clears the URL of unnecessary characters, and saves only those allowed according to the standard RFC 3986.

Python:
 image_clr = urllib.parse.quote(image['src'], safe='-._~:/?#[]@!$&\'()*+,;=')

While I put a temporary "crutch" to handle this error:

Python:
if pic == 'Invalid file source':
                continue

😢Unexpected result

Link Example:


Code:
https://3dnews.ru/assets/external/illustrations/2019/10/30/996521/Annotation 2019-10-30 085631.jpg
- not perceived
Code:
https://3dnews.ru/assets/external/illustrations/2019/10/30/996521/Annotation%202019-10-30%20085631.jpg
- not perceived

📃Error log message


Invalid file source
 
Bug confirmed, already patched. It will be available in the next revision.
 
Back
Top