×

Warning

Empty password not allowed.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Youtube.com vs. youtu.be? 9 years 2 months ago #289825

  • Rudolf Rednose
  • Rudolf Rednose's Avatar Topic Author
  • Offline
  • Banned
  • Banned
  • Posts: 1689
  • Thank you received: 2783
i noticed that if I post video links from Europe, it doesn't show in the U.S..

Here you automaticly get the youtu.be link instead of the youtube.com link.
They say you have to convert it.

Youtube has introduced a new URL shorthand – youtu.be
For example youtu.be/DIArJjU8HjE takes you to
youtube.com/watch?v=DIArJjU8HjE&feature=youtu.be
Annoyingly this means that any users pasting a youtu.be URL into your video parsing scripts will be told it doesn’t work, so we’d best get updating those scripts!

Pop this in before you start processing the url, where $url is, not surprisingly, the url to be parsed.
//dMb 21/4/2011 Hack to handle youtu.be URLs dave@absolutedisaster.co.uk$needle = '/^(http://)*(www.)*(youtu.be)/([A-Za-z0-9]{11})$/';preg_match($needle, $url, $result);if($result[3] == 'youtu.be'){ $url = 'www.youtube.com/watch?v=' . $result[4];}//dMb end hack
[update 20110720-1657]While implementing this and similar for grabbing youtube thumbnails today I suddenly though, what if youtube ever starts using https? Well, the odds may be slim, but the costs of allowing for it are negligible, so why take the risk?
//dMb 21/4/2011 Hack to handle youtu.be URLs dave@absolutedisaster.co.uk//dMb 20/7/2011 Updated to allow for https$needle = '/^(http(s?)://)*(www.)*(youtu.be)/([A-Za-z0-9]{11})$/';preg_match($needle, $url, $result);if($result[4] == 'youtu.be'){ $url = 'http' . $result[2] . '://www.youtube.com/watch?v=' . $result[5];}//dMb end hack




Now I manually change www.youtu.be/@@@@@@@@@@ to www.youtube.com/watch?v=@@@@@@@@@@@
......and just hope for it to show.

Might this be something to be made easier in Dogfight Elite?
The following user(s) said Thank You: MICHAEL KANE.., Armament

Please Log in to join the conversation.

Last edit: by Rudolf Rednose.
  • Page:
  • 1
Time to create page: 0.405 seconds