Wedge

Public area => The Pub => Off-topic => Topic started by: Arantor on April 8th, 2011, 02:41 AM

Title: YouTube using short links?
Post by: Arantor 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.
Title: Re: YouTube using short links?
Post by: Nao 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.
Title: Re: YouTube using short links?
Post by: Nao 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})',
Title: Re: YouTube using short links?
Post by: Nao 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. :)
Title: Re: YouTube using short links?
Post by: Arantor on April 9th, 2011, 04:01 PM
I can confirm that the fix does work. I did get that much tested last night.
Title: Re: YouTube using short links?
Post by: Nao 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:)
Title: Re: YouTube using short links?
Post by: MultiformeIngegno on April 9th, 2011, 05:26 PM
Narcissistic mode on :niark:
Title: Re: YouTube using short links?
Post by: Nao 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(http://www.simplemachines.org/community/index.php?topic=394724.0)), 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...? ::)
Title: Re: YouTube using short links?
Post by: Arantor 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.
Title: Re: YouTube using short links?
Post by: Nao 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.
Title: Re: YouTube using short links?
Post by: DoctorMalboro on April 12th, 2011, 02:11 PM
Well, at least ONE link is accepted :P
Title: Re: YouTube using short links?
Post by: Nao on April 12th, 2011, 04:14 PM
?
Title: Re: YouTube using short links?
Post by: DoctorMalboro on April 12th, 2011, 04:20 PM
At least the staff alow to quote this post for a proper answer.
Title: Re: YouTube using short links?
Post by: Nao on April 12th, 2011, 04:32 PM
Didn't they say they didn't want that?
Title: Re: YouTube using short links?
Post by: DoctorMalboro 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)
Title: Re: YouTube using short links?
Post by: Nao on April 12th, 2011, 06:16 PM
...I don't see your post in the AeMe topic?
Title: Re: YouTube using short links?
Post by: Arantor on April 13th, 2011, 04:30 PM
No, it's in the Spanish board, which means people just don't look there too hard ;)
Title: Re: YouTube using short links?
Post by: DoctorMalboro on April 13th, 2011, 04:59 PM
They wouldn't even care if I post porn in that board, actually...
Title: Re: YouTube using short links?
Post by: Nao on April 13th, 2011, 06:14 PM
I guess that since it's safe to assume they read these boards, they'll end up finding your link... :whistle:
Title: Re: YouTube using short links?
Post by: Nao on April 14th, 2011, 12:35 AM
Re: smf tag on sm.org: I think it's explained in the tag help popup. [smg id=1,2,3] should show a row of items. That's how I set it up and it makes sense to me....... ::)
Title: Re: YouTube using short links?
Post by: Arantor on April 14th, 2011, 12:36 AM
Meh, I couldn't remember that syntax.
Title: Re: YouTube using short links?
Post by: Nao on April 14th, 2011, 07:55 AM
Not a problem. Still... Please RT? ;)
Title: Re: YouTube using short links?
Post by: Arantor on April 14th, 2011, 09:23 AM
Done.
Title: Re: YouTube using short links?
Post by: Nao on April 14th, 2011, 09:55 AM
Thanks...... But that's not a repost, it's a totally new post that doesn't say the same thing as I do..... :whistle:

And I was on my iPod when I typed my post. Believe me, finding the [ and ] keys is annoying in that situation :P
Posted: April 14th, 2011, 09:43 AM

Okay, I'm testing the feature I said, and it's not working... Gimme a minute.
Posted: April 14th, 2011, 09:46 AM

Well, it appears it's buggy.
[smg id=1 type=album] will work, generating a list of thumbnails from a specific album.
[smg id=1,2,3,4,5] (type=normal or preview) will only show the first item in the list.
It SHOULD be showing a list of items next to each other.

This bug was never reported to me because, well, people don't use the smg tag much, and don't ever read the helper popup, even though it's handily available and it's full of humor to make it less tedious to read... (And to translate ::))

I guess I'll add this to my to-do of fixes for Wedge. I won't fix it in AeMe, though.
Feel free to delete your post or indicate that I'm sorry it doesn't work as expected and it'll be implemented in Wedge.
Posted: April 14th, 2011, 09:51 AM

(BTW, your post said smg=1,2,3 without the id. That's what I meant when I said it wasn't a repost.)
Posted: April 14th, 2011, 09:52 AM

Also, I think I should mention that the smg tag has too many possible types. I will probably remove the 'link' type at some point, and replace the 'normal' type with a simple thumbnail with name. The reason is that now that thumbnails in album pages show more details on hover rather than systematically, it shouldn't break page layouts anymore.

PS: oh, and for those who don't have access to the svn -- when I say "smg tag", I mean "media tag". It was renamed when I moved it over to Wedge, obviously. Since all posts have to be re-imported anyway, it was the right time to do it...
Title: Re: YouTube using short links?
Post by: Dismal Shadow on September 1st, 2011, 08:42 AM
Quote from Nao 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})',
Doesn't work with: "Default YouTube quality: HD where available"

Bug? :P  Maybe that's why it isn't working here too?
Title: Re: YouTube using short links?
Post by: Dismal Shadow on September 1st, 2011, 08:53 AM
http://youtu.be/_5i1Dyj5k1A?hd=1

http://youtu.be/_5i1Dyj5k1A?

Apple - iPad 2 - TV Ad - Learn(http://www.youtube.com/watch?v=_5i1Dyj5k1A#ws)

1-
Code: [Select]
http://youtu.be/_5i1Dyj5k1A?hd=1

2- 
Code: [Select]
http://youtu.be/_5i1Dyj5k1A?

3- 
Code: [Select]
http://www.youtube.com/watch?v=_5i1Dyj5k1A
Title: Re: YouTube using short links?
Post by: Arantor on September 1st, 2011, 09:20 AM
I suspect the patch has not been applied here, even if it's been patched for some time in Wedge itself.
Title: Re: YouTube using short links?
Post by: Nao on September 1st, 2011, 08:06 PM
wedge.org is unpatched. Didn't bother.

Is the HD option still relevant today? Does it still work?