Have links to YouTube been disabled?

Well damn, there goes that theory – I didn’t expect it to work, and it did – and this time, didn’t even have the (usually necessary) trailing slash at the end of the URL. I swear it must be an entirely random process specifically designed to drive us mad!

Race conditions drive us programmers mad, tool.

Experiment for everyone:
If you want to post something with a video, do not insert the YouTube link immediately. Finish the text part of the post, and when you’re ready, paste the YouTube link (in whatever format) into the appropriate place. Immediately (within a second–do not wait for the link to reformat into a video box), hit “reply”.

Worth a try, but as I said, in the above post I intentionally waited a few seconds after inserting the video link before posting, and it still worked. Madness, I tells ya! :smiley:

It may take longer than a few seconds in some cases.

I tried some of my links above again, and it failed. One thing I noticed: it was impossible to get the preview window to not show the thumbnail immediately. It seems that Discourse has already cached it–which may be related to the problem. Normally, it takes a short while for the bare link to convert. In the meantime, it just shows up as a plain URL.

Once more, with a tweak:

Ok, that worked again, because I tweaked the URL slightly (added a t=1 parameter). Discourse presumably could not fetch the preview from its cache, and had to fetch it from YouTube again–but I posted before that process finished, and so it worked.

The different hostnames, slashes, etc. aren’t really doing anything directly, but they break the Discourse cache, and so give the user a small chance of it working again.

Makes sense. Yet more knowledge added to the bag-o-tricks! Sure wish they would fix this, though.

I just copied the “embed code” ^, and i got no error !
I also didn’t get a preview or anything.
Or anything in the post !

I think that’s the problem. It looks definitively like a Discourse bug.

We aren’t allowed to locally store images and videos, any media really. Because the SDMB doesn’t want to become a file storage site. Fair enough.

Discourse is set up to display images, videos, and so on hosted on other sites.

Recently, there is a bug where if Discourse caches a video for you (not hosting, just caching) it mistakenly thinks that the cache it created is a video being uploaded to the site. Since that’s not allowed, it won’t let you do it. You have to post a bare link.

I suspect youtu.be works better because the redirect delays the caching process, and increases the chance of submitting your post before it finishes the cache.

In the past I’ve tried to post multiple videos and failed because I’ll put one, then grab another, paste it, and so on. It has plenty of time to cache the videos before I post, and then stops me.

This also explains why you can sometimes post a video but can’t edit it. It has already cached by the time you edit your post, and stops you from submitting the update. Also, posting a link that never makes a preview always works (such as a link on the same line as other text), but then readers must click to another page to view it.

Honestly, this explains everything. I really wish we knew if TPTB at Discourse (@codinghorror and so on) are aware of the issue and are working on it.

Agreed. Something about the preview generation is flagged as a media item, and not… whatever else these things get classified as in the system. Discourse sites without the restriction don’t have the issue at all, which may be why this doesn’t seem to be a high priority bug.

Quite possibly. But I suspect it’s more often a case of the user trying a normal link, failing because the caching happened, then trying a new URL format (which could have been anything, even just adding a trailing slash), and then seeing it work because they probably hit the reply button immediately after (instead of continuing to work on the post).

I don’t think the embedded method works at all–one of the many HTML codes that aren’t supported in posts. But you do seem to have discovered a method of producing zero-length posts :slight_smile: .

I can say that’s not the case for me. Once I learned that youtu.be worked better, I stopped doing it any other way and never posted the regular link anymore. My behavior was the same as before, only the url format changed. But I found that regular YouTube links never worked, and youtu.be did at least most of the time.

Just wanted to post an update… I’ve gotten in the habit of putting my post together in another format (like a text file), then copying-and-pasting into a post, then submitting immediately. So far, no issues.

I mean, it still sucks that I have to jump through these hoops, but at least it works.

Back in the day of the no-edit or even the short-edit window I used to write / edit / proof most of my posts in Word, then copy/paste them into vBulletin. A PITA, but a necessity in the no-edit no-spellcheck Darkye Olde Dayes of Yore for anything longer than a couple of sentences.

As a temporary workaround for the current YouTube glitch that’s certainly a good suggestion.

My current strategy is just to write the post, then make a separate post for the video, which I submit quickly.

Or just write the post, leaving a spot open for the video link, then paste the link in just before submitting.

Have we gotten any kind of consensus about speed having any actual effect? Or is that just an occasional coincidence?

My primary issue is my typical multi-paragraph post is posted then edited 4 or 6 more times before I’m done with it. There’s always one more tyop to spot or one more word order out of.

Therefore I can’t put the vid link in the first time and I also can’t edit it in the last time. Yes, as mentioned just above I could run through all e.g. 6 versions in Word then post the final no kidding final version just once with the vids in place.

I’m about 95% certain that the problem arises due to the detection/conversion/thumbnail step (and the fact that we disallow embedded media here). Speed is only important in that it’s an asynchronous process and if you paste a link quickly and then submit, it’s likely that the process has not finished yet.

I’m also about 95% certain that if you post, and the asynchronous process completes (which you can see happening dynamically), and then edit your post, it will then not succeed, because the once the thumbnail gets cached, the converted URL comes up immediately rather than after a second or two.

If you need to edit your post, you can try one of the alternate URLs, like youtu.be. You can also put a “&t=0” at the end of the URL. Discourse isn’t that smart and it caches based on the exact text of the URL. In fact you can probably just append “&blah=blah” or whatever to confuse Discourse (haven’t tried it, but I think it’ll work). Just change it to something else every time you edit.

Yeah, after a few experiments: just append a “&1” to the end of the URL. If you need to edit or aren’t quick enough, change to “&2”, “&3”, etc. Just make sure you submit before the thumbnail pops up.