Jump to content

How to validate and open an URL with HTML/JavaScript?


Badchip

Recommended Posts

I have a website with some TV channels. One of them have 3 variable URL's (.m3u8), only works 1 URL at day, it's random.
I'd like to click the channel/button/icon in order to open automatically the working URL.
Thank you in advance.
Link to comment
Share on other sites

How are you supposed to know which URL works if it's random?

No idea, I thought maybe there is a way to test/validate each one and open the working URL.

Try to open the 3 URL's. One of them can download the "m3u8" file, the rest shows the message: "An error occurred while processing your request."

Edited by Badchip
Link to comment
Share on other sites

I suppose you can try sending ajax requests to each of them if that server allows cross-domain ajax requests, and then check the response headers to look for an error or something else that would indicate a problem.http://help.dottoro.com/ljxsrgqe.phpIf the server doesn't allow cross-domain ajax requests then you'll need to send an ajax request to a local file like a PHP script that can send the requests and check the headers.

Link to comment
Share on other sites

  • 2 weeks later...

I suppose you can try sending ajax requests to each of them if that server allows cross-domain ajax requests, and then check the response headers to look for an error or something else that would indicate a problem.http://help.dottoro.com/ljxsrgqe.phpIf the server doesn't allow cross-domain ajax requests then you'll need to send an ajax request to a local file like a PHP script that can send the requests and check the headers.

 

The problem is I have no idea of programming. Some kind soul can help me out? I guess it's easy for any programmer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...