Url Block Problems

Hey! I was working on a project that could retrieve information from a YouTube channel (like channel name, subscribers, etc.) and when I tried loading the URL it returned as blank. Is there any way to fix this?
untitled script pic (16)

It's because of CORS. Try it again but with a CORS proxy like cors-anywhere. Also, I think you should use the youtube api instead.

Like ego-lay said, you need a CORS proxy.
I wouldn't recommend cors-anywhere (simply because you have very limited requests), and instead I would say using AllOrigins is a better solution.

The (raw) request for AllOrigins is https://api.allorigins.win/raw?url=https://example.com, where example.com is whatever website you are trying to get the contents of.

about why I said raw

If you use get instead (replacing raw in the example with get) you need to parse JSON. That's not hard using the key/value blocks that appear in the HTTP library, but it's certainly more blocks.

Just use asoc and split by json. I personally think doing this is better than not, because sometimes you get more information.

Operating word being sometimes. Maybe you do need that (information), in which case you would not use raw, but I have never needed the extra information that AllOrigins gives, and haven't heard of/from anybody who has.

Isn't "key word" what's usually used there?

I don't believe there is a difference(?). Personally, I most commonly use operating word.

I see operative word with the same meaning, but, (so far) no operating word.

I think that is what I meant to mean- thanks.

Don't you mean "meant to say"? Unless I'm reading that wrong.

No, I meant meant to mean. I said operating word when I meant operative (or similar). I knew I was saying operating word, because I thought that was correct, but meant the meaning of something like operative.

You're starting to confuse me, but I think I get your point.

I had to read that out loud to myself like 5 times... I'm confusing myself too!

thanks :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.