# In a Web Sources script, having \[\] characters in "IndexUrl" results in: "Error connecting to server - provided uri is invalid"

**URL:** https://community.mp3tag.de/t/in-a-web-sources-script-having-characters-in-indexurl-results-in-error-connecting-to-server-provided-uri-is-invalid/63726
**Category:** Web Sources Discussion
**Created:** [February 10, 2024, 11:21am UTC](https://community.mp3tag.de/t/in-a-web-sources-script-having-characters-in-indexurl-results-in-error-connecting-to-server-provided-uri-is-invalid/63726 "2024-02-10T11:21:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ricky](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/439d5e/32.png) [@ricky](https://community.mp3tag.de/u/ricky)
#### Post date: [February 10, 2024, 11:21am UTC](https://community.mp3tag.de/t/in-a-web-sources-script-having-characters-in-indexurl-results-in-error-connecting-to-server-provided-uri-is-invalid/63726/1 "2024-02-10T11:21:10Z")

</div>

The issue is that, in a Web Sources script, having `[]` characters in `IndexUrl` results in:  
`Error connecting to server: provided uri is invalid:`

&nbsp;  
In details:  
I'm trying to modify the [Metal-Archives web source script](https://github.com/antonio-gil/Mp3Tag_WS_MetalArchives/blob/master/Me%26tal%20Archives%23Search%20by%20Band%20%2B%20Album.src) in order to display all versions (CD, cassette, vinyl) of an album, not just the first match.

That's why I tried to append to `IndexUrl` in its [line 28](https://github.com/antonio-gil/Mp3Tag_WS_MetalArchives/blob/b64cf1bc6e180f14929c1b9f253fe8e56de02821/Me%26tal%20Archives%23Search%20by%20Band%20%2B%20Album.src#L28) the following:  
`releaseFormat[]=CD&releaseFormat[]=Cassette`  
i.e.:  
to become

```auto
[IndexUrl]=https://www.metal-archives.com/search/ajax-advanced/searching/albums/?releaseFormat[]=CD&releaseFormat[]=Cassette

```

but unfortunately I'm getting e.g. this:  
 ![2024-02-10_012112](https://community.mp3tag.de/uploads/default/original/3X/0/8/0895848fffc59aae2fe7c100749c699c757887d7.jpeg)

And, If I omit the `[]` chars, i.e.

```auto
[IndexUrl]=https://www.metal-archives.com/search/ajax-advanced/searching/albums/?releaseFormat=CD&releaseFormat=Cassette

```

then I don't get the above error, but that URL is wrong and naturally returns no results:  
 ![Screenshot 2024-02-10 125123](https://community.mp3tag.de/uploads/default/original/3X/b/5/b50056a12be5ae19a1eb93fe3935f696cb8141dd.png)

I also tried escaping these characters with backticks ```:

```auto
[IndexUrl]=https://www.metal-archives.com/search/ajax-advanced/searching/albums/?releaseFormat'[]'=CD&releaseFormat'[]'=Cassette

```

but the backticks are unfortunately included in the produced URL instead:  
 ![Screenshot 2024-02-10 131033](https://community.mp3tag.de/uploads/default/original/3X/7/a/7ad3e6613399a81b5f6a6674575d00c9da2b376e.png)

Using 3.24 (or 3.24a) x64 on win11.

Thank you

[Me&tal Archives#Search by Band + Album (non-working).src](https://community.mp3tag.de/uploads/short-url/gAGy8Vu7u0Jdn30aSInkpK0t14x.src) (5.3 KB)  
[Me&tal Archives#Search by Band + Album (original).src](https://community.mp3tag.de/uploads/short-url/fzE0SRegdyP86mytQcbvvez09Wy.src) (5.3 KB)

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [February 10, 2024, 11:28am UTC](https://community.mp3tag.de/t/in-a-web-sources-script-having-characters-in-indexurl-results-in-error-connecting-to-server-provided-uri-is-invalid/63726/2 "2024-02-10T11:28:26Z")

</div>

What happens if you try it with the encoded values like  
`%5B%5D`  
for `[` and `]`?

`[IndexUrl]=https://www.metal-archives.com/search/ajax-advanced/searching/albums/?releaseFormat%5B%5D=CD&releaseFormat%5B%5D'=Cassette`

I'm not sure why you use an ending apostrophe in your .src file for IndexUrl, but that seems to be necessary to find something?

---

<div class="post-metadata">

### Author: ![ricky](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/439d5e/32.png) [@ricky](https://community.mp3tag.de/u/ricky)
#### Post date: [February 10, 2024, 12:02pm UTC](https://community.mp3tag.de/t/in-a-web-sources-script-having-characters-in-indexurl-results-in-error-connecting-to-server-provided-uri-is-invalid/63726/3 "2024-02-10T12:02:03Z")

</div>

Yes, with the encoded values `%5B%5D` it's working fine, thanks a lot!

That ending `'` was kept by mistake, sorry. So the following is working fine:  
`[IndexUrl]=https://www.metal-archives.com/search/ajax-advanced/searching/albums/?releaseFormat%5B%5D=CD&releaseFormat%5B%5D=Cassette`

So, I don't know if my report is considered a bug( or rather a feature request), or if it works as expected?  
I mean, is percent-encoding is the way to go in such cases, or it would it be possible to also support `[]` characters in `IndexUrl`? (kindly cc @Florian)

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [March 5, 2024, 11:35am UTC](https://community.mp3tag.de/t/in-a-web-sources-script-having-characters-in-indexurl-results-in-error-connecting-to-server-provided-uri-is-invalid/63726/4 "2024-03-05T11:35:19Z")

</div>

> [@ricky](#):
>
> is percent-encoding is the way to go in such cases, or it would it be possible to also support `[]` characters in `IndexUrl`?

It depends on the concrete Tag Source and since this one requires percent encoding, it's necessary for the Tag Source developer to provide the correct formatting.

Mp3tag doesn't encode any of what's provided in `IndexUrl` and `AlbumUrl`, but encodes the _input_ provided according to the `Encoding` provided.
