Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
YouTube using short links?
« on April 8th, 2011, 02:41 AM »
http://www.simplemachines.org/community/index.php?topic=200401.msg3012232#msg3012232
Quote
I'm using the old Auto Embed Video Clips...

YouTube seems to now be using shortened links to vids.. so links change
from http://www.youtube.com/watch?v=iqXE9XWvMPM
to http://youtu.be/iqXE9XWvMPM

which in turn does not embed the video .. How can i update the code so that it embeds both the old and new format ??
Long version works here, short version does not. I don't particularly plan on documenting the fix publicly over there, but would be worth knowing that it needs to be fixed.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,000
Re: YouTube using short links?
« Reply #1, on April 8th, 2011, 12:04 PM »
Hmm... Well, I guess I'll have to fix that, then.

Oh, and the embed fixer doesn't deal with the iframe version (default one), or with the confidentiality version. It only does the 'old' version. I'll probably have to deal with that, too.
Re: YouTube using short links?
« Reply #2, on April 8th, 2011, 12:29 PM »
Okay, I took a couple of minutes to rewrite the regex... In all logic, this one should work: (Subs-Aeva-Sites.php:145)

Code: [Select]
'pattern' => 'http://(?:video\.google\.(?:com|com?\.[a-z]{2}|[a-z]{2})/[^"]*?)?(?:(?:www|[a-z]{2})\.)?youtu(?:be\.com/[^"#[]*?(?:&|&|/|\?|;|\%3F|\%2F)(?:video_id=|v(?:/|=|\%3D|\%2F))|\.be/)([\w-]{11})',
Re: YouTube using short links?
« Reply #3, on April 9th, 2011, 01:05 PM »
BTW, I'm making this public, in case someone wants to update their websites with this fix.
Just because I'm not gonna publish it on sm.org doesn't mean people should be left in the dark. :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: YouTube using short links?
« Reply #4, on April 9th, 2011, 04:01 PM »
I can confirm that the fix does work. I did get that much tested last night.

Nao

  • Dadman with a boy
  • Posts: 16,000
Re: YouTube using short links?
« Reply #5, on April 9th, 2011, 04:40 PM »
Good, good. (Not that I had any doubts about it working... It's my thing after all :niark:)

MultiformeIngegno

  • Posts: 1,337

Nao

  • Dadman with a boy
  • Posts: 16,000
Re: YouTube using short links?
« Reply #7, on April 10th, 2011, 04:08 PM »
I had a short visit on sm.org and saw this:
Quote
or why not just post the fix here instead ?
In the interest of clarity... First it was for convenience. I only post on wedge.org by now, and I posted it where I was asked for a solution -- in the private area. I made the topic public because I have nothing against my users (otherwise I wouldn't be working so much on community software, right?) I didn't really think about this link problem, but now that I've done it, let's just say I'm proving a point.

Wedge is not "competition" because it doesn't distribute anything[1]. And anyway, I call for these 'core values' of them. Whatever they say -- they didn't prevent anyone from discussing XenForo (here), so why do it for Wedge uh? Because it's an ego problem, not a competition policy.

If the SMF team wants to censor that link, they'll make that problem clearly obvious to the public. Most people wouldn't even notice what the forum is about. They just care for the fix.

So: the fix is here. If you want it to show up on sm.org, post the link, not the fix.
http://wedge.org/pub/off/6583/youtube-using-short-links/msg258097/#msg258097
 1. If anything, it simply discusses a *possible future* for SMF, something that some in the community might find enjoyable, precisely because it isn't the direction taken by the SMF team. And there's bound to be a few people who weren't thrilled by *all* of the SMF team's decisions in these last THREE years, right...? ::)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: YouTube using short links?
« Reply #8, on April 10th, 2011, 04:11 PM »
You'll notice that Kindred didn't bother to say I could post the link even though it would help SMF users... still, a number of people have PM'd me and they've all been given the link to the relevant post.

Nao

  • Dadman with a boy
  • Posts: 16,000
Re: YouTube using short links?
« Reply #9, on April 12th, 2011, 10:56 AM »
(I somehow missed your post earlier.)

Should *we* be surprised...?

Honestly, the only thing that surprises it at this point, is how cool they are about not being cool with us.
They're pretty much making it public that they hate us. ::)

They jumped off the cliff by themselves, so if they think we are the death of them, they should welcome us.

DoctorMalboro

  • I like rounded borders.
  • Posts: 316

Nao

  • Dadman with a boy
  • Posts: 16,000

DoctorMalboro

  • I like rounded borders.
  • Posts: 316

Nao

  • Dadman with a boy
  • Posts: 16,000

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: YouTube using short links?
« Reply #14, on April 12th, 2011, 05:27 PM »
I use it for a post, I don't think they ban me for quoting it... (I guess)