Code Monkey home page Code Monkey logo

Comments (11)

sheldond avatar sheldond commented on June 12, 2024

I've noticed more issues with youtube urls as follows:

 > auto_html("http://www.youtube-nocookie.com/embed/t7NdBIA4zJg") {youtube;}
 => "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
 > auto_html("http://www.youtube-nocookie.com/v/t7NdBIA4zJg") {youtube;}
 => "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
 > auto_html("http://www.youtube.com/embed/t7NdBIA4zJg") {youtube;}
 => "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"
 > auto_html("http://www.youtube.com/v/t7NdBIA4zJg") {youtube;}
 => "http://www.youtube-nocookie.com/embed/t7NdBIA4zJg"

These are all valid youtube urls. The domain youtube-nocookie.com is available as an option on youtube.com when embedding a video.

from auto_html.

sheldond avatar sheldond commented on June 12, 2024

Another issue (note the params at the end, outside the iframe):

 > auto_html("http://youtu.be/t7NdBIA4zJg?t=1s&hd=1") {youtube;}
 => "<iframe class=\"youtube-player\" type=\"text/html\" width=\"390\" height=\"250\" src=\"http://www.youtube.com/embed/t7NdBIA4zJg\" frameborder=\"0\">\n</iframe>?t=1s&hd=1"

from auto_html.

sheldond avatar sheldond commented on June 12, 2024

Another issue (the params are lost):

 > auto_html("http://www.youtube.com/watch?v=t7NdBIA4zJg&t=1m1s&rel=0&hd=1") {youtube;}
 => "<iframe class=\"youtube-player\" type=\"text/html\" width=\"390\" height=\"250\" src=\"http://www.youtube.com/embed/t7NdBIA4zJg\" frameborder=\"0\">\n</iframe>"

Hopefully this is helpful and not annoying :)

I'm hoping to use auto_html to process user input, so the url could be in any format.

from auto_html.

hinrik avatar hinrik commented on June 12, 2024

It also doesn't support short youtube urls like "http://youtu.be/t9sFUH-HTUc".

from auto_html.

sheldond avatar sheldond commented on June 12, 2024

youtu.be links work for me:

 > auto_html("http://youtu.be/t9sFUH-HTUc") {youtube;}
 => "<iframe class=\"youtube-player\" type=\"text/html\" width=\"390\" height=\"250\" src=\"http://www.youtube.com/embed/t9sFUH-HTUc\" frameborder=\"0\">\n</iframe>"

from auto_html.

hinrik avatar hinrik commented on June 12, 2024

Ah, sorry. My bad.

from auto_html.

dejan avatar dejan commented on June 12, 2024

Yeah, youtu.be works in 1.4.2.

@sheldond thank you for listing these issues, I'll have them fix soon.

from auto_html.

sheldond avatar sheldond commented on June 12, 2024

Here's a regex that may be helpful, taken from https://github.com/rgrove/sanitize

/\Ahttps?:\/\/(?:www\.)?youtube(?:-nocookie)?\.com\//

from auto_html.

mindware avatar mindware commented on June 12, 2024

The following also fails to be properly digested by auto_html:
http://www.youtube.com/watch?feature=player_embedded&v=l7AWnfFRc7g

from auto_html.

pyro2927 avatar pyro2927 commented on June 12, 2024

Over a year later, but I'm also seeing issues with 1.6.4:
2014-06-25 at 4 33 pm
No go with youtu.be, nor any https:// urls.

from auto_html.

neilvanbeinum avatar neilvanbeinum commented on June 12, 2024

Thanks for writing this library. I'm also hoping to use it in a project. However I'm having the same problem with embedding https video URLs. The unit test for correct conversion of an https URL into an embedded youtube link seems to work though.

from auto_html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.