Googtube works perfectly well for me apart from one thing: if my readers embed a URL from the UK version of YouTube, the http://uk. part of the URL is shown on the page above the video. Any suggestions to resolve this?

Thanks in advance.

Comments

fnapo’s picture

I'm using the Italian version, and I've the same issue. Probably easy to solve with regexp, but don't know how :) This is the code I get in the post:


    <p>http://it.<embed src="http://www.youtube.com/v/JkdgGW....

BTW, excellent module, i had the same problem with multiple players in one pages, but solved with reordering.

Thanks

muka’s picture

ciao

i'm using this (nearly line 50 of googtube.module file)
$text = preg_replace_callback('!(((http://)?)|(^./))(((www.)?)|(^./))(([a-zA-Z]{2,5}[.])?|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(((&|&).+[^< ])?)!i', 'googtube_youtube', $text);

not sure if it's correctly structured but seems to work.

I've added
(([a-zA-Z]{2,5}[.])?|(^./))

and that should resolve the bug of http://it. not replaced

I've appended either
(((&|&).+[^< ])?)

to the regex's end in case of link like
http://youtube.com?v=key&related=...
are inserted

the char that delimits the end of the url is a space or a < (another word or a new tag)

bye,
Luca from the http://valsuganagiovani.it team

ssutankayo’s picture

somehow the (([a-zA-Z]{2,5}[.])?|(^./)) addition doesn't work for me but i'm not sure why it wouldn't. but it's not a big priority for now.

alexandreracine’s picture

Status: Active » Postponed (maintainer needs more info)

If someone create a patch against the 5.x-dev module for this problem, put it here with a couple of example urls, I'll test it and commit the code.

alexandreracine’s picture

Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Closed (fixed)

Reopen if someone have a patch.