When i click url:
https://youtu.be/rCiqxFuRi6o?rel=0&wmode=transparent
It redirects to
https://www.youtube.com/watch?v=rCiqxFuRi6o&feature=youtu.be&rel=0&wmode=transparent
How to get programatically from android app this redirected link?
I want finally to get youtube video id.
when you connect to https://youtu.be/rCiqxFuRi6o?rel=0&wmode=transparent
you'll get http 302 status (redirection) :
HTTP/1.1 302 Found
Date: Thu, 07 May 2015 14:25:38 GMT
Server: gwiseguy/2.0
Location: https://www.youtube.com/watch?v=rCiqxFuRi6o&feature=youtu.be
Content-Length: 0
Content-Type: text/html
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
so you just need to read the Location header from the http response header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With